Beispiel #1
0
 def saveHotKeys(self):
     """
     Сохранить все горячие клавиши в конфиг
     """
     for actionInfo in self._actionsInfo.values():
         option = HotKeyOption(self._config, self.configSection,
                               actionInfo.action.stringId, None)
         option.value = actionInfo.hotkey
 def saveHotKeys (self):
     """
     Сохранить все горячие клавиши в конфиг
     """
     for actionInfo in self._actionsInfo.values():
         option = HotKeyOption (self._config,
             self.configSection,
             actionInfo.action.strid,
             None)
         option.value = actionInfo.hotkey
Beispiel #3
0
    def testHotKeyWrite2(self):
        config = Config(self.path)
        section = "TestHotKey"
        paramName = "MyHotKey"

        option = HotKeyOption(config, section, paramName, None)
        option.value = None

        with open(self.path) as fp:
            resultFile = fp.read()

        self.assertTrue("[TestHotKey]" in resultFile)
        self.assertTrue("myhotkey =" in resultFile)
Beispiel #4
0
    def testHotKeyWrite1(self):
        config = Config(self.path)
        hotkey = HotKey("F11", ctrl=True)
        section = "TestHotKey"
        paramName = "MyHotKey"

        option = HotKeyOption(config, section, paramName, None)
        option.value = hotkey

        with open(self.path) as fp:
            resultFile = fp.read()

        self.assertTrue("[TestHotKey]" in resultFile)
        self.assertTrue("myhotkey = Ctrl+F11" in resultFile)