Changeset 5285
- Timestamp:
- 08/28/08 08:11:09 (4 months ago)
- Files:
-
- trunk/tg/configuration.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tg/configuration.py
r5282 r5285 33 33 """ 34 34 35 #TODO: Handle keys like "z.y.z" 36 37 #TODO: Handle partial prefix matching better. 38 # ('s1.' and 's2.' when prefix is s) 39 40 new_dict = Bunch([(key.split(".")[1] ,dictionary[key]) 35 match = prefix + "." 36 37 new_dict = Bunch([(key.lstrip(match) ,dictionary[key]) 41 38 for key in dictionary.iterkeys() 42 if prefix+'.' in key])39 if key.startswith(match)]) 43 40 if new_dict: 44 41 return new_dict