def _run(self, args, config): """ Main entry point. """ flask_app = app.bootstrap(debug=args.debug, debug_db=args.debug_db, latency=args.latency, log_level=args.verbosity) # Disable secure cookies for the development server. flask_app.config["SESSION_COOKIE_SECURE"] = False flask_app.run(host=args.ip, threaded=True)
def _run(self, args, config): """ Main entry point. """ flask_app = app.bootstrap( debug=args.debug, debug_db=args.debug_db, latency=args.latency, log_level=args.verbosity ) # Disable secure cookies for the development server. flask_app.config["SESSION_COOKIE_SECURE"] = False flask_app.run(host=args.ip, threaded=True)
"%Y-%m-%dT%H:%M:%S.%f") return delta < app.datetime.timedelta(minutes=1) class FetchPagesAction(base_page.BasePage): # R0201: 93,2:FetchPagesAction.get: Method could be a function # pylint: disable=R0201 def get(self): deferred.defer(app.fetch_pages) class MainAction(base_page.BasePage): def get(self): args = self.request.query_string self.redirect('/p/chromium/console' + '?' + args) # Call initial bootstrap for the app module. app.bootstrap() base_page.bootstrap() # GAE will cache |application| across requests if we set it here. See # http://code.google.com/appengine/docs/python/runtime.html#App_Caching for more # info. application = webapp2.WSGIApplication([ ('/', MainAction), ('/p/(.*)/' + ONE_BOX_URL, OneBoxAction), ('/p/(.*)', PageAction), ('/tasks/fetch_pages', FetchPagesAction) ]) gae_ts_mon.initialize(application)
class FetchPagesAction(base_page.BasePage): # R0201: 93,2:FetchPagesAction.get: Method could be a function # pylint: disable=R0201 def get(self): deferred.defer(app.fetch_pages) class MainAction(base_page.BasePage): def get(self): args = self.request.query_string self.redirect('/p/chromium/console' + '?' + args) # Call initial bootstrap for the app module. app.bootstrap() base_page.bootstrap() # GAE will cache |application| across requests if we set it here. See # http://code.google.com/appengine/docs/python/runtime.html#App_Caching for more # info. application = webapp2.WSGIApplication( [('/', MainAction), ('/p/(.*)/' + ONE_BOX_URL, OneBoxAction), ('/p/(.*)', PageAction), ('/tasks/fetch_pages', FetchPagesAction)]) gae_ts_mon.initialize(application)
from aiohttp import web from app import bootstrap app = bootstrap() if __name__ == "__main__": print("Starting app") web.run_app(app)
import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), "lib")) import app application = app.bootstrap()