When using the rellib macro, spock reports that the library was correctly reported:
door_exp [1]: rellib crystallography crystallography successfully (re)loaded
However seems that the code was not reloaded and on the MS logs we can see an error:
SardanaTP.W010 DEBUG 2014-10-22 12:55:02,876 BL13/DOOR/03.MacroExecutor: [START] runMacro Macro 'rellib(crystallography)' SardanaTP.W010 DEBUG 2014-10-22 12:55:02,880 ModuleManager: unloading module crystallography SardanaTP.W010 ERROR 2014-10-22 12:55:02,881 ModuleManager: Error (re)loading module crystallography SardanaTP.W010 DEBUG 2014-10-22 12:55:02,881 ModuleManager: Details: Traceback (most recent call last): File "/homelocal/sicilia/lib/python/site-packages/sardana/sardanamodulemanager.py", line 196, in reloadModule mfile, pathname, desc = imp.find_module(module_name, path) ImportError: No module named crystallography SardanaTP.W010 INFO 2014-10-22 12:55:02,882 ModuleManager: (re)loading module crystallography... SardanaTP.W010 OUTPUT 2014-10-22 12:55:02,885 BL13/DOOR/03.Macro[rellib]: crystallography successfully (re)loaded SardanaTP.W010 DEBUG 2014-10-22 12:55:02,888 BL13/DOOR/03.MacroExecutor: [ END ] runMacro Macro 'rellib(crystallography)'
The crystallograpy package is available in a valid PYTHONPATH.
For the moment I attach the crystallography library and it is pending to reproduce it with another, dummy library.
After having a look to the bug, we have seen that even if the MS was reporting that the library was not reloaded correctly, the library was reloaded without problems.
For reloading it we have to use both 'rellib' and 'relmaclib' in this order (in order to load first the library that will be used by the macro library, and then the macro library itself).
What has been done to treat this ticket is to improve the logging messages in the MacroServer in order to know from which directory the library module is loaded, and if it cannot be loaded, which were the directories in which the MacroServer had a look in order to try to find the library module.
The macroserver code was also trying to reload external modules present in the MacroPath. This is not correct, since they have to be located in either PythonPath or OS PYTHONPATH (see documentation).
This was causing an unintuitive message logged by the MacroServer.
This behavior was changed in commit: e9159812d.