Sardana 2.8 - macro is not visible after restarting sardana.
|
|
---|---|
Hello, There is a problem with macro, when macro file starts with letter 'A' and imports something from another file from the same location (macros directory). See below for more details. There are two files in macros directory: AuxilliaryFunctions.py and AMacro.py. First contains only function Func1(), second is a macro with content:
We added this macro using command "SetMacroCode". Macro is visible until sardana device is turned off and turned on again. I noticed that there are two solutions to make macro visible again:
We use sardana ver. 2.8 - the latest version available for python 2.7. |
|
|
---|---|
Hi Piotr, I have tried your case and I was not able to reproduce your problem. I was using Sardana 2.8.0. What I did was:
But, it does not surprise me that it fails to you. The macro loading mechanism is a little bit fragile. If I remember correctly it will get a list of all modules in the MacroPath and import them manually using the imp.load_module function. The order of importing this modules in not easily known. For the cases like you describe we introduced the PythonPath property. Could you set it to the same directory as the MacroPath. I think this should solve your issue. Note that we are working on refactoring the macro plugin system to avoid this kind of issues in SEP19. Also, I recommend you to report your issues directly on the Sardana project on GitHub. These will be more visible to the Sardana users and developers. Thanks for the comprehensive report with all the details! Cheers! |