예제 #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
파일: dispatch.py 프로젝트: rhn/marginalia
    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,
)