Пример #1
0
import pylons.legacy
import pylons.templating


default_template_engine = 'mako'
request_defaults = dict(charset='utf-8', errors='replace',
                        decode_param_names=False, language='en-us')
response_defaults = dict(content_type='text/html',
                         charset='utf-8', errors='strict', 
                         headers={'Cache-Control': 'no-cache', 
                                  'Pragma': 'no-cache'})

log = logging.getLogger(__name__)


config = DispatchingConfig()

class PylonsConfig(dict):
    """Pylons configuration object

    The Pylons configuration object is a per-application instance
    object that retains the information regarding the global and app
    conf's as well as per-application instance specific data such as
    the mapper, and the paths for this instance.

    The config object is available in your application as the Pylons
    global :data:`pylons.config`. For example::

        from pylons import config

        template_paths = config['pylons.paths']['templates']
Пример #2
0
request_defaults = dict(charset='utf-8',
                        errors='replace',
                        decode_param_names=False,
                        language='en-us')
response_defaults = dict(content_type='text/html',
                         charset='utf-8',
                         errors='strict',
                         headers={
                             'Cache-Control': 'no-cache',
                             'Pragma': 'no-cache'
                         })

log = logging.getLogger(__name__)

config = DispatchingConfig()


class PylonsConfig(dict):
    """Pylons configuration object

    The Pylons configuration object is a per-application instance
    object that retains the information regarding the global and app
    conf's as well as per-application instance specific data such as
    the mapper, and the paths for this instance.

    The config object is available in your application as the Pylons
    global :data:`pylons.config`. For example::

        from pylons import config
Пример #3
0
    http://www.bootstrappy.org/

    You may not remove or alter the substance of any license notices (including
    copyright notices, patent notices, disclaimers of warranty, or limitations
    of liability) contained within the Source Code Form of the Covered Software,
    except that You may alter any license notices to the extent required to
    remedy known factual inaccuracies.
"""

import pkg_resources
from paste.registry import StackedObjectProxy
from paste.config import DispatchingConfig

__all__ = [
    'app_globals', 'cache', 'config', 'request', 'response', 'session',
    'tmpl_context', 'url'
]

app_globals = StackedObjectProxy(name="app_globals")
cache = StackedObjectProxy(name="cache")
request = StackedObjectProxy(name="request")
response = StackedObjectProxy(name="response")
session = StackedObjectProxy(name="session")
tmpl_context = StackedObjectProxy(name="tmpl_context")
url = StackedObjectProxy(name="url")
template = StackedObjectProxy(name="template")
permissions = StackedObjectProxy(name="permissions")
auth_id = StackedObjectProxy(name="auth_id")
config = DispatchingConfig()
Пример #4
0
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
"""
import copy
import logging
import os
import sys

from paste.config import DispatchingConfig
from paste.deploy.converters import asbool
from webhelpers.mimehelper import MIMETypes

config = DispatchingConfig()

sys.setrecursionlimit(1500)


class PyBloxConfig(dict):
    '''Pylonsish/pastish config for global vars, setting up beaker cache, and
    environment defaults.
    '''

    defaults = {
            'debug': False,
            'pyblox.package': None,
            'pyblox.paths': {'root': None,
                             'controllers': None,
                             'templates': [],
Пример #5
0
    You may not remove or alter the substance of any license notices (including
    copyright notices, patent notices, disclaimers of warranty, or limitations
    of liability) contained within the Source Code Form of the Covered Software,
    except that You may alter any license notices to the extent required to
    remedy known factual inaccuracies.
"""
import copy
import logging
import os
import sys

from paste.config import DispatchingConfig
from paste.deploy.converters import asbool
from webhelpers.mimehelper import MIMETypes

config = DispatchingConfig()

sys.setrecursionlimit(1500)


class BootstrapPyConfig(dict):
    '''Pylonsish/pastish config for global vars, setting up beaker cache, and
    environment defaults.
    '''

    defaults = {
        'debug':
        False,
        'bootstrappy.package':
        None,
        'bootstrappy.paths': {
Пример #6
0
import copy
from paste.config import DispatchingConfig
config = DispatchingConfig()

class InGoConfig(dict):
    defaults = {
        'debug': {
            'enabled': False
        },
        'project': {
            'package': None,
            'paths': {
                'root': None,
                'config': None,
                'controllers': [],
                'templates': [],
                'static_files': []
            }
        }
    }
    
    def get(self, name, default=None):
        if name.find('.') > -1:
            parts = name.split('.')
            cnt = len(parts)
            for i, k in enumerate(parts):
                if i == 0:
                    try:
                        v = super(InGoConfig, self).get(k, {})
                    except AttributeError:
                        raise AttributeError('%s is not set in path (%s)' % (k, name))