from webservice import app app.run(debug=True, port=5030)
from webservice import app app.run(host="0.0.0.0", debug=True, threaded=True)
from webservice import app as application if __name__ == "__main__": application.run()
from webservice import app if __name__ in "__main__": app.run()
# update pom with open(os.path.join(artifactPath, "pom.xml"), "w+") as pomfile: pomstring = generatePoms.generateChildPom( groupId="archivo-indices", artifactId="ontologies", version=newVersionString, license="http://creativecommons.org/licenses/by-sa/3.0/", packaging="jar", ) print(pomstring, file=pomfile) # write new index dbUtils.write_official_index( os.path.join(indexpath, "ontologies_type=official.csv")) dbUtils.write_dev_index(os.path.join(indexpath, "ontologies_type=dev.csv")) # deploy status, log = generatePoms.callMaven(os.path.join(artifactPath, "pom.xml"), "deploy") if status: discovery_logger.info("Deployed new index to databus") else: discovery_logger.warning("Failed deploying to databus") discovery_logger.warning(log) # Shutdown your cron thread if the web process is stopped atexit.register(lambda: cron.shutdown(wait=False)) if __name__ == "__main__": db.create_all() app.run(debug=True)
from webservice import app as application print(str(application)) if __name__ == "__name__": print("Running the app") application.run()
""" Created: 19.03.2015 @author: Dennis Ligtenberg Runs the Flask app locally """ import os from webservice import app if __name__ == "__main__": from raven.contrib.flask import Sentry sentry = Sentry() # automatically reads 'SENTRY_DSN' if set sentry.init_app(app) app.run(port=8080, host="0.0.0.0", debug=bool(os.environ.get("DEBUG")))
parser = argparse.ArgumentParser(description="") parser.add_argument("-p", "-port", help="Port to listen", type=int, dest="port", default=userConfig.port) parser.add_argument("--bind", help="IP to bind to", dest="bind", default=userConfig.ip) parser.add_argument("--debug", help="Enable debug mode on server", dest="debug", action="store_true", default=userConfig.debug) parser.add_argument("--dry-run", help="Only validates arguments", dest="dryrun", action="store_true") parser.add_argument("--first-run", help="Configuration walkthrough", dest="first", action="store_true") parser.add_argument("--daemon", help="Fork and stay at background", dest="daemon", action="store_true") parser.add_argument("--config-file", help="Use different config file", dest="cfg", default=None) parser.add_argument("--player", help="Player to be used", dest="player", default=userConfig.player) args = parser.parse_args() if args.dryrun: sys.exit(0) if args.cfg is not None: userConfig.read(args.cfg) userConfig.ip = args.bind userConfig.port = args.port userConfig.debug = bool(args.debug) userConfig.player = args.player import config config.base_dir = userConfig.directory config.player_choice = userConfig.player if args.first: first_run(userConfig) sys.exit(0) from webservice import app app.run(debug=args.debug, host=args.bind, port=args.port)