def get_operation(self, name): if name == "EditWord" and self._dictionary is not None: op = OperationEditWord(self._dictionary) elif name == "FindInWeb" and self._cfg is not None: op = OperationFindInWeb(self._cfg) elif name == "ShowStatistic" and self._dictionary is not None and self._cfg is not None: op = OperationShowStatistic(self._dictionary, self._cfg, self) else: op = BaseOperation() return op
def __init__(self, dictionary, cfg, factory): BaseOperation.__init__(self) self._dictionary = dictionary self._cfg = cfg self._factory = factory
def __init__(self, cfg): BaseOperation.__init__(self) self._cfg = cfg
def __init__(self, dictionary): BaseOperation.__init__(self) self._dictionary = dictionary