Changeset 4152
- Timestamp:
- 02/21/09 19:47:49 (4 years ago)
- Files:
-
- 1 modified
-
trunk/umitCore/UmitConf.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/umitCore/UmitConf.py
r3953 r4152 25 25 26 26 from types import StringTypes 27 from ConfigParser import NoSectionError, NoOptionError 27 from ConfigParser import NoSectionError, NoOptionError, DuplicateSectionError 28 28 29 29 from umitCore.Paths import Path … … 196 196 def add_profile(self, profile_name, **attributes): 197 197 log.debug(">>> Add Profile '%s': %s" % (profile_name, attributes)) 198 try: self.add_section(profile_name) 199 except: return None 200 201 [self._set_it(profile_name, attr, attributes[attr]) \ 202 for attr in attributes if attr != "options"] 198 try: 199 self.add_section(profile_name) 200 except DuplicateSectionError: 201 return None 202 203 for attr in attributes: 204 if attr != "options": 205 self._set_it(profile_name, attr, attributes[attr]) 206 203 207 options = attributes["options"] 204 if type(options) in StringTypes:208 if isinstance(options, basestring): 205 209 self._set_it(profile_name, "options", options) 206 elif type(options) == type({}): 210 # Assuming there are no values for these options 211 options = {} 212 elif isinstance(options, dict): 207 213 self._set_it(profile_name, "options", ",".join(options.keys())) 208 214
