D 2018-02-04T19:43:28.835 L Usage P 2a21c286e1eb46ac6e892fb5b377fde8c46442adae80ed2d167b8add0e65cca0 U gwlester W 2880
This will add pathName to the list of directories that Python searches for where to find Python module files to be imported. This is roughly akin to lappend of a directory to Tcl's auto_path variable or doing a ::tcl::tm::path add to add a directory to the directories searched for module files.
Z 37473ff6adca9c1c31a134ecdc50a0a9This will import the Python module and analize the module using the Python introspection tools. The following will be done:
- A namespace to contail the Tcl functions and class wrapers for the functions and class will be created. If the -namesapce option was present than its value, nsName, will be used. Otherwise the namespace will be named ::pyman::pythonModuleName where pythonModuleName is the name of the Python module that was imported.
- For each function found in the module, a Tcl wrapper function will be generated that take the same arguments and will call the Python function and return its results.
- For each class found in the module, a TclOO wrapper class will be generated. This class will have the same methods with the same arguments as the public methods in the Python class.
- Creation of a new TclOO object of this class will result in a Python object of the same class being created.
- (Not yet implemented) Calls to class methods of the class will call static methods of the Python class.
- Calls to instance methods of the class will call instance methods of the corresponding Python object instances.
- Instance attributes can be accessed via the following special methods:
- _attributes -- Get a list of attributes and their allowed values.
- _getAttribute attributeName -- Return the value of the named attribute.
- _setAttribute attributeName value -- Set the named attribute to the specified value. (Note: not all attributes can be modified).
- The Tcl programmer is allowed to add additional methods and/ or variables to the TclOO class and/or instances of the class, these will only be visble from Tcl.