示例#1
0
文件: dispatch.py 项目: kod3r/isso
    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
示例#2
0
    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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
文件: dispatch.py 项目: Batur24/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)
示例#6
0
    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)
示例#7
0
文件: run.py 项目: alemic/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')))
示例#8
0
文件: run.py 项目: pellenilsson/isso
# -*- 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)
示例#9
0
# 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
示例#10
0
文件: run.py 项目: uche100/isso
# -*- 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)
示例#11
0
# -*- 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)
示例#12
0
# 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
示例#13
0
文件: run.py 项目: triosky/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')),
                       multiprocessing=True)
示例#14
0
文件: run.py 项目: fliiiix/isso
# -*- 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)
示例#15
0
# 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
示例#16
0
#! 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,
)