예제 #1
0
 def testTupleValue(self):
     self._setUpTestFiles()
     value = (1, "item2", False)
     config.set(self._filenames[1], "Test_5", "test5_2", value)
     self.failUnlessEqual(["1", "item2", "False"],
                          config.getList(self._filenames[1], "Test_5",
                                         "test5_2"))
예제 #2
0
    def getList(self):
        '''
        Gets a value of the settings option converted to list. If the option
        does not exist the 'None' is returned.

        :return: A value of the option
        :rtype: list
        '''
        return config.getList(self._name, self._section,
                              self._option, self._default)
예제 #3
0
    def getList(self):
        '''
        Gets a value of the settings option converted to list. If the option
        does not exist the 'None' is returned.

        :return: A value of the option
        :rtype: list
        '''
        return config.getList(self._name, self._section, self._option,
                              self._default)
예제 #4
0
 def loadState(self):
     '''
     Restores paths from configuration.
     '''
     enabled = config.getList(self._CONFIG_NAME,
                              self._CONFIG_SECTION_LOCATIONS, "enabled", [])
     disabled = config.getList(self._CONFIG_NAME,
                               self._CONFIG_SECTION_LOCATIONS, "disabled",
                               [])
     for path in disabled:
         message = self._addLocation(path)
         if message:
             log.warning(message)
     for path in enabled:
         message = self._addLocation(path)
         if message:
             log.warning(message)
         else:
             self._locItems[path].setCheckState(0, QtCore.Qt.Checked)
     self._loaded = True
예제 #5
0
 def __init__(self, conf, section, option, max=10):
     '''
     Synchronizes the internal list of values with configuration.
     '''
     self._values = config.getList(conf, section, option, [])
     if len(self._values) > max:
         self._values = self._values[:max]
         config.set(conf, section, option, self._values)
     self._conf = conf
     self._section = section
     self._option = option
     self._max = max
예제 #6
0
파일: utils.py 프로젝트: mlyko/tadek-ui
 def __init__(self, conf, section, option, max=10):
     '''
     Synchronizes the internal list of values with configuration.
     '''
     self._values = config.getList(conf, section, option, [])
     if len(self._values) > max:
         self._values = self._values[:max]
         config.set(conf, section, option, self._values)
     self._conf = conf
     self._section = section
     self._option = option
     self._max = max
예제 #7
0
파일: tests.py 프로젝트: mlyko/tadek-ui
 def loadState(self):
     '''
     Restores paths from configuration.
     ''' 
     enabled = config.getList(self._CONFIG_NAME,
                              self._CONFIG_SECTION_LOCATIONS,
                              "enabled", [])
     disabled = config.getList(self._CONFIG_NAME,
                               self._CONFIG_SECTION_LOCATIONS,
                               "disabled", [])
     for path in disabled:
         message = self._addLocation(path)
         if message:
             log.warning(message)
     for path in enabled:
         message = self._addLocation(path)
         if message:
             log.warning(message)
         else:
             self._locItems[path].setCheckState(0, QtCore.Qt.Checked)
     self._loaded = True
예제 #8
0
 def testListValue(self):
     self._setUpTestFiles()
     value = ["item1", "item2", "item3"]
     config.set(self._filenames[1], "Test_5", "test5_1", value)
     self.failUnlessEqual(
         value, config.getList(self._filenames[1], "Test_5", "test5_1"))
예제 #9
0
 def testTupleValue(self):
     self._setUpTestFiles()
     value = (1, "item2", False)
     config.set(self._filenames[1], "Test_5", "test5_2", value)
     self.failUnlessEqual(["1", "item2", "False"],
                  config.getList(self._filenames[1], "Test_5", "test5_2"))
예제 #10
0
 def testListValue(self):
     self._setUpTestFiles()
     value = ["item1", "item2", "item3"]
     config.set(self._filenames[1], "Test_5", "test5_1", value)
     self.failUnlessEqual(value, config.getList(self._filenames[1],
                                               "Test_5", "test5_1"))