view backend/couchdb/CouchDb.py @ 179:c8393c2cd324

add script to trigger couchdb replication
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 10 Sep 2011 04:32:53 +0200
parents e8cc86981938
children a4832a180c69
line wrap: on
line source


from argparse import ArgumentParser

database = "feedworm"

def init():
    parser = ArgumentParser()
    parser.add_argument("--dbname", nargs="?", help="Name of the database")
    args = parser.parse_known_args()
    dbname = args[0].dbname
    if dbname is not None:
        global database
        database = dbname

#
# accessor methods for the various views
#

def feedEntriesByFeed():
    return database + "/feedEntries_by_feed"

def unreadFeedEntriesByFeed():
    return database + "/unread_feedEntries_by_feed"

def feeds():
    return database + "/feeds"

def feedEntryByLink():
    return database + "/feedEntry_by_link"

def preference():
    return database + "/preference"

def readFeedEntriesByCreateDate():
    return database + "/read_feedEntries_by_create_date"

def feedsWithUnreadEntries():
    return database + "/feeds_with_unread_entries"