# HG changeset patch # User Dirk Olmes # Date 1281486647 -7200 # Node ID 842727971796dd9fb14d1792ee89db860840e55b # Parent d20e99d46d78965ee08d440d1605a480e3f561e7 have the DB URL as parameter when creating a session and fall back to commandline arguments if no DB URL was passed in diff -r d20e99d46d78 -r 842727971796 Database.py --- 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()