Ejemplo n.º 1
0
    def cleanUp(self):
        if self.is_cleaned():
            return

        self._clearEnv()

        MacroServerManager.cleanUp(self)
Ejemplo n.º 2
0
    def reInit(self):
        if self.is_initialized():
            return

        # dict<str, RecorderLibrary>
        # key   - module name (without path and without extension)
        # value - RecorderLibrary object representing the module
        self._modules = {}

        #: dict<str, <metarecorder.RecorderClass>
        #: key   - recorder name
        #: value - RecorderClass object representing the recorder
        self._recorder_dict = {}

        # list<str>
        # elements are absolute paths
        self._recorder_path = []

        # custom map (per installation) allowing to avoid
        # recorder class ambiguity problems (using extension filter)
        #: dict<str, str>
        #: key   - scan file extension
        #: value - recorder name
        self._custom_scan_recorder_map = getattr(sardanacustomsettings,
                                                 "SCAN_RECORDER_MAP",
                                                 None)
        #: dict<str, str>
        #: key   - scan file extension
        #: value - list with recorder name(s)
        self._scan_recorder_map = {}

        MacroServerManager.reInit(self)
Ejemplo n.º 3
0
    def cleanUp(self):
        if self.is_cleaned():
            return

        self._clearEnv()

        MacroServerManager.cleanUp(self)
Ejemplo n.º 4
0
    def reInit(self):
        if self.is_initialized():
            return

        # dict<str, RecorderLibrary>
        # key   - module name (without path and without extension)
        # value - RecorderLibrary object representing the module
        self._modules = {}

        #: dict<str, <metarecorder.RecorderClass>
        #: key   - recorder name
        #: value - RecorderClass object representing the recorder
        self._recorder_dict = {}

        # list<str>
        # elements are absolute paths
        self._recorder_path = []

        # custom map (per installation) allowing to avoid
        # recorder class ambiguity problems (using extension filter)
        #: dict<str, str>
        #: key   - scan file extension
        #: value - recorder name
        self._custom_scan_recorder_map = getattr(sardanacustomsettings,
                                                 "SCAN_RECORDER_MAP", None)
        #: dict<str, str>
        #: key   - scan file extension
        #: value - list with recorder name(s)
        self._scan_recorder_map = {}

        MacroServerManager.reInit(self)
Ejemplo n.º 5
0
    def cleanUp(self):
        if self.is_cleaned():
            return

        if self._modules:
            for _, types_dict in self._modules.items():
                for type_name in types_dict:
                    Type.removeType(type_name)

        self._recorder_path = None
        self._modules = None
        MacroServerManager.cleanUp(self)
Ejemplo n.º 6
0
    def cleanUp(self):
        if self.is_cleaned():
            return

        if self._modules:
            for _, types_dict in self._modules.items():
                for type_name in types_dict:
                    Type.removeType(type_name)

        self._recorder_path = None
        self._modules = None
        MacroServerManager.cleanUp(self)
Ejemplo n.º 7
0
    def reInit(self):
        if self.is_initialized():
            return

        # dict<str, dict<str,class<ParamType>>
        # key   - module name (without path and without extension)
        # value - a dict where:
        #         key   - type name
        #         value - class object implementing the Type
        self._modules = {}

        # dict<str, ParamType>
        # key   - type name
        # value - object which inherits from ParamType
        self._inst_dict = {}

        path = [self.DEFAULT_TYPE_DIR]
        for type_module in self.DEFAULT_TYPE_MODULES:
            self.reloadTypeModule(type_module, path=path)

        MacroServerManager.reInit(self)
Ejemplo n.º 8
0
    def reInit(self):
        if self.is_initialized():
            return

        # dict<str, dict<str,class<ParamType>>
        # key   - module name (without path and without extension)
        # value - a dict where:
        #         key   - type name
        #         value - class object implementing the Type
        self._modules = {}

        # dict<str, ParamType>
        # key   - type name
        # value - object which inherits from ParamType
        self._inst_dict = {}

        path = [self.DEFAULT_TYPE_DIR]
        for type_module in self.DEFAULT_TYPE_MODULES:
            self.reloadTypeModule(type_module, path=path)

        MacroServerManager.reInit(self)
Ejemplo n.º 9
0
    def reInit(self):
        """(Re)initializes the manager"""
        if self.is_initialized():
            return

        # a string containing the absolute filename containing the environment
        self._env_name = None

        # the full enviroment (a shelf for now - can be accessed as a dict)
        self._env = None

        # cache environment for keys that start with door name
        # dict<string, dict<string, value> > where:
        #  - key: door name
        #  - value: dict where:
        #    - key: environment name
        #    - value: environment value
        self._door_env = None

        # cache environment for keys that start with macro name
        # dict<string, dict<string, value> > where:
        #  - key: macro name
        #  - value: dict where:
        #    - key: environment name
        #    - value: environment value
        self._macro_env = None

        # cache environment for global keys
        # dict<string, value> where:
        #  - key: environment name
        #  - value: environment value
        self._global_env = None

        self._initEnv()

        MacroServerManager.reInit(self)
Ejemplo n.º 10
0
    def reInit(self):
        """(Re)initializes the manager"""
        if self.is_initialized():
            return

        # a string containing the absolute filename containing the environment
        self._env_name = None

        # the full enviroment (a shelf for now - can be accessed as a dict)
        self._env = None

        # cache environment for keys that start with door name
        # dict<string, dict<string, value> > where:
        #  - key: door name
        #  - value: dict where:
        #    - key: environment name
        #    - value: environment value
        self._door_env = None

        # cache environment for keys that start with macro name
        # dict<string, dict<string, value> > where:
        #  - key: macro name
        #  - value: dict where:
        #    - key: environment name
        #    - value: environment value
        self._macro_env = None

        # cache environment for global keys
        # dict<string, value> where:
        #  - key: environment name
        #  - value: environment value
        self._global_env = None

        self._initEnv()

        MacroServerManager.reInit(self)
Ejemplo n.º 11
0
 def __init__(self, macro_server, environment_db=None):
     MacroServerManager.__init__(self, macro_server)
     if environment_db is not None:
         self.setEnvironmentDb(environment_db)
Ejemplo n.º 12
0
 def __init__(self, macro_server, recorder_path=None):
     MacroServerManager.__init__(self, macro_server)
     if recorder_path is not None:
         self.setRecorderPath(recorder_path)
Ejemplo n.º 13
0
 def __init__(self, macro_server, recorder_path=None):
     MacroServerManager.__init__(self, macro_server)
     if recorder_path is not None:
         self.setRecorderPath(recorder_path)
Ejemplo n.º 14
0
 def __init__(self, macro_server, environment_db=None):
     MacroServerManager.__init__(self, macro_server)
     if environment_db is not None:
         self.setEnvironmentDb(environment_db)