Tree:
bcd22e65c4
RuudBurger-patch-1
desktop
develop
master
old/py3
old/redesign
old/tv
old/unicode
tv
tv_redesign
build/2.0.0.pre1
build/2.0.0.pre2
build/2.0.1
build/2.0.3
build/2.0.4
build/2.0.5
build/2.0.6
build/2.0.6.1
build/2.0.7
build/2.0.7.1
build/2.0.8
build/2.0.8.1
build/2.1.0
build/2.2.0
build/2.2.1
build/2.3.0
build/2.3.1
build/2.4.0
build/2.5.0
build/2.5.1
build/2.5.2
build/2.6.0
build/2.6.1
build/2.6.2
build/2.6.3
build/3.0.0
build/3.0.1
${ noResults }
1 Commits (bcd22e65c456f6d7fde11e0bcf291548eec45ad5)
Author | SHA1 | Message | Date |
---|---|---|---|
|
a4e467f20e |
Add the ability to set default runtime parameters via config file
## Feature Description Currently, If a user wishes to customize their runtime configurations the only way to do so is by passing in arguments via commandline parameters each time the service is started. Since these options are unlikely to change for an individual user, a configuration file able to be parsed at runtime to set these options can be added to the CouchPotatoServer application root directory. Once configured, the user no longer has to pass any arguments via the commandline. ## Config File Setup An example template for users too customize can be found at `CouchPotatoServer/init/runtime_config.ini` An example configuration: ``` [default] daemon: data_dir: /home/couchpotato config_file: /etc/couchpotato/settings.conf pid_file: /home/couchpotato/cp.pid ``` This example is equivilant to executing: ``` python CouchPotato.py --daemon \ --data_dir /home/couchpotato \ --config_file /etc/couchpotato/settings.conf \ --pid_file /home/couchpotato/cp.pid ``` For boolean parameters such as --daemon or --debug, provide just the name of the option on its own line with or without the ":" on the end. Parameters that have corresponding arguments require the name of the parameter, a ":", followed by a space and the argument to be passed in. Lines beginning with a # are considered comments and not parsed. ## Note Parameters passed as command line arguments WILL take precedence over the one specified in the config.ini file. ## Changes * added package argparse_config.py to the lib folder * Modified runner.py to parse config.ini file * Added config.ini file which sets daemon mode by default * Added init/runtime-config.ini which contains all available options with comments |
9 years ago |