diff options
author | Marko Kreen | 2009-02-13 10:03:53 +0000 |
---|---|---|
committer | Marko Kreen | 2009-02-13 12:21:01 +0000 |
commit | 5521e5fc2f399a923fa7fb313bbe797cfa0d5baa (patch) | |
tree | 7df01ec195273b812bc9b64953a71ad1155d9438 /python/skytools/config.py | |
parent | 012aee6a0369d8a4b2617046a27659c02b0bb478 (diff) |
python/skytools update
- docstrings
- some preliminary python 3.0 compat (var names, print())
- sync with 2.1-stable
adminscript:
- move exec_cmd function to dbscript
dbstruct:
- support sequnces. SERIAL columns are not automatically created,
but the link beteween column and sequence is.
psycopgwrapper:
- drop support for psycopg1
- beginnings of quick DB-API / DictRow description.
quoting:
- new unquote_fqident() function, reverse of quote_fqident()
- quote_statement() accepts both row and dict
dbscript:
- catch startup errors
- use log.exception for exceptions, will result in nicer logs
sqltools:
- exists_sequence()
_pyquoting:
- fix typo in variable name
Diffstat (limited to 'python/skytools/config.py')
-rw-r--r-- | python/skytools/config.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/skytools/config.py b/python/skytools/config.py index a0e96ec5..fbe0b6ed 100644 --- a/python/skytools/config.py +++ b/python/skytools/config.py @@ -1,7 +1,7 @@ """Nicer config class.""" -import sys, os, ConfigParser, socket +import os, ConfigParser, socket __all__ = ['Config'] @@ -52,7 +52,7 @@ class Config(object): """Reads string value, if not set then default.""" try: return self.cf.get(self.main_section, key) - except ConfigParser.NoOptionError, det: + except ConfigParser.NoOptionError: if default == None: raise Exception("Config value not set: " + key) return default @@ -61,7 +61,7 @@ class Config(object): """Reads int value, if not set then default.""" try: return self.cf.getint(self.main_section, key) - except ConfigParser.NoOptionError, det: + except ConfigParser.NoOptionError: if default == None: raise Exception("Config value not set: " + key) return default @@ -70,7 +70,7 @@ class Config(object): """Reads boolean value, if not set then default.""" try: return self.cf.getboolean(self.main_section, key) - except ConfigParser.NoOptionError, det: + except ConfigParser.NoOptionError: if default == None: raise Exception("Config value not set: " + key) return default @@ -79,7 +79,7 @@ class Config(object): """Reads float value, if not set then default.""" try: return self.cf.getfloat(self.main_section, key) - except ConfigParser.NoOptionError, det: + except ConfigParser.NoOptionError: if default == None: raise Exception("Config value not set: " + key) return default @@ -94,7 +94,7 @@ class Config(object): for v in s.split(","): res.append(v.strip()) return res - except ConfigParser.NoOptionError, det: + except ConfigParser.NoOptionError: if default == None: raise Exception("Config value not set: " + key) return default @@ -129,7 +129,7 @@ class Config(object): for key in keys: try: return self.cf.get(self.main_section, key) - except ConfigParser.NoOptionError, det: + except ConfigParser.NoOptionError: pass if default == None: |