示例#1
0
def main():
    if len(sys.argv) > 1:
        print backend(**add_args())
    else:
        try:
            desc = __doc__.split('\n\n')[1].strip()
            parser = argparse.ArgumentParser(description=desc, epilog=epi)
            args = parser.parse_args()
            open_browser(app.config.get('PORT'))
            app.run(port=app.config.get('PORT'))
            sys.exit(0)
        except KeyboardInterrupt, e:  # Ctrl-C
            raise e
        except SystemExit, e:  # sys.exit()
            raise e
示例#2
0
def main():
    if len(sys.argv) > 1:
        sys.stdout.write(backend(**add_args()))
    else:
        try:
            desc = __doc__.split('\n\n')[1].strip()
            parser = argparse.ArgumentParser(description=desc, epilog=epi)
            args = parser.parse_args()
            open_browser(app.config.get('PORT'))
            app.run(port=app.config.get('PORT'))
            sys.exit(0)
        except KeyboardInterrupt as e:  # Ctrl-C
            raise e
        except SystemExit as e:  # sys.exit()
            raise e
        else:
            sys.stdout.write('ERROR, UNEXPECTED EXCEPTION')
            traceback.print_exc()
            os._exit(1)
示例#3
0
import config
from module import app, upload
from flask import url_for, render_template, jsonify


@app.route('/')
def index():
    return render_template('index.html', title="Flask Upload Demo")


if __name__ == "__main__":
    app.run(host='0.0.0.0', port=5001, debug=config.DEBUG)
示例#4
0
from module import app

if __name__ == '__main__':
    app.run()
示例#5
0
文件: run.py 项目: rhembran/noahECS
#!/usr/bin/python

from module import app

if __name__ == "__main__":
    app.run(debug=True,host='0.0.0.0',threaded=True)
示例#6
0
from module import app
from module.config import routes
if __name__ == "__main__":
    app.run(debug=True)