) |
This basically contains the globals defined in draw.py, colors.py, and formex.py, as well as the globals from numpy. It also contains the definitions put into the pyformex.PF, by preference using the export() function. During execution of the script, the global variable __name__ will be set to either 'draw' or 'script' depending on whether the script was executed in the 'draw' module (-gui option) or the 'script' module (-nogui option).
dic) |
names,values) |
names) |
oldnames,newnames) |
clas=None,dic=None) |
If no class is given, Formex objects are sought. If no dict is given, the objects from both GD.PF and locals() are returned.
name) |
question,choices=None,default='') |
If no choices are presented, anything will be accepted. Else, the question is repeated until one of the choices is selected. If a default is given and the value entered is empty, the default is substituted. Case is not significant, but choices are presented unchanged. If no choices are presented, the string typed by the user is returned. Else the return value is the lowest matching index of the users answer in the choices list. Thus, ask('Do you agree',['Y','n']) will return 0 on either 'y' or 'Y' and 1 on either 'n' or 'N'.
question) |
message) |
message) |
message) |
cmdline,result='output') |
If result == 'status', the exit status of the command is returned. If result == 'output', the output of the command is returned. If result == 'both', a tuple of status and output is returned.
scr,name=None,filename=None,argv=[]) |
There is a lock to prevent multiple scripts from being executed at the same time. This implies that pyFormex scripts can currently not be recurrent. If a name is specified, set the global variable GD.scriptName to it when the script is started. If a filename is specified, set the global variable __file__ to it.
If step==True, an indefinite pause will be started after each line of the script that starts with 'draw'. Also (in this case), each line (including comments) is echoed to the message board.
) |
s,glob,paus=True) |
msg=None) |
If an argument is specified, it will be written to the message board.
The exitrequested signal is usually emitted by pressing a button in the GUI. In nongui mode the stopatbreakpt function can be called from another thread.
mode=True) |
) |
fn,argv=[]) |
fn is the name of a file holding a pyFormex script. A list of arguments can be passed. They will be available under the name argv. This variable can be changed by the script and the resulting argv is returned to the caller.
fn=None,argv=[],step=False) |
This function does nothing if no file is passed or no current file was set.
all=False) |
args) |
Arguments are interpreted as names of script files, possibly interspersed with arguments for the scripts. Each running script should pop the required arguments from the list.
F) |
) |
) |
) |
) |
) |
fn) |
If fn is a directory name, the current directory is set to fn. If fn is a file name, the current directory is set to the directory holding fn. In either case, the current dirctory is stored in GD.cfg['workdir'] for persistence between pyFormex invocations.
If fn does not exist, nothing is done.
) |
This function is deprecated: use chdir(_file__) instead.
) |
args=[]) |