Created
September 4, 2013 04:54
-
-
Save mtomwing/6432886 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from freeseer.framework.config.core import Config, ProfileManager | |
from freeseer.framework.config.persist import ( | |
ConfigParserManager, | |
JSONConfigManager, | |
) | |
import freeseer.framework.config.options as options | |
class FreeseerConfig(Config): | |
videodir = options.FolderOption('/home/mtomwing/Videos', auto_create=True) | |
auto_hide = options.BooleanOption(True) | |
resolution = options.ChoiceOption([ | |
'default', | |
'240p', | |
'360p', | |
'480p', | |
'720p', | |
'1080p', | |
], 'default') | |
if __name__ == '__main__': | |
profile = ProfileManager('/tmp/freeseer/profiles', 'mtomwing') | |
managers = [ | |
[ConfigParserManager, '.conf'], | |
[JSONConfigManager, '.json'], | |
] | |
for Manager, ext in managers: | |
storage = Manager(profile, 'freeseer' + ext) | |
config = storage.load(FreeseerConfig, 'Global') | |
storage.store(config, 'Global') | |
config.auto_hide = False | |
storage.store(config, 'Something Else') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment