06-02-2020, 01:50 PM
The spt file is actually an executable python script (it has to run in a specific context, namely the Plugin loader, mostly because of assumed variables), but the only requirement is that it is valid Python. The only reason we use triple quotes is because Python is excellent at handling long multi-line strings (I have never seen anything better in any language I have ever programmed in). So rather than creating a file format that has all these parsing problems, I just made it in to a Python file and then call "exec()" on the whole thing. You can even put variables and loops in there if you really want. The other thing that is really nice about using Python as well as Python long strings was our design requirement that plugins diff correctly on tools like Git even though the column names contained structures like json and XML.
HOWEVER, the plugin manifest can export itself. You don't have to write a CSV exporter. In the Plugin Manager, just select your plugin, go to the "Manifest" tab and click "Export". All the spt files will be generated automatically.
If ever you do need to run some custom python code, there is a tag in the manifest that can run arbitrary python scripts:
<python path="sql_upgrade.py" undo_path="sql_upgrade_undo.py"/>
We usually put some logic here, mostly to do some database preparation or adding new columns.
There is some documentation here:
http://community.southpawtech.com/docs/d...-a-plugin/
I do realize that these docs are kind of thin and there is a *LOT* more you can do with plugins than is described here. We're going to have to update this at some point. Until then, you can just ask questions here. At some point I can take all of this writing and make it into real docs.
HOWEVER, the plugin manifest can export itself. You don't have to write a CSV exporter. In the Plugin Manager, just select your plugin, go to the "Manifest" tab and click "Export". All the spt files will be generated automatically.
If ever you do need to run some custom python code, there is a tag in the manifest that can run arbitrary python scripts:
<python path="sql_upgrade.py" undo_path="sql_upgrade_undo.py"/>
We usually put some logic here, mostly to do some database preparation or adding new columns.
There is some documentation here:
http://community.southpawtech.com/docs/d...-a-plugin/
I do realize that these docs are kind of thin and there is a *LOT* more you can do with plugins than is described here. We're going to have to update this at some point. Until then, you can just ask questions here. At some point I can take all of this writing and make it into real docs.