Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ba10e957d9
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 45 lines (33 sloc) 1.218 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import logging

def setup():
    logging.basicConfig(level = logging.DEBUG)

    cur_dir = os.path.dirname(os.path.abspath(__file__))
    sys.path.insert(0, os.path.join(cur_dir, 'launchers'))
    sys.path.insert(0, os.path.join(cur_dir, 'launchers/django_launcher'))
    sys.path.insert(0, os.path.join(cur_dir, 'projects'))
    sys.path.insert(0, os.path.join(cur_dir, '../'))

    import kaylee
    kaylee.setup(os.path.join(cur_dir, 'demo_config.py'))

    # module mock
    class KayleeDemo(object):
        FRONTEND_TEMPLATES_DIR = os.path.join(cur_dir, 'build/templates')
        FRONTEND_STATIC_DIR = os.path.join(cur_dir, 'build/static')
    sys.modules['kaylee_demo'] = KayleeDemo

def main():
    parser = argparse.ArgumentParser(description='Kaylee launcher')
    parser.add_argument('-f', '--frontend', default = 'flask',
                        choices = ['flask', 'django'])
    args = parser.parse_args()

    setup()

    if args.frontend == 'flask':
        from flask_launcher import run
    elif args.frontend == 'django':
        from django_launcher import run
    run()




if __name__ == '__main__':
    main()
Something went wrong with that request. Please try again.