changeset 386:a9a607a58b1c

moved out ui_sections out of make ui function
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 05 Aug 2010 01:22:33 +0200
parents eda5f01de3c4
children 2a18192fbd1e
files pylons_app/lib/utils.py
diffstat 1 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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'))