from flask import signals namespace = signals.Namespace() app_shutdown = namespace.signal('app_shutdown')
try: mod = __import__(mod_path) except ImportError: raise RuntimeError("no such %s %r" % ( var_name, mod_name, )) for atom in mod_path.split('.')[1:]: mod = getattr(mod, atom) mod.init_app(app) def init_app(app): login_manager.init_app(app) # provide a landing page that asks the user to login app.route('/login_request')(login_request) # flash notify on login and logout user_logged_in.connect(logged_in, app) # see https://github.com/maxcountryman/flask-login/issues/162 user_logged_out.connect(logged_out, app) _init_mod(app, 'RELENGAPI_AUTHENTICATION', 'browserid', 'relengapi.lib.auth.auth_types') _init_mod(app, 'RELENGAPI_PERMISSIONS', 'static', 'relengapi.lib.auth.perms_types') permissions_stale = signals.Namespace().signal('permissions_stale')
import ResultData import SampleData from XMLRPC import XMLRPCServer from gevent.wsgi import WSGIServer from flask import Flask from flask import signals import logging import logging.config logging.config.fileConfig('logging.conf') logger = logging.getLogger('root') flaskCore = Flask(__name__) flaskSignal = signals.Namespace() xmlrpcServer = XMLRPCServer() @flaskCore.route('/') def hello_world(): return 'Hello world' if __name__ == '__main__': logger.info('Application Start.') from subprocess import check_output, call try: out = check_output('lsof -i:80 -t', shell=True) pid = ''.join(list(filter(str.isdigit, str(out))))