Mercurial > hg > Feedworm
comparison backend/couchdb/CouchDb.py @ 169:91a24f499318
introdue an abstraction for the name of the database so it can be changed via commandline parameter
author | dirk |
---|---|
date | Fri, 09 Sep 2011 14:52:54 +0200 |
parents | |
children | d0ced79b5030 |
comparison
equal
deleted
inserted
replaced
168:f4708d38419c | 169:91a24f499318 |
---|---|
1 | |
2 from argparse import ArgumentParser | |
3 | |
4 database = "feedtest" | |
5 | |
6 def init(): | |
7 parser = ArgumentParser() | |
8 parser.add_argument("--dbname", nargs="?", help="Name of the database") | |
9 args = parser.parse_known_args() | |
10 dbname = args[0].dbname | |
11 if dbname is not None: | |
12 database = dbname | |
13 | |
14 # | |
15 # accessor methods for the various views | |
16 # | |
17 | |
18 def feedEntriesByFeed(): | |
19 return database + "/feedEntries_by_feed" | |
20 | |
21 def unreadFeedEntriesByFeed(): | |
22 return database + "/unread_feedEntries_by_feed" | |
23 | |
24 def feeds(): | |
25 return database + "/feeds" | |
26 | |
27 def feedEntryByLink(): | |
28 return database + "/feedEntry_by_link" | |
29 | |
30 def preference(): | |
31 return database + "/preference" | |
32 | |
33 |