diff Database.py @ 70:842727971796

have the DB URL as parameter when creating a session and fall back to commandline arguments if no DB URL was passed in
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 11 Aug 2010 02:30:47 +0200
parents 254d5b89a6ca
children
line wrap: on
line diff
--- a/Database.py	Tue Aug 10 03:41:24 2010 +0200
+++ b/Database.py	Wed Aug 11 02:30:47 2010 +0200
@@ -10,8 +10,9 @@
 engine = None
 SessionMaker = None
 
-def createSession():
-    databaseUrl = _getDatabaseUrl()
+def createSession(databaseUrl=None):
+    if databaseUrl is None:
+        databaseUrl = _getDatabaseUrl()
     initEngine(databaseUrl)
     Mapping.createMapping(engine)
     initSessionMaker()