'database' removed from keyword arguments in the decorator (so functions not needing any don't have to declare any)
authorDmitriy Morozov <dmitriy@mrzv.org>
Wed, 02 Sep 2009 16:53:57 -0700
changeset 25 a7e31159efb9
parent 24 0372fd85c93d
child 26 4372fcf43497
'database' removed from keyword arguments in the decorator (so functions not needing any don't have to declare any)
alexandria.py
--- a/alexandria.py	Wed Sep 02 16:49:05 2009 -0700
+++ b/alexandria.py	Wed Sep 02 16:53:57 2009 -0700
@@ -246,7 +246,7 @@
 @command(dbopts,
          usage='%name PATH')
 def info(cfg, path):
-    """show information about a path"""
+    """Show information about a path"""
 
     path = _short_path(cfg, path)
     paper = Paper.get_by(path = path)
@@ -339,6 +339,9 @@
     def inner(*args, **kwargs):
         cfg = parse_config()
         initDB(kwargs.get('database') or cfg['dbpath'])
+        if 'database' in kwargs:
+            del kwargs['database']
+
         func(cfg, *args, **kwargs)
 
     return inner