![]() |
| ||||||||||||||||||
![]() |
| ||||||||||||||||||
|
When using Yanaconda, the rest of the plugin is a straightforward macro. The variable
'Request' contains the specified request, e.g. 'GetByFTP' and can be used to execute different parts of the macro. Selections can currently not be accessed.
When using Python, the first command must be import yasara Immediately afterwards, you can access the data passed to the plugin as well as call YASARA functions. The predefined variables are listed below,
the most important one is yasara.request, a string indentifying the user's request. In the above example,
there is only one possible request: 'GetByFTP'. When YASARA starts up and registers the plugins,
it also sends a 'CheckIfDisabled' request, giving the plugin the possibility to exclude itself from registration.
The remaining plugin scaffold therefore looks like that:
if (yasara.request=="CheckIfDisabled"): # ASSIGN A 1 TO yasara.plugin.exitcode IF THIS PLUGIN CANNOT WORK AND SHOULD # BE DISABLED (DATA MISSING, WRONG OPERATING SYSTEM ETC.) if (....) yasara.plugin.exitcode=1 elif (yasara.request=="GetByFTP"): # DO THE WORK # END THE PLUGIN, MUST BE THE LAST COMMAND yasara.plugin.end()
| ||||||||||||||||||