Options:
Issues: Python2 and Qt4 not really supported under Debian-11.
Tests have started.
When the Macroserver starts, all Python files in the MacroPath directories are imported. This way, Macros are made available. If there are other Python files in the MacroPath, they are also imported.
Two rules:
Bad code:
#!/usr/bin/env python # # BAD: DoSomething() is executed during imports # def DoSomething(): print( "Hello world") return DoSomething()
Correct code:
#!/usr/bin/env python # # Good: DoSomething() is NOT executed during imports # def DoSomething(): print( "Hello world") return if __name__ == "__main__": DoSomething()
Note: SardanaMacroTester.py finds naming conflicts for Macros and scripts
not containing 'macro' and not containing __name__
.
Sometimes scientists collect Macros for a user group in a module, say mod1.py. The next user group might require small changes. If mod1.py is copied to mod2.py (which is then changed) the naming conflicts arise. Solution: rename mod1.py to e.g. mod1.py.DateTimeUniKiel.
...
, testAlive=True): should launch a pyspMonitor, if there is none. Status: testing