Created
September 2, 2013 06:42
-
-
Save mtomwing/6409837 to your computer and use it in GitHub Desktop.
Works with: https://github.com/mtomwing/freeseer/tree/config_refactor/src/freeseer/framework/config
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.options import StringOption, IntegerOption | |
from freeseer.framework.config.persist import ParserConfig | |
class FreeseerConfig(ParserConfig): | |
name = StringOption('Michael Tom-Wing') | |
age = IntegerOption(0) | |
if __name__ == '__main__': | |
config = FreeseerConfig('/tmp/freeseer.conf', 'Global') | |
config.load_if_possible() | |
print 'Name:', config.name, type(config.name) | |
print 'Age:', config.age, type(config.age) | |
config.age += 20 | |
print 'Name:', config.name, type(config.name) | |
print 'Age:', config.age, type(config.age) | |
config.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The file it generated: