comparison pylons_app/lib/utils.py @ 395:e8af467b5a60

Added hooks managment into application settings
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 06 Aug 2010 02:40:57 +0200
parents b27d32cb3157
children 6b934c9607e7
comparison
equal deleted inserted replaced
394:42367607dc19 395:e8af467b5a60
121 121
122 if not ret: 122 if not ret:
123 raise Exception('Could not get application ui settings !') 123 raise Exception('Could not get application ui settings !')
124 settings = {} 124 settings = {}
125 for each in ret: 125 for each in ret:
126 k = each.ui_key if each.ui_key != '/' else 'root_path' 126 k = each.ui_key
127 settings[each.ui_section + '_' + k] = each.ui_value 127 v = each.ui_value
128 if k == '/':
129 k = 'root_path'
130
131 if k.find('.') != -1:
132 k = k.replace('.', '_')
133
134 if each.ui_section == 'hooks':
135 v = each.ui_active
136
137 settings[each.ui_section + '_' + k] = v
128 138
129 return settings 139 return settings
130 140
131 #propagated from mercurial documentation 141 #propagated from mercurial documentation
132 ui_sections = ['alias', 'auth', 142 ui_sections = ['alias', 'auth',