> > In my mind, a simple copy/paste of the python code to an html page is >> enough. regexp are certainly very powerful, but I never understood anything >> and am completely unable to read regexp python code! The solution must be >> easy to use and, most important, be robust since the samples often change >> (new ones, deleted deprecated ones, modifications etc.). To be pragmatic, >> here is what I want: >> - a script, for instance 'convert_samples_to_html.py' that I launch once, >> - the script finds all the .py files in the /src/samples/* directory, >> - run each sample to get the screenshot, >> - create one html page for each sample, >> > > After thinking of it a little I realized things are not always that simple. > Indeed some samples (don't know how many) don't fit. Indeed those scripts > (like geometry_demo.py) illustrate many capabilities. Thus they are based on > a GUI with menus which call a specific function (associated with a given > capability). Therefore, there are many screenshots to take, and it's not > possible to get them by simply importing the sample. >
the functions for that are executed by the menu items are accessed by w._key_map[ord('n')] so maybe we could add something like try: while True: sample.w._key_map[ord('n')].next()() #make screenshot except StopIteration: #make screenshot the normal way > > >> - at the end, a kind of 'index.html' shows all the available samples with >> hyperlinks to each one. >> > > Ok. > Another option to html is to create wiki formatted text that we can dump directly into the wiki mediawiki formatting<http://www.mediawiki.org/wiki/Help:Formatting>and dump them into the db, then it'd be nicely integrated with the rest, and we could easily link to and from the samples as the wiki grows. I also saw there's a plugin to enable commenting on on wiki pages, so maybe at the next stage we could make some semi-public area for people to post/discuss/improve pieces of code. Henrik
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users