# Path: common/db.py
# def user_db_prefix():
# def database_name(domain, family):
# def use_db(conn, domain, family, cursor_class = None):
# def create_conn(**kwargs):
#     def __init__(self, db_name):
#     def open(self):
#     def close(self):
# def connection(db_obj):
# class UserDb(object):


import os
import sys
import ws_namespaces as namespaces
from common import db
# -*- coding: utf-8 -*-

sys.path.append(os.path.expanduser('~/wikisource'))

def default_userdict(count = 0):
    # credits are returned in a dict with user name associated with this value
    return { 'count' : count, 'flags' : [] }

def get_source_ns(domain, family):
    return namespaces.namespaces[family][domain]

def get_index_ns(domain, family):
    return namespaces.index[family][domain]

def get_page_ns(domain, family):
    return namespaces.page[family][domain]

def prefix_index(cursor, start, ns, max_count = 5000):
    count = 0
    last = start
    cont = True
    while cont:
        cursor.execute("""SELECT page_title, page_id

# Path: common/db.py
# def user_db_prefix():
# def database_name(domain, family):
# def use_db(conn, domain, family, cursor_class = None):
# def create_conn(**kwargs):
#     def __init__(self, db_name):
#     def open(self):
#     def close(self):
# def connection(db_obj):
# class UserDb(object):


# Path: history_credit/get_credit.py
import os
import sys
import ws_namespaces as namespaces
from common import db

# -*- coding: utf-8 -*-

sys.path.append(os.path.expanduser('~/wikisource'))

def default_userdict(count = 0):
    # credits are returned in a dict with user name associated with this value
    return { 'count' : count, 'flags' : [] }

def get_source_ns(domain, family):
    return namespaces.namespaces[family][domain]

def get_index_ns(domain, family):
    return namespaces.index[family][domain]

def get_page_ns(domain, family):
    return namespaces.page[family][domain]

def prefix_index(cursor, start, ns, max_count = 5000):
    count = 0
    last = start
    cont = True
    while cont:
        cursor.execute("""SELECT page_title, page_id

                          FROM page