コード例 #1
0
ファイル: __init__.py プロジェクト: xuhai5/fqrouter
def handle_stop(environ, start_response):
    start_response(httplib.OK, [('Content-Type', 'text/plain')])
    yield stop_hotspot()
コード例 #2
0
ファイル: __init__.py プロジェクト: xuhai5/fqrouter
def handle_reset(environ, start_response):
    start_response(httplib.OK, [('Content-Type', 'text/plain')])
    enable_wifi_p2p_service()
    restore_config_files()
    stop_hotspot()
    return []
コード例 #3
0
ファイル: main.py プロジェクト: acekiller/fqrouter
def wifi_reset():
    wifi.enable_wifi_p2p_service()
    wifi.restore_config_files()
    wifi.stop_hotspot()
コード例 #4
0
def wifi_reset():
    wifi.enable_wifi_p2p_service()
    wifi.restore_config_files()
    wifi.stop_hotspot()
コード例 #5
0
ファイル: __init__.py プロジェクト: kexuejin/fqrouter
def handle_stop(environ, start_response):
    start_response(httplib.OK, [('Content-Type', 'text/plain')])
    yield stop_hotspot()
コード例 #6
0
ファイル: __init__.py プロジェクト: JustLin/fqrouter
def handle_reset(environ, start_response):
    start_response(httplib.OK, [('Content-Type', 'text/plain')])
    enable_wifi_p2p_service()
    restore_config_files()
    stop_hotspot()
    return []
コード例 #7
-1
ファイル: main.py プロジェクト: catoc/fqrouter
    httpd.serve_forever()


def clean():
    setup_logging(LOG_FILE)
    LOGGER.info('clean...')
    dns_service.clean()
    tcp_service.clean()
    full_proxy_service.clean()
    lan_service.clean()
    wifi.clean()


if '__main__' == __name__:
    if len(sys.argv) > 1:
        shutdown_hook.shutdown_hooks = []
        action = sys.argv[1]
        if 'wifi-start-hotspot' == action:
            setup_logging(os.path.join(LOG_DIR, 'wifi.log'), maxBytes=1024 * 512)
            sys.stderr.write(repr(wifi.start_hotspot(*sys.argv[2:])))
        elif 'wifi-stop-hotspot' == action:
            setup_logging(os.path.join(LOG_DIR, 'wifi.log'), maxBytes=1024 * 512)
            sys.stderr.write(repr(wifi.stop_hotspot()))
        elif 'twitter-check' == action:
            setup_logging(os.path.join(LOG_DIR, 'twitter.log'), maxBytes=1024 * 64)
            sys.stderr.write(repr(twitter.check()))
        elif 'clean' == action:
            clean()
    else:
        run()