Commit 4c2776fe authored by Arnaud Fontaine's avatar Arnaud Fontaine

zope4: ZServer/SignalHandler only available on python2.

parent 2420c89f
...@@ -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,7 +171,12 @@ def runwsgi(): ...@@ -171,7 +171,12 @@ def runwsgi():
make_wsgi_app({}, zope_conf=args.zope_conf) make_wsgi_app({}, zope_conf=args.zope_conf)
try:
from Signals.SignalHandler import SignalHandler from Signals.SignalHandler import SignalHandler
except ImportError:
import warnings
warnings.warn("zope4py3: SignalHandling not implemented!")
else:
SignalHandler.registerHandler(signal.SIGTERM, sys.exit) SignalHandler.registerHandler(signal.SIGTERM, sys.exit)
if args.timerserver_interval: if args.timerserver_interval:
......
...@@ -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
......
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