Changeset 1243
- Timestamp:
- 08/04/07 13:39:51 (6 years ago)
- Files:
-
- 1 modified
-
trunk/umitCore/UmitConfigParser.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/umitCore/UmitConfigParser.py
r1192 r1243 20 20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 21 22 from ConfigParser import ConfigParser, DEFAULTSECT 22 from os.path import exists 23 from ConfigParser import ConfigParser, DEFAULTSECT, NoOptionError, NoSectionError 23 24 24 25 class UmitConfigParser(ConfigParser): … … 80 81 (key, str(value).replace('\n', '\n\t'))) 81 82 fp.write("\n") 83 84 def test_umit_conf_content(self, parser): 85 # Paths section 86 assert exists(get_or_false(parser, "paths", "config_file") or "") 87 88 def get_or_false(self, parser, section, option): 89 try: 90 return parser.get(section, option) 91 except NoOptionError: 92 return False 93 except NoSectionError: 94 return False
