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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
1b5cf170
Commit
1b5cf170
authored
Aug 19, 2024
by
Arnaud Fontaine
Committed by
Rafael Monnerat
Nov 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: py3: ZServer removed.
parent
c22cfd5e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
46 deletions
+5
-46
bt5/erp5_web_shacache/ExtensionTemplateItem/portal_components/extension.erp5.ShaCache.py
...TemplateItem/portal_components/extension.erp5.ShaCache.py
+3
-1
product/ERP5Type/tests/ProcessingNodeTestCase.py
product/ERP5Type/tests/ProcessingNodeTestCase.py
+2
-14
product/ERP5Type/tests/runUnitTest.py
product/ERP5Type/tests/runUnitTest.py
+0
-5
product/TimerService/timerserver/__init__.py
product/TimerService/timerserver/__init__.py
+0
-12
product/TimerService/timerserver/component.xml
product/TimerService/timerserver/component.xml
+0
-14
No files found.
bt5/erp5_web_shacache/ExtensionTemplateItem/portal_components/extension.erp5.ShaCache.py
View file @
1b5cf170
...
@@ -86,7 +86,9 @@ def File_viewAsWeb(self):
...
@@ -86,7 +86,9 @@ def File_viewAsWeb(self):
# For Pdata type, we must iterate and send chunk by chunk.
# For Pdata type, we must iterate and send chunk by chunk.
# And no need to continue if the client closed the connection.
# And no need to continue if the client closed the connection.
while
data
and
not
RESPONSE
.
stdout
.
_channel
.
closed
:
while
data
:
if
six
.
PY2
and
RESPONSE
.
stdout
.
_channel
.
closed
:
break
# Send data to the client.
# Send data to the client.
RESPONSE
.
write
(
data
.
data
)
RESPONSE
.
write
(
data
.
data
)
# Load next object without keeping previous chunks in memory.
# Load next object without keeping previous chunks in memory.
...
...
product/ERP5Type/tests/ProcessingNodeTestCase.py
View file @
1b5cf170
...
@@ -8,7 +8,6 @@ if six.PY2:
...
@@ -8,7 +8,6 @@ if six.PY2:
from
UserDict
import
IterableUserDict
as
UserDict
from
UserDict
import
IterableUserDict
as
UserDict
else
:
else
:
from
collections
import
UserDict
from
collections
import
UserDict
import
Lifetime
import
transaction
import
transaction
from
Testing
import
ZopeTestCase
from
Testing
import
ZopeTestCase
from
zope.globalrequest
import
setRequest
from
zope.globalrequest
import
setRequest
...
@@ -152,14 +151,6 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
...
@@ -152,14 +151,6 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
"""
"""
_server_address
=
None
# (host, port) of the http server if it was started, None otherwise
_server_address
=
None
# (host, port) of the http server if it was started, None otherwise
@
staticmethod
def
asyncore_loop
():
try
:
Lifetime
.
lifetime_loop
()
except
KeyboardInterrupt
:
pass
Lifetime
.
graceful_shutdown_loop
()
@
staticmethod
@
staticmethod
def
startHTTPServer
(
verbose
=
False
):
def
startHTTPServer
(
verbose
=
False
):
"""Start HTTP Server in background"""
"""Start HTTP Server in background"""
...
@@ -316,9 +307,6 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
...
@@ -316,9 +307,6 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
ZopeTestCase
.
_print
(
' %i'
%
message_count
)
ZopeTestCase
.
_print
(
' %i'
%
message_count
)
old_message_count
=
message_count
old_message_count
=
message_count
portal_activities
.
process_timer
(
None
,
None
)
portal_activities
.
process_timer
(
None
,
None
)
if
Lifetime
.
_shutdown_phase
:
# XXX CMFActivity contains bare excepts
raise
KeyboardInterrupt
message_list
=
getMessageList
()
message_list
=
getMessageList
()
message_count
=
len
(
message_list
)
message_count
=
len
(
message_list
)
if
time
.
time
()
>=
deadline
or
message_count
and
any
(
x
.
processing_node
==
-
2
if
time
.
time
()
>=
deadline
or
message_count
and
any
(
x
.
processing_node
==
-
2
...
@@ -387,7 +375,7 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
...
@@ -387,7 +375,7 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
"""Main loop for nodes that process activities"""
"""Main loop for nodes that process activities"""
setRequest
(
self
.
app
.
REQUEST
)
setRequest
(
self
.
app
.
REQUEST
)
try
:
try
:
while
not
Lifetime
.
_shutdown_phas
e
:
while
Tru
e
:
time
.
sleep
(.
3
)
time
.
sleep
(.
3
)
transaction
.
begin
()
transaction
.
begin
()
try
:
try
:
...
@@ -419,7 +407,7 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
...
@@ -419,7 +407,7 @@ class ProcessingNodeTestCase(ZopeTestCase.TestCase):
timerserver_thread
=
None
timerserver_thread
=
None
try
:
try
:
while
not
Lifetime
.
_shutdown_phas
e
:
while
Tru
e
:
time
.
sleep
(.
3
)
time
.
sleep
(.
3
)
transaction
.
begin
()
transaction
.
begin
()
try
:
try
:
...
...
product/ERP5Type/tests/runUnitTest.py
View file @
1b5cf170
...
@@ -474,9 +474,6 @@ class DebugTestResult:
...
@@ -474,9 +474,6 @@ class DebugTestResult:
self
.
result
=
result
self
.
result
=
result
def
_start_debugger
(
self
,
tb
):
def
_start_debugger
(
self
,
tb
):
import
Lifetime
if
Lifetime
.
_shutdown_phase
:
return
try
:
try
:
# try ipython if available
# try ipython if available
import
IPython
import
IPython
...
@@ -646,11 +643,9 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
...
@@ -646,11 +643,9 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
TestRunner
=
unittest
.
TextTestRunner
TestRunner
=
unittest
.
TextTestRunner
import
Lifetime
from
Zope2.custom_zodb
import
Storage
,
save_mysql
,
\
from
Zope2.custom_zodb
import
Storage
,
save_mysql
,
\
node_pid_list
,
neo_cluster
,
zeo_server_pid
,
wcfs_server
node_pid_list
,
neo_cluster
,
zeo_server_pid
,
wcfs_server
def
shutdown
(
signum
,
frame
,
signum_set
=
set
()):
def
shutdown
(
signum
,
frame
,
signum_set
=
set
()):
Lifetime
.
shutdown
(
0
)
signum_set
.
add
(
signum
)
signum_set
.
add
(
signum
)
if
node_pid_list
is
None
and
len
(
signum_set
)
>
1
:
if
node_pid_list
is
None
and
len
(
signum_set
)
>
1
:
# in case of ^C, a child should also receive a SIGHUP from the parent,
# in case of ^C, a child should also receive a SIGHUP from the parent,
...
...
product/TimerService/timerserver/__init__.py
View file @
1b5cf170
import
six
if
six
.
PY2
:
from
ZServer.datatypes
import
ServerFactory
class
TimerServerFactory
(
ServerFactory
):
def
__init__
(
self
,
section
):
ServerFactory
.
__init__
(
self
)
self
.
interval
=
section
.
interval
def
create
(
self
):
from
.TimerServer
import
TimerServer
return
TimerServer
(
self
.
module
,
self
.
interval
)
product/TimerService/timerserver/component.xml
deleted
100644 → 0
View file @
c22cfd5e
<component>
<import
package=
"ZServer"
/>
<sectiontype
name=
"timer-server"
datatype=
"Products.TimerService.timerserver.TimerServerFactory"
implements=
"ZServer.server"
>
<key
name=
"interval"
datatype=
"float"
default=
"600"
>
<description>
Interval in seconds. Supports fractions of a second.
</description>
</key>
</sectiontype>
</component>
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