Beispiel #1
0
    def testIntOpt4(self):
        opt = IntegerOption(self.config, "Test", "intval3", 777)
        newopt = IntegerOption(self.config, "Test", "intval3", 888)

        opt.value = 666

        self.assertEqual(newopt.value, 666)
Beispiel #2
0
    def testIntOpt4 (self):
        opt = IntegerOption (self.config, u"Test", u"intval3", 777)
        newopt = IntegerOption (self.config, u"Test", u"intval3", 888)

        opt.value = 666

        self.assertEqual (newopt.value, 666)
Beispiel #3
0
 def savePageTab (self, page):
     """
     Соханить текущую вкладку (код, просмотр и т.п.) в настройки страницы
     """
     assert page != None
     tabOption = IntegerOption (page.params, self.tabSectionName, self.tabParamName, -1)
     tabOption.value = self.selectedPageIndex
Beispiel #4
0
    def testIntOpt3(self):
        opt = IntegerOption(self.config, "Test", "intval3", 777)
        opt.value = 666

        newconfig = Config(self.path)
        newopt = IntegerOption(newconfig, "Test", "intval3", 888)

        self.assertEqual(newopt.value, 666)
Beispiel #5
0
    def __saveSortStrategy(self):
        assert self.page is not None

        sortOption = IntegerOption(self.page.params,
                                   self.page.paramsSection,
                                   self.sortStrategySection,
                                   0)
        sortOption.value = self.sortStrategy.GetSelection()
Beispiel #6
0
    def __saveSortStrategy(self):
        assert self.page is not None

        sortOption = IntegerOption(self.page.params,
                                   self.page.paramsSection,
                                   self.sortStrategySection,
                                   0)
        sortOption.value = self.sortStrategy.GetSelection()
Beispiel #7
0
 def savePageTab(self, page):
     """
     Соханить текущую вкладку (код, просмотр и т.п.) в настройки страницы
     """
     assert page is not None
     tabOption = IntegerOption(page.params, self.tabSectionName,
                               self.tabParamName, -1)
     tabOption.value = self.selectedPageIndex
Beispiel #8
0
    def testIntOpt3 (self):
        opt = IntegerOption (self.config, u"Test", u"intval3", 777)
        opt.value = 666

        newconfig = Config (self.path)
        newopt = IntegerOption (newconfig, u"Test", u"intval3", 888)

        self.assertEqual (newopt.value, 666)
Beispiel #9
0
    def strategy (self, strategy):
        if strategy == AllTagsSearchStrategy:
            strategyCode = 1
        else:
            strategyCode = 0

        self._strategy = strategy
        strategyOption = IntegerOption (self.params, self.paramsSection, u"strategy", 0)

        try:
            strategyOption.value = strategyCode
        except ReadonlyException:
            # Ничего страшного
            pass

        Application.onPageUpdate (self, change=PAGE_UPDATE_CONTENT)
Beispiel #10
0
    def strategy (self, strategy):
        if strategy == AllTagsSearchStrategy:
            strategyCode = 1
        else:
            strategyCode = 0

        self._strategy = strategy
        strategyOption = IntegerOption (self.params, self.paramsSection, u"strategy", 0)

        try:
            strategyOption.value = strategyCode
        except ReadonlyException:
            # Ничего страшного
            pass

        Application.onPageUpdate (self, change=PAGE_UPDATE_CONTENT)