Changes in sardana macros interface

From the release 2.0.0 of sardana there is a change in the interface of the macro arguments. This change affects only the arguments of the type ParamRepeat and it was needed in order to avoid some restrictions in the order or setting of default values of the macro arguments. The old and the new implementation are not compatible. Macros satisfying one of these conditions are affected by the change and have to be adapted to the new interface:

  1. use ParamRepeat in the definition of arguments
  2. call another macro having an argument of the type ParamRepeat using a format like:

        execMacro("mv", mymot, 10)
        createMacro("mv", mymot,10)
        self.mv(mymot,10)
    

    The format:

        execMacro("mv mymotname 10")
        createMacro("mv mymotname 10")
    

    is not affected.

What has to be changed for each case is:

  1. the way the argument of the type ParamRepeat has to be given to the prepare and run methods of the macro. Ex.: if the argument scan_regions is the type ParamRepeat, before one give it like:

         def prepare(self, *scan_regions):
         
         def run(self, *scan_regions):
    

    and now you have to change this to:

     
        def prepare(self, scan$\_$regions):
    
        def run(self, scan$\_$egions):
    

  2. the arguments have to be given as a list. Ex.

        execMacro("mv", mymot, 10)
        createMacro("mv", mymot,10)
        self.mv(mymot,10)
    

    will be changed to:

      
         execMacro("mv", [[mymot, 10]])
         createMacro("mv", [[mymot,10]])
         self.mv([[mymot,10]])
    

    And extended to a case with more pairs:

         execMacro("mv", mymot1, 10, mymot2, 30)
    

    changed to:

         execMacro("mv", [[mymot1, 10], [mymot2, 30]])
    

    ParamRepeat for the macro mv is defined as pairs of motors and positions, so the elements of the external list have to be given as a list of two elements.

    If you want to apply a solution compatible with both sardana versions, you can change to the sintax:

        execMacro("mv mymotname 10")
        createMacro("mv mymotname 10")