localwiki/localwiki — pull request #347 by niran (2012-09-27 05:50:29+00:00)
Title: Settings refactor

This pull request inverts the way settings are imported as described in localwiki/localwiki#327. Instead of a main settings module importing localsettings, we now have `settings.defaults`, which contains all the default settings and can be imported by any Python module. This allows a custom settings module to `import * from sapling.settings.defaults`, then modify any of the default values. Crucially, this method allows the custom settings to access the data in the defaults, which `localsettings` cannot currently do.

This should be backwards compatible. Importing settings will load `settings.from_file`, which loads the defaults and performs the existing `localsettings` logic, which has been refactored to allow settings with theme directories to be combined with other directories arbitrarily (e.g. theme directories always have priority over `TEMPLATE_DIRS` from `localsettings`; this can now be changed by the user).