示例#1
0
文件: db.py 项目: zerodb/zerodb
def add_wiki_and_close(sock, count=200, dbclass=zerodb.DB):
    db = zerodb.testing.db(None, sock, dbclass=dbclass)
    with transaction.manager:
        for doc in wiki.read_docs(join(dirname(abspath(__file__)), "wiki_sample")):
            p = WikiPage(**doc)
            db.add(p)
    db.disconnect()
示例#2
0
def add_wiki_and_close(sock, count=200, dbclass=zerodb.DB):
    db = dbclass(sock, username="******", password=TEST_PASSPHRASE, debug=True)
    with transaction.manager:
        for doc in wiki.read_docs(join(dirname(abspath(__file__)), "wiki_sample")):
            p = WikiPage(**doc)
            db.add(p)
    db.disconnect()
示例#3
0
def add_wiki_and_close(sock, count=200, dbclass=zerodb.DB):
    db = zerodb.testing.db(None, sock, dbclass=dbclass)
    with transaction.manager:
        for doc in wiki.read_docs(
                join(dirname(abspath(__file__)), "wiki_sample")):
            p = WikiPage(**doc)
            db.add(p)
    db.disconnect()