comparison backend/couchdb/CouchDb.py @ 178:e8cc86981938

default DB name is feedworm, fix setting the dbname via commandline parameter
author dirk
date Sat, 10 Sep 2011 04:26:13 +0200
parents 57e324fa4350
children a4832a180c69
comparison
equal deleted inserted replaced
177:98eaf0075a44 178:e8cc86981938
1 1
2 from argparse import ArgumentParser 2 from argparse import ArgumentParser
3 3
4 database = "feedtest" 4 database = "feedworm"
5 5
6 def init(): 6 def init():
7 parser = ArgumentParser() 7 parser = ArgumentParser()
8 parser.add_argument("--dbname", nargs="?", help="Name of the database") 8 parser.add_argument("--dbname", nargs="?", help="Name of the database")
9 args = parser.parse_known_args() 9 args = parser.parse_known_args()
10 dbname = args[0].dbname 10 dbname = args[0].dbname
11 if dbname is not None: 11 if dbname is not None:
12 global database
12 database = dbname 13 database = dbname
13 14
14 # 15 #
15 # accessor methods for the various views 16 # accessor methods for the various views
16 # 17 #