コード例 #1
0
    def __init__(self):
        """ Create singleton instance """
        # Check whether we already have an instance
        if ReductionSingleton.__instance is None:
            # Create and remember instance
            ReductionSingleton.__instance = Reducer()

        # Store instance reference as the only member in the handle
        self.__dict__['_ReductionSingleton__instance'] = ReductionSingleton.__instance
コード例 #2
0
ファイル: command_interface.py プロジェクト: mcvine/mantid
 def clean(cls, reducer_cls=None):
     if reducer_cls == None:
         ReductionSingleton.__instance = Reducer()
     else:
         ReductionSingleton.__instance = reducer_cls()