示例#1
0
 def f(MessageBox):
     from web import app
     app.MessageBox = MessageBox
     try:
         app.run(debug=True, use_reloader=False)
     except AttributeError:
         pass
示例#2
0
def start_standalone_server(host=None, port=None, debug=True):
    if not config.check():
        sys.exit(1)

    if not os.path.exists(config.get('base', 'cache_dir')):
        os.makedirs(config.get('base', 'cache_dir'))

    import db
    from web import app

    db.init_db()
    app.run(host=host, port=port, debug=debug)
示例#3
0
def main():
    if "server" in argv or "-s" in argv:
        app.run()
    elif "help" in argv or "-h" in argv:
        print("Comandos Utililes:\
        \nserver o -s: Inicia la app en la web.\
        \nhelp o -h: Te dice los comandos utiles.\
        \nconsole o -c: Inicia en la consola.\
        ")
    elif "console" in argv or "-c" in argv:
        frasesio()
    else:
        print("Error: Comando incorrecto," " consulte el comando help o -h.")
def main():
    args = load_parse()

    if args.web:
        Thread(target=lambda: app.run(
            host="0.0.0.0",
            port="8080",
            debug=False,
            threaded=True,
        )).start()

    logger.info(f"Start car with {' '.join(args.method.split('_'))}")
    if args.method != "None":
        with car as c:
            try:
                c.run(method=args.method)
            except KeyboardInterrupt:
                c.camera.close()
                GPIO.cleanup()
示例#5
0
def main():
    signal.signal(signal.SIGTERM, sigterm_handler)
    app.run(host='0.0.0.0',
            port=8080,
            threaded=True,
            )
示例#6
0
def run():
    from sys import path
    path.append("src/main/python")
    from web import app
    app.run(debug=True, host='0.0.0.0', port=8000)
示例#7
0
#!/usr/bin/env python
from web import app

app.run(debug=True, port=8000)
示例#8
0
import sys
import os
from os.path import dirname, join
sys.path.insert(0, dirname(__file__))
activate_this = join(dirname(__file__), '.env', 'bin', 'activate_this.py')
execfile(activate_this, dict(__file__=activate_this))

from web import app as application
from web.apps.frontend import frontend
application.register_blueprint(frontend)
application.debug = True

if __name__ == '__main__':
    application.run('0.0.0.0')

# -*- coding: utf-8 -*-
"""
Main script to run the degree management web-app.
Usage:
   configure_video_mapping.py [--port=<port>] [--mode=<mode>]

Options:
    -h --help                   Show this screen.
    --port=<port>               Port to run the server example 8080, [default: 8080]
    --mode=<mode>               Debug or prod, else prod, [default: debug]
"""

from docopt import docopt

from web import app, py_video_mapping

if __name__ == '__main__':
    args = docopt(__doc__)

    try:
        port = int(args["--port"])
    except ValueError:
        port = 8080
    try:
        debug_mode = args["--mode"] == 'debug'
    except ValueError:
        debug_mode = False

    app.run(debug=debug_mode, port=port, host="0.0.0.0")
    py_video_mapping.stop()
示例#10
0
from web import app

app.run('0.0.0.0', 8000, debug=True, use_reloader=False, threaded=True)
示例#11
0
"""
import os
from os import *
import pathlib
from os import environ
from web import app

if __name__ == '__main__':

    # Setup the host url and port
    HOST = environ.get('SERVER_HOST', 'localhost')
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
 
    # Setup extra_files to watch - http://stackoverflow.com/questions/9508667/reload-flask-app-when-template-file-changes
    extra_dirs = ['donkus', 'web']
    extra_files = extra_dirs[:]
    for extra_dir in extra_dirs:
        for dirname, dirs, files in os.walk(extra_dir):
            for filename in files:
                filename = path.join(dirname, filename)
                if path.isfile(filename):
                    extra_files.append(filename)

    # Start with watching the extra files and reloading enabled
    app.run(HOST, PORT, extra_files=extra_files, debug=True)

    # Start without for Visual Studio debugger to work on static py files at build time
    #app.run(HOST, PORT)
示例#12
0
from web import app
from config.settings import get_easy_settings

#app.config.from_object(get_easy_settings())

server_settings = get_easy_settings()

app.run(host='0.0.0.0', debug=server_settings.DEBUG, port=server_settings.PORT)
示例#13
0
文件: views.py 项目: asimkhaja/monaco
    monaco = schema.Monaco()
    monaco.refresh(r)
    node_id = str(node_id)
    if not node_id in monaco.node_ids:
        abort(404)
    node = schema.MonacoNode(node_id=node_id)
    node.refresh(r)
    appinfo = node.app_info(r)
    data = {
        'node_id': node_id,
        'hostname': node.hostname,
        'FQDN': node.FQDN,
        'total_memory': node.total_memory,
        'rack': node.rack,
        'status': node.status,
        'used_memory': appinfo['memory'],
        'memory_percent': round(100.0 * appinfo['memory'] / (int(node.total_memory) / 2.0), 2),
        'master_servers': len(appinfo['masters']),
        'masters': map(str,sorted(map(int,appinfo['masters']))),
        'slave_servers': len(appinfo['slaves']),
        'slaves': map(str,sorted(map(int,appinfo['slaves']))),
        'twemproxy_servers': len(node.twems),
        # General info
        'nodes': map(str,sorted(map(int,monaco.node_ids))),
    }
 
    return render_template("node.html", **data)

if __name__ == '__main__':
    app.run('0.0.0.0', debug=True)
示例#14
0
#!/usr/bin/env python

import argparse
from web import app

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Runs Topmodel Server")
    parser.add_argument(
        "--remote", "-r", action="store_true", default=False, help="Use data from S3")
    parser.add_argument("--development", "-d", action="store_true",
                        default=False, help="Run topmodel in development mode with autoreload")
    args = parser.parse_args()
    app.local = not args.remote
    app.run(port=9191, host="0.0.0.0",
            debug=True, use_reloader=args.development)
示例#15
0
def main():
    app.run(debug=True)
示例#16
0
def main():
    app.run(host=LISTEN_HOST, port=LISTEN_PORT)
示例#17
0
文件: run.py 项目: HYU-AILAB/AI_Web
from web import app

if __name__ == '__main__':
	app.run(host='0.0.0.0', port=80)
示例#18
0
# -*- coding: utf-8 -*-
"""
   Входной скрипт

    :copyright: (c) 2013 by Pavel Lyashkov.
    :license: BSD, see LICENSE for more details.
"""
from web import app
app.config.from_object('configs.general.DevelopmentConfig')
app.run(host='127.0.0.1', port=4001)
示例#19
0
文件: run.py 项目: hmajoros/web
#!venv/bin/python
from web import app

if __name__ == "__main__":
    app.run(host="0.0.0.0")
示例#20
0
from market import emdr
from web import app
from market.priceservice import PriceService

# Kick off the price service.
PriceService.start()
from threading import Thread

#thread = Thread(target=emdr)

# Dummy call for strptime due to a bug in python regarding threading.
# The error: failed to import _strptime because the import lock is held by another thread
import datetime
datetime.datetime.strptime('2013-01-01', '%Y-%m-%d')
#thread.start()

app.run(host='0.0.0.0', debug = True, use_reloader=False)
示例#21
0
from threading import Thread
from multiprocessing import Process
from influxdb import InfluxDBClient

from producer import Producer
from consumer import Consumer
from web import app
import config


def run():
    conn = InfluxDBClient(**config.INFLUX_CONN_SETTING)
    conn.create_database(config.INFLUX_CONN_SETTING['database'])
    conn.create_retention_policy(
        name=f"{config.influx_config['database']}_policy",
        duration=config.influx_config['retention'],
        replication='1',
        database=config.influx_config['database'])
    conn.close()
    Thread(target=Producer().run).start()
    Thread(target=Consumer().run).start()


if __name__ == '__main__':
    Process(target=run).start()
    app.run(host='0.0.0.0', port=config.PORT)
示例#22
0
#!/usr/bin/python
# coding=utf-8
''' Running the stand-alone wsgi module '''
from __future__ import absolute_import, print_function, division

from web import app
application = app.wsgi_app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80)
示例#23
0
#!/usr/bin/env python
from web import app
app.run(debug=True)
示例#24
0
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# author mengskysama

from web import app


from datetime import datetime
from copy import copy
import calendar


if __name__ == '__main__':
    app.run('0.0.0.0', 8000, debug=True)
示例#25
0
from web import app

if __name__ == '__main__':
    app.run(host='127.0.0.1', port=5320, debug=True)
示例#26
0
文件: wsgi.py 项目: ajmdfeipan/portal
# -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'

from web import app

if __name__ == '__main__':
    app.run(port=5050, debug=True)
示例#27
0
def run_web():
    from web import app
    app.run(host="127.0.0.1")
示例#28
0
文件: server.py 项目: cindyyu/parking
from web import app


if __name__ == "__main__":
    app.debug = True
    app.run(port=4000)
示例#29
0
from web import app

app.run(port=80, host="0.0.0.0")
示例#30
0
# -*- coding: utf-8 -*-
"""
   Входной скрипт

    :copyright: (c) 2013 by Pavel Lyashkov.
    :license: BSD, see LICENSE for more details.
"""
from web import app
app.config.from_object('configs.general.DevelopmentConfig')
app.run(host='127.0.0.1', port=6000)
示例#31
0
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import os
from web import app

port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port, debug=True)
示例#32
0
文件: debug.py 项目: Sets88/nodectrl
#! /usr/bin/python

from web import app

if __name__ == "__main__":
    app.run(use_debugger=True, debug=True,
            use_reloader=True)
示例#33
0
from web import app
app.run(host="162.213.199.31", port=80, debug=False, threaded=True)
示例#34
0
import os
from web import app

if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0',
            port=port,
            debug=os.environ.get('DEBUG', False))
示例#35
0
def start_dev():
    app.run(host='0.0.0.0', port=80, debug=True, threaded=True)
示例#36
0
文件: manage.py 项目: liue/pydelo
# -*- coding:utf-8 -*-
__author__ = 'root'

from web import app

if __name__ == '__main__':
    app.run(host='0.0.0.0',port=app.config["PORT"], debug=app.config["DEBUG"])
示例#37
0
from web import app

app.run(host='0.0.0.0')
示例#38
0
import os

from web import app


def islocal():
    return os.environ["SERVER_NAME"] in ("localhost")

# FIXME this needs to be moved to a private file
app.secret_key = "b'\xdb\xe2\x14c\xee!\xb7F\x9c\xc8x\x8b\x04b\xbf\xad(\xc5(\x9f\x9az\xd6\x92'"

if __name__ == '__main__':
    extra_dirs = ['.']
    extra_files = extra_dirs[:]
    for extra_dir in extra_dirs:
        for dirname, dirs, files in os.walk(extra_dir):
            for filename in files:
                filename = os.path.join(dirname, filename)
                if os.path.isfile(filename):
                    extra_files.append(filename)

    host = os.getenv('IP', '0.0.0.0')
    port = int(os.getenv('PORT', '5000'))
    app.run(host=host, port=port, debug=True, extra_files=extra_files)
示例#39
0
from web import app

# Original code
# if __name__ == '__main__':
#    app.run(debug=True)

# Ivan added code 12-26-2020
if __name__ == '__main__':
    # port 8889 to enable the webapp to run at the same time as jupyterlab
    app.run(host='0.0.0.0', port=8889)
示例#40
0
文件: debug.py 项目: chinnurtb/foos
#from gevent.pywsgi import WSGIServer
# from web import log
import log

def initMessage():
	log.info("========= RUNNING debug.py ================")

initMessage()

from web import app
app.run('0.0.0.0',3031, debug=True)
# WSGIServer(('0.0.0.0',5000),app,log=None).serve_forever()
# app.run()

示例#41
0
#!/usr/bin/env python

from web import app
app.run(threaded=True, debug=True)
示例#42
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-


import os

from web import app


if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port, debug=True)
示例#43
0
from web import app
from web.config import PORT, DEBUG

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=PORT, debug=DEBUG)
示例#44
0
# -*- coding:utf-8 -*-
__author__ = 'yangtong'

from web import app

if __name__ == '__main__':
    app.run(host="0.0.0.0", port=5051, debug=True)
示例#45
0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 hzsunshx <hzsunshx@onlinegame-14-51>
#
# Distributed under terms of the MIT license.

from web import app

if __name__ == '__main__':
    app.run()
示例#46
0
from web import app

app.run(debug=True, host='0.0.0.0', port=4000)
示例#47
0
"""
This script runs the RaftViewer application using a development server.
"""
import sys

sys.path += ['..']

from os import environ
from common import read_nodes
from web import app


def get_node_list():
    global node_list
    if node_list is None or len(node_list) == 0:
        node_list = read_nodes('../nodes.txt')
    return node_list


node_list = []
if __name__ == '__main__':
    HOST = environ.get('SERVER_HOST', 'localhost')
    get_node_list()
    try:
        PORT = int(environ.get('SERVER_PORT', '5555'))
    except ValueError:
        PORT = 5555
    app.run(HOST, PORT)
示例#48
0
文件: run.py 项目: zendamacf/hmpg
#!/usr/bin/env python3
from web import app

import os

extra_dirs = ['web/templates']
extra_files = []
for extra_dir in extra_dirs:
    for dirname, dirs, files in os.walk(extra_dir):
        for filename in files:
            filename = os.path.join(dirname, filename)
            if os.path.isfile(filename):
                extra_files.append(filename)

app.run(debug=True, extra_files=extra_files)
示例#49
0
#!/usr/bin/env python
#
# Copyright (c) 2013 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
import os

from web import app


app.logger.setLevel('DEBUG')
port = int(os.environ.get('PORT', 5000))
app.run(host='172.16.200.128', port=port, debug=True)
示例#50
0
# -*- coding: utf-8 -*-
"""
Created on Sat Jul  7 23:46:27 2018

@author: anburiyan
"""
#!/usr/bin/env python

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from web import app
import logging
import os
import time

logfilepath = os.path.abspath(
    os.path.join(os.path.abspath(__name__), os.pardir)) + "/logs/"
if not os.path.exists(logfilepath):
    os.mkdir(logfilepath)
logfilepath = "{0}{1}_log.log".format(logfilepath, time.strftime("%Y%d%d"))
logging.basicConfig(filename=logfilepath, level="ERROR")

logger = logging.getLogger(__name__)

app.config["DEBUG"] = True
if __name__ == "__main__":
    app.run(port=8000)
    logger.info('Started http server on port %s' % 8000)
示例#51
0
#!/bin/env python
# -*- encoding: utf-8 -*-
from web import app
import os,sys
import db
reload(sys)
sys.setdefaultencoding('utf-8')
import utils

app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'

config = utils.get_config('web')
#print config

#将参数追加到app.config字典中,就可以随意调用了
app.config.update(config)
#实例化数据库类,并将实例化的对象导入配置
app.config['cursor'] = db.Cursor(config)
#print app.config

if __name__ == '__main__':
    app.run(host=config.get('bind', '0.0.0.0'),port=int(config.get('port')), debug=True)
示例#52
0
文件: run.py 项目: Kalypox/gps-ecolo
from web import app

HOST = '0.0.0.0'
PORT = 8090
DEBUG = True

if __name__ == "__main__":
    app.run(host=HOST, port=PORT, debug=DEBUG)
示例#53
0
文件: hello.py 项目: youngwook/web
from web import app

if __name__ == "__main__":
    app.debug = True
    app.run(host='117.16.149.113')
示例#54
0
# run.py

from web import app
from datetime import timedelta

if __name__ == "__main__":
    app.permanent_session_lifetime = timedelta(minutes=10)
    app.run(host="0.0.0.0", port=int("5000"))
示例#55
0
from web import app

if __name__ == '__main__':
    app.run(debug=False)
    Flask_Debug = 1
示例#56
0
#!/bin/env python
# -*- encoding: utf-8 -*-
from web import app
from config import DevConfig
import logging

app.config.from_object(DevConfig)

fmter = logging.Formatter('%(asctime)s %(levelname)s %(message)s',
                          datefmt='%a, %d %b %Y %H:%M:%S')
handler = logging.FileHandler(DevConfig.WEB_LOGFILE)
handler.setFormatter(fmt=fmter)
app.logger.addHandler(handler)

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)
示例#57
0
#-*-coding:utf-8-*-
from web import app

if __name__ == '__main__':
    app.run(debug=True)
示例#58
0
# coding: utf-8

import config
import os.path, sys

if __name__ == '__main__':
	if not config.check():
		sys.exit(1)

	if not os.path.exists(config.get('base', 'cache_dir')):
		os.makedirs(config.get('base', 'cache_dir'))

	import db
	from web import app

	db.init_db()
	app.run(host = '0.0.0.0', debug = True)