예제 #1
0
#coding:utf8

from gevent import monkey; monkey.patch_all()

if __name__=="__main__":
    from gfirefly.master.master import Master
    master = Master()
    master.config('config.json','appmain.py')
    master.start()
    
    
예제 #2
0
DEFAULT_JSON = dict(server_name='local',
                    login_ip='127.0.0.1',
                    front_ip='127.0.0.1')

if __name__ == "__main__":
    if os.path.exists('template.json'):
        template = open('template.json')
        str_template = template.read()
        if os.path.exists('my.json'):
            config = json.load(open('my.json'))
            replace_items = config.items()
        else:
            replace_items = DEFAULT_JSON.items()
        for k, v in replace_items:
            str_template = str_template.replace('<=%s=>' % k, v)
            fp = open('config.json', 'w')

            fp.write(str_template)
            fp.flush()
            fp.close()
    else:
        print 'can not find template.json'

    if not os.path.exists(CONFIG_FILE):
        print 'can not find config.json'
    else:
        from gfirefly.master.master import Master
        master = Master()
        master.config(CONFIG_FILE, 'appmain.py')
        master.start()
예제 #3
0
# coding:utf8
'''
Created on 2013-8-2

@author: lan (www.9miao.com)
'''


def println(a):
    print a


if __name__ == "__main__":
    from gfirefly.master.master import Master

    master = Master()
    master.config('config.json', 'test_server_main.py')
    master.start()
    
    
예제 #4
0
#coding:utf8

from gevent import monkey; monkey.patch_os()

if __name__=="__main__":
    from gfirefly.master.master import Master
    master = Master()
    master.config('config.json','appmain.py')
    master.start()
    
    
예제 #5
0
# -*- coding:utf-8 -*-

if __name__ == "__main__":
    from gfirefly.master.master import Master
    master = Master()
    master.config('config.json', "appmain.py")
    master.start()
예제 #6
0
    # print(sys.exit())

    if os.path.exists('/tmp/server_list.json'):
        os.system("cp /tmp/server_list.json server_list.json")

    if os.path.exists('template.json'):
        template = open('template.json')
        str_template = template.read()
        if os.path.exists('my.json'):
            config = json.load(open('my.json'))
            replace_items = config.items()
        else:
            replace_items = DEFAULT_JSON.items()
        for k, v in replace_items:
            str_template = str_template.replace('<=%s=>' % k, v)

        fp = open('config.json', 'w')
        fp.write(str_template)
        fp.flush()
        fp.close()
    else:
        print 'can not find template.json'

    if not os.path.exists(CONFIG_FILE):
        print 'can not find config.json'
    else:
        from gfirefly.master.master import Master
        master = Master()
        master.config(CONFIG_FILE, 'appmain.py')
        master.start()
예제 #7
0
#coding:utf8
'''
Created on 2013-8-2

@author: lan (www.9miao.com)
'''
    
def println(a):
    print a

if __name__=="__main__":
    from gfirefly.master.master import Master
    master = Master()
    master.config('config.json','test_server_main.py')
    master.start()