# Path: domains/models.py
# DOMAIN_CHARS = 'abcdefghijklmnopqrstuvwxyz-0123456789'
# 
# Path: prefixes/models.py
# class Prefix(db.Expando):
#     """
#     Count all domains in the datastore that start with the same
#     prefix. The key name is the prefix, with a leading dot and
#     optional property 'resume' if incomplete.
#     """
#     length = db.IntegerProperty(required=True)
#     count = db.IntegerProperty(required=True, default=0)
#     com = db.IntegerProperty()
#     percentage = db.FloatProperty()
#     timestamp = db.DateTimeProperty()
# 
#     @classmethod
#     def name_cut(cls, name, length=None):
#         """
#         >>> Prefix.name_cut('123456789')
#         '123456789'
#         >>> Prefix.name_cut('123456789', 3)
#         '123'
#         """
#         if length is None:
#             return name
#         else:
#             return name[:length]


import os
import sys
from common.appenginepatch.aecmd import setup_env
from google.appengine.ext import db
from google.appengine.ext.remote_api import remote_api_stub
from google.appengine.api.datastore_errors import Timeout
from domains.models import DOMAIN_CHARS
from prefixes.models import Prefix
    from optparse import OptionParser
#!/usr/bin/env python

# Setup project environment in the parent directory.
sys.path[0] = os.path.dirname(sys.path[0])
setup_env()




def auth_func():
    return open('.passwd').read().split(':')


def print_counts(name, counts):
    print name, '= {'
    keys = counts.keys()
    keys.sort()
    for key in keys:
        if counts[key]:
            print "'%s': %d," % (key, counts[key])
    print '}'


def main():
    one = {}
    two = {}
    total = 0

# Path: domains/models.py
# DOMAIN_CHARS = 'abcdefghijklmnopqrstuvwxyz-0123456789'
# 
# Path: prefixes/models.py
# class Prefix(db.Expando):
#     """
#     Count all domains in the datastore that start with the same
#     prefix. The key name is the prefix, with a leading dot and
#     optional property 'resume' if incomplete.
#     """
#     length = db.IntegerProperty(required=True)
#     count = db.IntegerProperty(required=True, default=0)
#     com = db.IntegerProperty()
#     percentage = db.FloatProperty()
#     timestamp = db.DateTimeProperty()
# 
#     @classmethod
#     def name_cut(cls, name, length=None):
#         """
#         >>> Prefix.name_cut('123456789')
#         '123456789'
#         >>> Prefix.name_cut('123456789', 3)
#         '123'
#         """
#         if length is None:
#             return name
#         else:
#             return name[:length]


# Path: tools/prefixes_counts.py
import os
import sys
from common.appenginepatch.aecmd import setup_env
from google.appengine.ext import db
from google.appengine.ext.remote_api import remote_api_stub
from google.appengine.api.datastore_errors import Timeout
from domains.models import DOMAIN_CHARS
from prefixes.models import Prefix
    from optparse import OptionParser

#!/usr/bin/env python

# Setup project environment in the parent directory.
sys.path[0] = os.path.dirname(sys.path[0])
setup_env()




def auth_func():
    return open('.passwd').read().split(':')


def print_counts(name, counts):
    print name, '= {'
    keys = counts.keys()
    keys.sort()
    for key in keys:
        if counts[key]:
            print "'%s': %d," % (key, counts[key])
    print '}'


def main():
    one = {}
    two = {}
    total = 0

    for c1 in DOMAIN_CHARS: