Skip to content

Commit

Permalink
default_value was assigned as !@#$%&* to be more easy to check when t…
Browse files Browse the repository at this point in the history
…he default value is None, empty string or False
  • Loading branch information
Wandenberg Peixoto committed Jan 22, 2011
1 parent 6a28387 commit 95e0a71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions simple_db_migrate/config.py
Expand Up @@ -11,11 +11,12 @@ def __init__(self):
def __repr__(self):
return str(self._config)

def get(self, config_key, default_value=None):
#default_value was assigned as !@#$%&* to be more easy to check when the default value is None, empty string or False
def get(self, config_key, default_value='!@#$%&*'):
try:
return self._config[config_key]
except KeyError:
if default_value:
if default_value != '!@#$%&*':
return default_value
raise Exception("invalid configuration key ('%s')" % config_key)

Expand Down

0 comments on commit 95e0a71

Please sign in to comment.