def testWriteProperty(self): """testWriteProperty: set a property, write config file, then read it back""" set_value = '45' settings = {} settings['image_size_x'] = set_value config.store(settings) config.read() read_value = config.settings['image_size_x'] self.assertEqual(set_value, read_value)
def onSaveSettingsBtn(self, event): settings = { "image_size_x": self.image_size_x.GetValue(), "image_size_y": self.image_size_y.GetValue(), "thumbnail_size_x": self.thumbnail_size_x.GetValue(), "thumbnail_size_y": self.thumbnail_size_y.GetValue(), "image_quality": self.image_quality.GetValue(), "thumbnail_quality": self.thumbnail_quality.GetValue(), "album_cols": self.album_cols.GetValue(), "album_rows": self.album_rows.GetValue(), "gallery_path": self.gallery_path.GetValue(), "image_extensions": self.image_extensions.GetValue(), "thumbnail_suffix": self.thumbnail_suffix.GetValue(), "tmp_first": self.tmp_first.GetValue(), "tmp_prev": self.tmp_prev.GetValue(), "tmp_index": self.tmp_index.GetValue(), "tmp_next": self.tmp_next.GetValue(), "tmp_last": self.tmp_last.GetValue(), "rebuild_thumbnails": self.rebuild_thumbnails.GetValue(), } config.store(settings)
def upload_config(config): ''' stores ExcelConfig to temporary file and uploads to OdkDriver ''' dst = os.path.join(tempfile.gettempdir(), 'config.xls') config.store(dst, True) driver.upload_config(dst) os.unlink(dst)
def tearDown(self): settings = {} config.store(settings)