Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix scripts

  • Loading branch information...
commit 615db0c6c6cf4f2528d923cf80f86ca14015bdfc 1 parent b12dbca
Nathan Van Gheem authored March 06, 2013
5  factored/scripts/initializedb.py
@@ -19,7 +19,10 @@ def main(argv=sys.argv):
19 19
         usage(argv)
20 20
     config_uri = argv[1]
21 21
     setup_logging(config_uri)
22  
-    settings = get_appsettings(config_uri)
  22
+    try:
  23
+        settings = get_appsettings(config_uri, 'factored')
  24
+    except LookupError:
  25
+        settings = get_appsettings(config_uri, 'main')
23 26
     engine = engine_from_config(settings, 'sqlalchemy.')
24 27
     DBSession.configure(bind=engine)
25 28
     Base.metadata.create_all(engine)
20  factored/scripts/users.py
@@ -20,7 +20,10 @@ def add():
20 20
     else:
21 21
         config_uri = arguments.config
22 22
         setup_logging(config_uri)
23  
-        settings = get_appsettings(config_uri)
  23
+        try:
  24
+            settings = get_appsettings(config_uri, 'factored')
  25
+        except LookupError:
  26
+            settings = get_appsettings(config_uri, 'main')
24 27
         engine = engine_from_config(settings, 'sqlalchemy.')
25 28
         DBSession.configure(bind=engine)
26 29
         session = DBSession()
@@ -44,7 +47,10 @@ def remove():
44 47
     else:
45 48
         config_uri = arguments.config
46 49
         setup_logging(config_uri)
47  
-        settings = get_appsettings(config_uri)
  50
+        try:
  51
+            settings = get_appsettings(config_uri, 'factored')
  52
+        except LookupError:
  53
+            settings = get_appsettings(config_uri, 'main')
48 54
         engine = engine_from_config(settings, 'sqlalchemy.')
49 55
         DBSession.configure(bind=engine)
50 56
         session = DBSession()
@@ -68,7 +74,10 @@ def listusers():
68 74
     else:
69 75
         config_uri = arguments.config
70 76
         setup_logging(config_uri)
71  
-        settings = get_appsettings(config_uri)
  77
+        try:
  78
+            settings = get_appsettings(config_uri, 'factored')
  79
+        except LookupError:
  80
+            settings = get_appsettings(config_uri, 'main')
72 81
         engine = engine_from_config(settings, 'sqlalchemy.')
73 82
         DBSession.configure(bind=engine)
74 83
         session = DBSession()
@@ -88,7 +97,10 @@ def listuserinfo():
88 97
     else:
89 98
         config_uri = arguments.config
90 99
         setup_logging(config_uri)
91  
-        settings = get_appsettings(config_uri)
  100
+        try:
  101
+            settings = get_appsettings(config_uri, 'factored')
  102
+        except LookupError:
  103
+            settings = get_appsettings(config_uri, 'main')
92 104
         engine = engine_from_config(settings, 'sqlalchemy.')
93 105
         DBSession.configure(bind=engine)
94 106
         session = DBSession()

0 notes on commit 615db0c

Please sign in to comment.
Something went wrong with that request. Please try again.