# 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: common/common_html.py
# def get_head(title, css = None, html5 = False):


import sys
import os
import urllib
from ws_category import domain_urls as urls
from ws_namespaces import index as index_name
from common import db
from gen_stats import all_domain
from common import common_html
    out_fd = open(out_file, 'w')

    title = '%s.wikisource.org not transcluded page' % domain
    head = common_html.get_head(title, html5 = True).encode('utf-8')
    print >> out_fd, head
    print >> out_fd, '<body>'
    if len(result):
        print >> out_fd, '<ol>'

        for d in result:
            print >> out_fd, format_html_line(domain, d[1], d[0])

        print >> out_fd, '</ol>'
    else:
        "Empty result, no Index meet the criteria to be listed in this file."

    print >> out_fd, '\n</body>\n</html>'
    out_fd.close()

    return len(result)

if __name__ == "__main__":
    tot_count = 0
    for domain in all_domain:
        print domain

        #if domain != 'fr':
        #    continue

        conn = db.create_conn(domain = domain, family = 'wikisource')

# 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: common/common_html.py
# def get_head(title, css = None, html5 = False):


# Path: statistics/not_transcluded.py
import sys
import os
import urllib
from ws_category import domain_urls as urls
from ws_namespaces import index as index_name
from common import db
from gen_stats import all_domain
from common import common_html

    out_fd = open(out_file, 'w')

    title = '%s.wikisource.org not transcluded page' % domain
    head = common_html.get_head(title, html5 = True).encode('utf-8')
    print >> out_fd, head
    print >> out_fd, '<body>'
    if len(result):
        print >> out_fd, '<ol>'

        for d in result:
            print >> out_fd, format_html_line(domain, d[1], d[0])

        print >> out_fd, '</ol>'
    else:
        "Empty result, no Index meet the criteria to be listed in this file."

    print >> out_fd, '\n</body>\n</html>'
    out_fd.close()

    return len(result)

if __name__ == "__main__":
    tot_count = 0
    for domain in all_domain:
        print domain

        #if domain != 'fr':
        #    continue

        conn = db.create_conn(domain = domain, family = 'wikisource')

        cursor = db.use_db(conn, domain = domain, family = 'wikisource')