Example #1
0
 def test_bbb(self):
     """ test existence of backwards compatibility methods that do nothing
     """
     zLOG.initialize()
     zLOG.set_initializer(lambda :False)
     zLOG.register_subsystem('foo')
     self.assertTrue('foo' in zLOG._subsystems)
Example #2
0
CONNECTION_LIMIT = max_sockets.max_select_sockets()

ZSERVER_VERSION = '1.1b1'
import App.FindHomes
try:
    import App.version_txt
    ZOPE_VERSION = App.version_txt.version_txt()
except:
    ZOPE_VERSION = 'experimental'

# Try to poke zLOG default logging into asyncore
# XXX We should probably should do a better job of this,
#     however that would mean that ZServer required zLOG.
try:
    from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR
    register_subsystem('ZServer')
    severity = {'info': INFO, 'warning': WARNING, 'error': ERROR}

    def log_info(self, message, type='info'):
        if message[:14]=='adding channel' or \
           message[:15]=='closing channel' or \
           message == 'Computing default hostname':
            LOG('ZServer', BLATHER, message)
        else:
            LOG('ZServer', severity[type], message)

    import asyncore
    asyncore.dispatcher.log_info = log_info
except:
    pass
Example #3
0
ZSERVER_VERSION='1.1b1'
import App.FindHomes
try:
    import App.version_txt
    ZOPE_VERSION=App.version_txt.version_txt()
except:
    ZOPE_VERSION='experimental'


# Try to poke zLOG default logging into asyncore
# XXX We should probably should do a better job of this,
#     however that would mean that ZServer required zLOG.
try:
    from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR
    register_subsystem('ZServer')
    severity={'info':INFO, 'warning':WARNING, 'error': ERROR}

    def log_info(self, message, type='info'):
        if message[:14]=='adding channel' or \
           message[:15]=='closing channel' or \
           message == 'Computing default hostname':
            LOG('ZServer', BLATHER, message)
        else:
            LOG('ZServer', severity[type], message)

    import asyncore
    asyncore.dispatcher.log_info=log_info
except:
    pass
Example #4
0
import sys, time, types

from PubCore import handle
from medusa import asyncore
from ZServer import CONNECTION_LIMIT, ZOPE_VERSION
from HTTPServer import zhttp_handler
from zLOG import register_subsystem

from M2Crypto import SSL, version
from medusa.https_server import https_server, https_channel
from medusa.asyncore import dispatcher

ZSERVER_SSL_VERSION = version

register_subsystem('ZServer HTTPS_Server')


class zhttps0_handler(zhttp_handler):
    "zhttps0 handler - sets SSL request headers a la mod_ssl"

    def __init__(self, module, uri_base=None, env=None):
        zhttp_handler.__init__(self, module, uri_base, env)

    def get_environment(self, request):
        env = zhttp_handler.get_environment(self, request)
        env['SSL_CIPHER'] = request.channel.get_cipher()
        return env


class zhttps_handler(zhttps0_handler):
Example #5
0
import sys, time, types

from PubCore import handle
import asyncore
from ZServer import CONNECTION_LIMIT, ZOPE_VERSION
from HTTPServer import zhttp_handler
from zLOG import register_subsystem

from M2Crypto import SSL
from medusa.https_server import https_server, https_channel
from asyncore import dispatcher


ZSERVER_SSL_VERSION='0.12'

register_subsystem('ZServer HTTPS_Server')


class zhttps0_handler(zhttp_handler):
    "zhttps0 handler - sets SSL request headers a la mod_ssl"

    def __init__ (self, module, uri_base=None, env=None):
        zhttp_handler.__init__(self, module, uri_base, env)

    def get_environment(self, request):
        env = zhttp_handler.get_environment(self, request)
        env['SSL_CIPHER'] = request.channel.get_cipher()
        return env


class zhttps_handler(zhttps0_handler):
Example #6
0
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################

__version__ = '3.1.1'

import sys
import cPersistence, Persistence
from zLOG import register_subsystem
register_subsystem('ZODB')

# This is lame. Don't look. :(
sys.modules['cPersistence'] = cPersistence

Persistent = cPersistence.Persistent

# Install Persistent and PersistentMapping in Persistence
if not hasattr(Persistence, 'Persistent'):
    Persistence.Persistent = Persistent
    Persistent.__module__ = 'Persistence'
    Persistence.Overridable = cPersistence.Overridable
    Persistence.Overridable.__module__ = 'Persistence'
    if not hasattr(Persistence, 'PersistentMapping'):
        import PersistentMapping
        sys.modules['PersistentMapping'] = PersistentMapping