Commit 7252a5f5 authored by Arnaud Fontaine's avatar Arnaud Fontaine

zope4: ZServer/SignalHandler only available on python2.

parent 2dd34c4a
...@@ -114,6 +114,7 @@ def match(self, request): ...@@ -114,6 +114,7 @@ def match(self, request):
return 1 return 1
else: else:
return 0 return 0
import six
from ZServer.HTTPServer import zhttp_handler if six.PY2:
zhttp_handler.match = match from ZServer.HTTPServer import zhttp_handler
zhttp_handler.match = match
...@@ -171,8 +171,13 @@ def runwsgi(): ...@@ -171,8 +171,13 @@ def runwsgi():
make_wsgi_app({}, zope_conf=args.zope_conf) make_wsgi_app({}, zope_conf=args.zope_conf)
from Signals.SignalHandler import SignalHandler try:
SignalHandler.registerHandler(signal.SIGTERM, sys.exit) from Signals.SignalHandler import SignalHandler
except ImportError:
import warnings
warnings.warn("zope4py3: SignalHandling not implemented!")
else:
SignalHandler.registerHandler(signal.SIGTERM, sys.exit)
if args.timerserver_interval: if args.timerserver_interval:
import Products.TimerService import Products.TimerService
......
...@@ -53,7 +53,9 @@ from Products.ERP5Type.patches import ActionInformation ...@@ -53,7 +53,9 @@ from Products.ERP5Type.patches import ActionInformation
from Products.ERP5Type.patches import ActionProviderBase from Products.ERP5Type.patches import ActionProviderBase
from Products.ERP5Type.patches import ActionsTool from Products.ERP5Type.patches import ActionsTool
from Products.ERP5Type.patches import CookieCrumbler from Products.ERP5Type.patches import CookieCrumbler
from Products.ERP5Type.patches import PropertySheets if six.PY2:
# XXX- patch for webdav
from Products.ERP5Type.patches import PropertySheets
from Products.ERP5Type.patches import CMFCoreSkinnable from Products.ERP5Type.patches import CMFCoreSkinnable
from Products.ERP5Type.patches import CMFCoreSkinsTool from Products.ERP5Type.patches import CMFCoreSkinsTool
from Products.ERP5Type.patches import OFSFile from Products.ERP5Type.patches import OFSFile
...@@ -63,7 +65,9 @@ from Products.ERP5Type.patches import PersistentMapping ...@@ -63,7 +65,9 @@ from Products.ERP5Type.patches import PersistentMapping
from Products.ERP5Type.patches import DateTimePatch from Products.ERP5Type.patches import DateTimePatch
from Products.ERP5Type.patches import PythonScript from Products.ERP5Type.patches import PythonScript
from Products.ERP5Type.patches import MailHost from Products.ERP5Type.patches import MailHost
from Products.ERP5Type.patches import http_server if six.PY2:
# No more ZServer
from Products.ERP5Type.patches import http_server
from Products.ERP5Type.patches import memcache_client from Products.ERP5Type.patches import memcache_client
if WITH_LEGACY_WORKFLOW: if WITH_LEGACY_WORKFLOW:
from Products.ERP5Type.patches import StateChangeInfoPatch from Products.ERP5Type.patches import StateChangeInfoPatch
...@@ -89,15 +93,19 @@ from Products.ERP5Type.patches import SourceCodeEditorZMI ...@@ -89,15 +93,19 @@ from Products.ERP5Type.patches import SourceCodeEditorZMI
from Products.ERP5Type.patches import CachingPolicyManager from Products.ERP5Type.patches import CachingPolicyManager
from Products.ERP5Type.patches import AcceleratedHTTPCacheManager from Products.ERP5Type.patches import AcceleratedHTTPCacheManager
from Products.ERP5Type.patches import ExceptionFormatter from Products.ERP5Type.patches import ExceptionFormatter
from Products.ERP5Type.patches import WebDAV
from Products.ERP5Type.patches import DTMLMethod from Products.ERP5Type.patches import DTMLMethod
from Products.ERP5Type.patches import DTMLDocument from Products.ERP5Type.patches import DTMLDocument
if six.PY2:
# No ZServer, so no webdav
from Products.ERP5Type.patches import WebDAV
from Products.ERP5Type.patches import CMFCoreUtils from Products.ERP5Type.patches import CMFCoreUtils
from Products.ERP5Type.patches import ZopePageTemplate from Products.ERP5Type.patches import ZopePageTemplate
from Products.ERP5Type.patches import ZSQLMethod from Products.ERP5Type.patches import ZSQLMethod
from Products.ERP5Type.patches import MimetypesRegistry from Products.ERP5Type.patches import MimetypesRegistry
from Products.ERP5Type.patches import users from Products.ERP5Type.patches import users
from Products.ERP5Type.patches import Publish if six.PY2:
# No ZServer
from Products.ERP5Type.patches import Publish
from Products.ERP5Type.patches import WSGITask from Products.ERP5Type.patches import WSGITask
from Products.ERP5Type.patches import urllib_opener from Products.ERP5Type.patches import urllib_opener
......
from ZServer.datatypes import ServerFactory import six
if six.PY2:
from ZServer.datatypes import ServerFactory
class TimerServerFactory(ServerFactory): class TimerServerFactory(ServerFactory):
def __init__(self, section): def __init__(self, section):
ServerFactory.__init__(self) ServerFactory.__init__(self)
self.interval = section.interval self.interval = section.interval
def create(self): def create(self):
from .TimerServer import TimerServer from .TimerServer import TimerServer
return TimerServer(self.module, self.interval) return TimerServer(self.module, self.interval)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment