Skip to content

Instantly share code, notes, and snippets.

@mtomwing
Created September 4, 2013 04:54
Show Gist options
  • Save mtomwing/6432886 to your computer and use it in GitHub Desktop.
Save mtomwing/6432886 to your computer and use it in GitHub Desktop.
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