# HG changeset patch # User Marcin Kuzminski # Date 1280964153 -7200 # Node ID a9a607a58b1cb0404415439ddf555f2853a0cab1 # Parent eda5f01de3c414c300e3f2d4639e8b90d008ef6d moved out ui_sections out of make ui function diff -r eda5f01de3c4 -r a9a607a58b1c pylons_app/lib/utils.py --- a/pylons_app/lib/utils.py Thu Aug 05 01:21:44 2010 +0200 +++ b/pylons_app/lib/utils.py Thu Aug 05 01:22:33 2010 +0200 @@ -111,7 +111,18 @@ settings['hg_app_' + each.app_settings_name] = each.app_settings_value return settings - + +ui_sections = ['alias', 'auth', + 'decode/encode', 'defaults', + 'diff', 'email', + 'extensions', 'format', + 'merge-patterns', 'merge-tools', + 'hooks', 'http_proxy', + 'smtp', 'patch', + 'paths', 'profiling', + 'server', 'trusted', + 'ui', 'web', ] + def make_ui(read_from='file', path=None, checkpaths=True): """ A function that will read python rc files or database @@ -122,16 +133,7 @@ @param read_from: read from 'file' or 'db' """ #propagated from mercurial documentation - sections = ['alias', 'auth', - 'decode/encode', 'defaults', - 'diff', 'email', - 'extensions', 'format', - 'merge-patterns', 'merge-tools', - 'hooks', 'http_proxy', - 'smtp', 'patch', - 'paths', 'profiling', - 'server', 'trusted', - 'ui', 'web', ] + baseui = ui.ui() @@ -142,7 +144,7 @@ cfg = config.config() cfg.read(path) - for section in sections: + for section in ui_sections: for k, v in cfg.items(section): baseui.setconfig(section, k, v) if checkpaths:check_repo_dir(cfg.items('paths'))