moul-scripts
moul-scripts copied to clipboard
Change the plasma module so that it's statically analysable
Which provides code linting etc.
I added plasma/__init__.py which exposes all the contents of the files in plasma/ that were imported separately before. All imports have been changed to from plasma import *. For now I changed Plasma.py to PlasmaStubs.py to not conflict with the engine's Plasma module. Hoikas proposed changing the engine's module instead, to _Plasma (I didn't do that because I don't have engine development set up).
I also changed the Plasma stubs to raise NotImplementedError(), further improving code linting.
Amended.
I missed converting the import Plasma... cases (e.g. import PlasmaControlKeys), which were not analysing correctly as a result. Amended now.
Removed line ending changes, moved change to #123
Todo before this is merged: check for any naughty assumptions in plPythonPack and verify that packed python works after repacking with this.
This will probably be deferred until we're on Python 3, as we may want to use stub files for the plasma module.