[Bf-python] Adding help info to scripts

Willian Padovani Germano wgermano at ig.com.br
Fri Nov 5 00:25:35 CET 2004


Hi Toni,

>and didn't the technique Stani showed for specifying the author, version, info urls etc. seem ok?
>  
>
Yes, you probably answered before reading my reply to that, but the 
method with __author__, etc works nice and I already implemented it 
today substituting the old way, so no worries.  As I wrote there I'll 
also make the first """...""" block be accepted as help info *if* 
there's no __bpydoc__ and __doc__ vars defined in the script.

>and parsing is surely no problem 'cause the tools 
>for it must exist already in the Python libraries.. (in docutils or?)
>  
>
Parsing the vars was done "by hand".  If the scripts to be parsed were 
modules we could simply import the vars from them, but any actual 
command in an imported module gets executed upon importing, so we can't 
do that to executable scripts, like the case with bpython scripts.

So don't worry, the format was changed to something more "pythonic", 
thanks Toni and Stani for pointing my mistake here.

Ah, just one detail: in my reply to Stani/LarstiQ I mentioned an 
implemetation thing: using getsetters is an internal C code newer / 
better method not used in bpython.  What Stani mentioned -- accessing 
class member variables directly: camera.lens = 10, for example, already 
works fine in the API or at least most of it.  A Python programmer is 
free to use that instead of the .get*** and .set*** methods.

-- 
Willian




More information about the Bf-python mailing list