def testSet(self): TEST_FILE_NAME = self._filenames[0] settings.set(TEST_FILE_NAME, "Test0") settings.set(TEST_FILE_NAME, "Test1", "test1_1", "1") self.assertTrue("Test0" in config.get(TEST_FILE_NAME)) self.assertTrue("Test1" in config.get(TEST_FILE_NAME)) self.assertTrue("test1_1" in config.get(TEST_FILE_NAME, "Test1")) self.assertEqual("1", config.get(TEST_FILE_NAME, "Test1", "test1_1"))
def updateOption(self, item, column): ''' Finishes editing an option item and saves changes to settings. ''' if column == 0: self._optionsTree.closePersistentEditor(item, 0) data = item.customData[:] settings.get(*data).remove() data[-1] = item.text(0) settings.set(*data, value=item.text(1), force=True) elif column == 1: self._optionsTree.closePersistentEditor(item, 1) data = item.customData[:] data.append(item.text(1)) settings.get(*data[:-1]).set(data[-1])