Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
ae3fe621
Commit
ae3fe621
authored
Apr 25, 2022
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: ZServer/SignalHandler only available on python2.
parent
341dd5b7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
26 deletions
+54
-26
product/DeadlockDebugger/dumper.py
product/DeadlockDebugger/dumper.py
+4
-3
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+11
-1
product/ERP5/bin/zopewsgi.py
product/ERP5/bin/zopewsgi.py
+7
-2
product/ERP5Type/ZopePatch.py
product/ERP5Type/ZopePatch.py
+12
-4
product/Localizer/patches.py
product/Localizer/patches.py
+10
-8
product/TimerService/timerserver/__init__.py
product/TimerService/timerserver/__init__.py
+10
-8
No files found.
product/DeadlockDebugger/dumper.py
View file @
ae3fe621
...
@@ -113,6 +113,7 @@ def match(self, request):
...
@@ -113,6 +113,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
product/ERP5/Tool/TemplateTool.py
View file @
ae3fe621
...
@@ -27,12 +27,16 @@
...
@@ -27,12 +27,16 @@
#
#
##############################################################################
##############################################################################
from
webdav.client
import
Resource
try
:
from
webdav.client
import
Resource
except
ImportError
:
# six.PY3, Zope4
from
webdav.Resource
import
Resource
from
App.config
import
getConfiguration
from
App.config
import
getConfiguration
import
os
import
os
import
shutil
import
shutil
import
sys
import
sys
import
six
from
Acquisition
import
Implicit
,
Explicit
from
Acquisition
import
Implicit
,
Explicit
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
...
@@ -285,6 +289,9 @@ class TemplateTool (BaseTool):
...
@@ -285,6 +289,9 @@ class TemplateTool (BaseTool):
"""
"""
Publish the given business template at the given URL.
Publish the given business template at the given URL.
"""
"""
if
six
.
PY3
:
raise
NotImplementedError
(
"TODO-zope4py3"
)
business_template
.
build
()
business_template
.
build
()
export_string
=
self
.
manage_exportObject
(
id
=
business_template
.
getId
(),
export_string
=
self
.
manage_exportObject
(
id
=
business_template
.
getId
(),
download
=
True
)
download
=
True
)
...
@@ -298,6 +305,9 @@ class TemplateTool (BaseTool):
...
@@ -298,6 +305,9 @@ class TemplateTool (BaseTool):
"""
"""
Update an existing template from its publication URL.
Update an existing template from its publication URL.
"""
"""
if
six
.
PY3
:
raise
NotImplementedError
(
"TODO-zope4py3"
)
url
=
business_template
.
getPublicationUrl
()
url
=
business_template
.
getPublicationUrl
()
id
=
business_template
.
getId
()
id
=
business_template
.
getId
()
bt
=
Resource
(
url
)
bt
=
Resource
(
url
)
...
...
product/ERP5/bin/zopewsgi.py
View file @
ae3fe621
import
six
import
argparse
import
argparse
from
io
import
BytesIO
from
io
import
BytesIO
import
logging
import
logging
...
@@ -167,8 +168,12 @@ def runwsgi():
...
@@ -167,8 +168,12 @@ def runwsgi():
make_wsgi_app
({},
zope_conf
=
args
.
zope_conf
)
make_wsgi_app
({},
zope_conf
=
args
.
zope_conf
)
if
six
.
PY2
:
from
Signals.SignalHandler
import
SignalHandler
from
Signals.SignalHandler
import
SignalHandler
SignalHandler
.
registerHandler
(
signal
.
SIGTERM
,
sys
.
exit
)
SignalHandler
.
registerHandler
(
signal
.
SIGTERM
,
sys
.
exit
)
else
:
import
warnings
warnings
.
warn
(
"zope4py3: SignalHandling not implemented!"
)
if
args
.
timerserver_interval
:
if
args
.
timerserver_interval
:
import
Products.TimerService
import
Products.TimerService
...
...
product/ERP5Type/ZopePatch.py
View file @
ae3fe621
...
@@ -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,7 +93,9 @@ from Products.ERP5Type.patches import SourceCodeEditorZMI
...
@@ -89,7 +93,9 @@ 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
if
six
.
PY2
:
# No ZServer, so no webdav
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
from
Products.ERP5Type.patches
import
CMFCoreUtils
from
Products.ERP5Type.patches
import
CMFCoreUtils
...
@@ -97,7 +103,9 @@ from Products.ERP5Type.patches import ZopePageTemplate
...
@@ -97,7 +103,9 @@ 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
...
...
product/Localizer/patches.py
View file @
ae3fe621
...
@@ -21,13 +21,12 @@ This is a hotfix, it dynamically applies several patches to Zope.
...
@@ -21,13 +21,12 @@ This is a hotfix, it dynamically applies several patches to Zope.
# Import from the Standard Library
# Import from the Standard Library
import
logging
import
logging
import
os
import
os
import
six
# Import from itools
# Import from itools
from
.itools.i18n
import
AcceptLanguageType
from
.itools.i18n
import
AcceptLanguageType
# Import from Zope
# Import from Zope
import
Globals
from
ZPublisher
import
Publish
from
ZPublisher.HTTPRequest
import
HTTPRequest
from
ZPublisher.HTTPRequest
import
HTTPRequest
from
zope.globalrequest
import
clearRequest
,
setRequest
from
zope.globalrequest
import
clearRequest
,
setRequest
from
zope.globalrequest
import
getRequest
as
get_request
from
zope.globalrequest
import
getRequest
as
get_request
...
@@ -68,17 +67,20 @@ def get_new_publish(zope_publish):
...
@@ -68,17 +67,20 @@ def get_new_publish(zope_publish):
if
patch
is
False
:
if
patch
is
False
:
patch
=
True
if
six
.
PY2
:
# ZServer-specific patch
logger
.
info
(
'Install "Globals.get_request".'
)
logger
.
info
(
'Install "Globals.get_request".'
)
# Apply the patch
# Apply the patch
from
ZPublisher
import
Publish
Publish
.
publish
=
get_new_publish
(
Publish
.
publish
)
Publish
.
publish
=
get_new_publish
(
Publish
.
publish
)
patch
=
True
# Add to Globals for backwards compatibility
# Add to Globals for backwards compatibility
import
Globals
Globals
.
get_request
=
get_request
Globals
.
get_request
=
get_request
# PATCH 2: Accept
# PATCH 2: Accept
#
#
# Adds the variable AcceptLanguage to the REQUEST. It provides a higher
# Adds the variable AcceptLanguage to the REQUEST. It provides a higher
...
...
product/TimerService/timerserver/__init__.py
View file @
ae3fe621
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment