def __init__(self, *confs): self.isso = {} for conf in map(Config.load, confs): app = make_app(conf) for origin in conf.getiter("general", "host"): self.isso[origin.rstrip("/")] = app
def __init__(self, *confs): self.isso = {} for i, conf in enumerate(map(Config.load, confs)): if not conf.get("general", "name"): logger.warn("unable to dispatch %r, no 'name' set", confs[i]) continue self.isso["/" + conf.get("general", "name")] = make_app(conf) super(Dispatcher, self).__init__(self.default, mounts=self.isso)
def __init__(self, *confs): self.isso = {} default = os.path.join(dist.location, 'isso', "defaults.ini") for i, path in enumerate(confs): conf = config.load(default, path) if not conf.get("general", "name"): logger.warn("unable to dispatch %r, no 'name' set", confs[i]) continue self.isso["/" + conf.get("general", "name")] = make_app(conf) super(Dispatcher, self).__init__(self.default, mounts=self.isso)
def __init__(self, *confs): self.isso = {} default = os.path.join(dist.location, dist.project_name, "defaults.ini") for i, path in enumerate(confs): conf = config.load(default, path) if not conf.get("general", "name"): logger.warn("unable to dispatch %r, no 'name' set", confs[i]) continue self.isso["/" + conf.get("general", "name")] = make_app(conf) super(Dispatcher, self).__init__(self.default, mounts=self.isso)
def __init__(self, *confs): self.isso = {} default = pkg_resources.resource_filename('isso', 'defaults.ini') for i, path in enumerate(confs): conf = config.load(default, path) if not conf.get("general", "name"): logger.warn("unable to dispatch %r, no 'name' set", confs[i]) continue self.isso["/" + conf.get("general", "name")] = make_app(conf) super(Dispatcher, self).__init__(self.default, mounts=self.isso)
# -*- encoding: utf-8 -*- import os from isso import make_app from isso.core import Config application = make_app(Config.load(os.environ.get('ISSO_SETTINGS')))
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import os from isso import make_app from isso import dist, config application = make_app( config.load( os.path.join(dist.location, "isso", "defaults.ini"), os.environ.get('ISSO_SETTINGS')), multiprocessing=True)
# This portion of code is fork of gunicorn's example of running # custom applications. # Original link - http://gunicorn-docs.readthedocs.org/en/latest/custom.html # 2009-2015 (c) Benoit Chesneau <*****@*****.**> # 2009-2015 (c) Paul J. Davis <*****@*****.**> import os import sys import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems from isso import make_app from isso import config as isso_config application = make_app(isso_config.load('production.cfg')) """ virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: execfile(virtualenv, dict(__file__=virtualenv)) except IOError: pass ip = os.environ['OPENSHIFT_PYTHON_IP'] port = int(os.environ['OPENSHIFT_PYTHON_PORT']) """ def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import os from isso import make_app from isso import dist, config application = make_app(config.load( os.path.join(dist.location, "share", "isso.conf"), os.environ.get('ISSO_SETTINGS')), multiprocessing=True)
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import os from isso import make_app from isso import dist, config application = make_app(config.load( os.path.join(dist.location, dist.project_name, "defaults.ini"), os.environ.get('ISSO_SETTINGS')), multiprocessing=True)
# This portion of code is fork of gunicorn's example of running # custom applications. # Original link - http://gunicorn-docs.readthedocs.org/en/latest/custom.html # 2009-2015 (c) Benoit Chesneau <*****@*****.**> # 2009-2015 (c) Paul J. Davis <*****@*****.**> import os import sys import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems from isso import make_app from isso import config as isso_config application = make_app(isso_config.load('production.cfg')) virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: execfile(virtualenv, dict(__file__=virtualenv)) except IOError: pass ip = os.environ['OPENSHIFT_PYTHON_IP'] port = int(os.environ['OPENSHIFT_PYTHON_PORT']) def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1
# -*- encoding: utf-8 -*- import os from isso import make_app from isso.core import Config application = make_app(Config.load(os.environ.get('ISSO_SETTINGS')), multiprocessing=True)
# -*- encoding: utf-8 -*- import os import pkg_resources from isso import config, make_app application = make_app(config.load( pkg_resources.resource_filename('isso', 'defaults.ini'), os.environ.get('ISSO_SETTINGS')), multiprocessing=True)
# This portion of code is fork of gunicorn's example of running # custom applications. # Original link - http://gunicorn-docs.readthedocs.org/en/latest/custom.html # 2009-2015 (c) Benoit Chesneau <*****@*****.**> # 2009-2015 (c) Paul J. Davis <*****@*****.**> import os import sys import multiprocessing import gunicorn.app.base from gunicorn.six import iteritems from isso import make_app from isso.core import Config application = make_app(Config.load('production.cfg')) virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: execfile(virtualenv, dict(__file__=virtualenv)) except IOError: pass ip = os.environ['OPENSHIFT_PYTHON_IP'] port = int(os.environ['OPENSHIFT_PYTHON_PORT']) def number_of_workers(): return (multiprocessing.cpu_count() * 2) + 1
#! python3 """ WSGI script to allow launch isso through Apache mod_wsgi. """ import site site.addsitedir("./.venv") import os from pathlib import Path from isso import config, dist, make_app # globals isso_conf_file = Path(__file__).parent / "isso-prod.cfg" application = make_app( config.load( default=os.path.join(dist.location, dist.project_name, "defaults.ini"), user=str(isso_conf_file.resolve()), ), multiprocessing=True, threading=True, )