Last active
December 22, 2015 06:48
-
-
Save mtomwing/6433132 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') | |
| enable_audio_recording = options.BooleanOption(True) | |
| enable_video_recording = options.BooleanOption(True) | |
| videomixer = options.StringOption('Video Passthrough') | |
| audiomixer = options.StringOption('Audio Passthrough') | |
| record_to_file = options.BooleanOption(True) | |
| record_to_file_plugin = options.StringOption('Ogg Output') | |
| record_to_stream = options.BooleanOption(False) | |
| record_to_stream_plugin = options.StringOption('RTMP Streaming') | |
| audio_feedback = options.BooleanOption(False) | |
| video_preview = options.BooleanOption(True) | |
| default_language = options.StringOption('tr_en_US.qm') | |
| 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') |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ cat freeseer.conf$ cat freeseer.json{ "Global": { "audio_feedback": "false", "audiomixer": "Audio Passthrough", "auto_hide": "true", "default_language": "tr_en_US.qm", "enable_audio_recording": "true", "enable_video_recording": "true", "record_to_file": "true", "record_to_file_plugin": "Ogg Output", "record_to_stream": "false", "record_to_stream_plugin": "RTMP Streaming", "resolution": "default", "video_preview": "true", "videodir": "/home/mtomwing/Videos", "videomixer": "Video Passthrough" }, "Something Else": { "audio_feedback": "false", "audiomixer": "Audio Passthrough", "auto_hide": "false", "default_language": "tr_en_US.qm", "enable_audio_recording": "true", "enable_video_recording": "true", "record_to_file": "true", "record_to_file_plugin": "Ogg Output", "record_to_stream": "false", "record_to_stream_plugin": "RTMP Streaming", "resolution": "default", "video_preview": "true", "videodir": "/home/mtomwing/Videos", "videomixer": "Video Passthrough" } }