Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix scripts

  • Loading branch information...
commit 615db0c6c6cf4f2528d923cf80f86ca14015bdfc 1 parent b12dbca
@vangheem vangheem authored
Showing with 20 additions and 5 deletions.
  1. +4 −1 factored/scripts/initializedb.py
  2. +16 −4 factored/scripts/users.py
View
5 factored/scripts/initializedb.py
@@ -19,7 +19,10 @@ def main(argv=sys.argv):
usage(argv)
config_uri = argv[1]
setup_logging(config_uri)
- settings = get_appsettings(config_uri)
+ try:
+ settings = get_appsettings(config_uri, 'factored')
+ except LookupError:
+ settings = get_appsettings(config_uri, 'main')
engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configure(bind=engine)
Base.metadata.create_all(engine)
View
20 factored/scripts/users.py
@@ -20,7 +20,10 @@ def add():
else:
config_uri = arguments.config
setup_logging(config_uri)
- settings = get_appsettings(config_uri)
+ try:
+ settings = get_appsettings(config_uri, 'factored')
+ except LookupError:
+ settings = get_appsettings(config_uri, 'main')
engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configure(bind=engine)
session = DBSession()
@@ -44,7 +47,10 @@ def remove():
else:
config_uri = arguments.config
setup_logging(config_uri)
- settings = get_appsettings(config_uri)
+ try:
+ settings = get_appsettings(config_uri, 'factored')
+ except LookupError:
+ settings = get_appsettings(config_uri, 'main')
engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configure(bind=engine)
session = DBSession()
@@ -68,7 +74,10 @@ def listusers():
else:
config_uri = arguments.config
setup_logging(config_uri)
- settings = get_appsettings(config_uri)
+ try:
+ settings = get_appsettings(config_uri, 'factored')
+ except LookupError:
+ settings = get_appsettings(config_uri, 'main')
engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configure(bind=engine)
session = DBSession()
@@ -88,7 +97,10 @@ def listuserinfo():
else:
config_uri = arguments.config
setup_logging(config_uri)
- settings = get_appsettings(config_uri)
+ try:
+ settings = get_appsettings(config_uri, 'factored')
+ except LookupError:
+ settings = get_appsettings(config_uri, 'main')
engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configure(bind=engine)
session = DBSession()
Please sign in to comment.
Something went wrong with that request. Please try again.