Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor and futurize
fofix.core.Config
as a small step toward #110.Prototype
is now adict
-like class, allowing multiple config prototypes to be created (e.g. separate prototypes for main config, themes, songs, etc). Note that the removed code (formerly) under# fix the defaults and non-existing keys
is redundant as the prototype'sdefault
is looked up for everyget()
anyway.The
_ModuleWrapper
hack at the end allows access to the default config through existing calls toConfig.get()
etc, but eliminates duplicate code and the need to keep function definitions inConfig
the class andConfig
the module synchronized. Ideally,Config
the module should only be responsible for creatingConfig
objects, and not for storing a default configuration file. Instead, the config files should be explicitly passed around as required.Call to
RawConfigParser._read()
changed to...readfp()
as the latter is part of the public API and the former is an implementation detail that could (theoretically) change at any time.