feat(action_manager): Action Manager module integration
Integrates https://github.com/TsXor/photoshop-ActionManager-python with minimum modification to main tree. There's a problem: it seems that the generated code reference is not enough to document my submodule. So what should I do to add more document? By posting it in gist and attach a hyperlink?
welp I've corrected using flake8, but I don't know what else linter hound is using...
I did poetry run pip install flake8-black and ran flake8 again, but still no more error...
https://gist.github.com/TsXor/62a46f8f2846261bba7db1cc7ff02711
Just like Action Manager, I think a HowTo is more useful for this submodule.
The import error is because the server used for importing does not have photoshop installed.
This is fine for testing import. This module doesn't actaully need to do com binding on import because all these classes that inherited Photoshop in _core.py is only defined but not initialized before users of this module do anything.
However, utils.py in my submodule breaks this because it initializes a ps.Application instance on importing for typeid conversion. This will not cause error on real situations, but will make it fail the import test.
This can be tackled by not initializing an app on import and trigger the initialization when any of these functions that need an app is executed.
You can get typeID collision detector at gist.
It was first designed to save all the typeID mappings into pickles and free str2id() from initializing an app, but that will bring extra task on photoshop version checking, so I developed the current str2id().
Collision record doesn't need versioning because it is small, therefore have very little possibility to be not backward-compatible.
Something more about charID:
charID can be converted to typeID without photoshop app, for how to do this, see str2hash and hash2str in utils.py.
You may think photoshop api can throw an error when you try to convert a non-existing charID, but the fact is that it cannot.
hound says: line break before binary operator me: alright move it hound says: line break after binary operator me: ????????????????? I know if i make put all that string in one line ... then hound will say: line too long