Exemplo n.º 1
0
#!/usr/bin/env python

# Setup project environment in the parent directory.
import os
import sys
sys.path[0] = os.path.dirname(sys.path[0])
from common.appenginepatch.aecmd import setup_env
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


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 '}'

Exemplo n.º 2
0
#!/usr/bin/env python

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

import datetime

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
from prefixes.models import Prefix, Suffix, DotComPrefix, DotComSuffix


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


def main():
    for name in 'ab as ax ur we'.split():
        prefix = Prefix(key_name=name, length=len(name))
        prefix.count_domains()
        print prefix
        suffix = Suffix(key_name=name, length=len(name))
        suffix.count_domains()
        print suffix
Exemplo n.º 3
0
#!/usr/bin/env python
import sys
from os.path import abspath, dirname, join
sys.path.insert(0, abspath(join(dirname(__file__), 'local_apps')))
sys.path.insert(0, abspath(join(dirname(__file__), 'external_apps')))
sys.path.insert(0, abspath(join(dirname(__file__), 'external_libs')))
sys.path.insert(0, abspath(dirname(__file__)))

import warnings
warnings.filterwarnings("ignore")

if __name__ == '__main__':
    from common.appenginepatch.aecmd import setup_env
    setup_env(manage_py_env=True)

    # Recompile translation files
    from mediautils.compilemessages import updatemessages
    updatemessages()

    # Generate compressed media files for manage.py update
    import sys
    from mediautils.generatemedia import updatemedia
    if len(sys.argv) >= 2 and sys.argv[1] == 'update':
        updatemedia(True)

    import settings
    from django.core.management import execute_manager
    execute_manager(settings)
Exemplo n.º 4
0
#!/usr/bin/env python
if __name__ == '__main__':
    from common.appenginepatch.aecmd import setup_env
    setup_env(manage_py_env=True)

    # Recompile translation files
    from mediautils.compilemessages import updatemessages
    updatemessages()

    # Generate compressed media files for manage.py update
    import sys
    from mediautils.generatemedia import updatemedia
    if len(sys.argv) >= 2 and sys.argv[1] == 'update':
        updatemedia(True)

    import settings
    from django.core.management import execute_manager
    execute_manager(settings)