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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
erp5
Commits
823384b2
Commit
823384b2
authored
Oct 02, 2022
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: use print() in product.
parent
8ffc50cf
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
37 additions
and
34 deletions
+37
-34
product/ERP5/bin/bigfile_client_example.py
product/ERP5/bin/bigfile_client_example.py
+1
-1
product/ERP5/tests/erp5_url_checker.py
product/ERP5/tests/erp5_url_checker.py
+5
-5
product/ERP5/tests/testInvalidationBug.py
product/ERP5/tests/testInvalidationBug.py
+2
-2
product/ERP5/tests/testXHTML.py
product/ERP5/tests/testXHTML.py
+1
-1
product/ERP5OOo/tests/test_document/TEST-en-002.py
product/ERP5OOo/tests/test_document/TEST-en-002.py
+1
-1
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
+4
-4
product/ERP5Type/tests/_testPystone.py
product/ERP5Type/tests/_testPystone.py
+1
-1
product/ERP5Type/tests/_testSQLBench.py
product/ERP5Type/tests/_testSQLBench.py
+2
-2
product/ERP5Type/tests/runTestSuite.py
product/ERP5Type/tests/runTestSuite.py
+4
-3
product/ERP5Type/tests/runUnitTest.py
product/ERP5Type/tests/runUnitTest.py
+5
-4
product/PortalTransforms/tests/test_transforms.py
product/PortalTransforms/tests/test_transforms.py
+4
-3
product/Zelenium/scripts/tinyWebClient.py
product/Zelenium/scripts/tinyWebClient.py
+3
-3
product/Zelenium/scripts/tinyWebServer.py
product/Zelenium/scripts/tinyWebServer.py
+4
-4
No files found.
product/ERP5/bin/bigfile_client_example.py
View file @
823384b2
...
...
@@ -22,7 +22,7 @@ result = connection.getresponse()
path
=
result
.
getheader
(
"X-Document-Location"
)
result
.
close
()
path
=
'/%s'
%
'/'
.
join
(
path
.
split
(
'/'
)[
3
:])
print
path
print
(
path
)
######################################
# Upload chunks
...
...
product/ERP5/tests/erp5_url_checker.py
View file @
823384b2
...
...
@@ -53,7 +53,7 @@ def main():
threads
[
len
(
threads
)
-
1
].
start
()
request_number
+=
1
i
+=
1
print
"thread: %i request: %i url: %s"
%
(
i
,
request_number
,
url
)
print
(
"thread: %i request: %i url: %s"
%
(
i
,
request_number
,
url
)
)
else
:
for
t
in
range
(
0
,
max_thread
):
if
threads
[
t
].
isAlive
()
==
0
:
...
...
@@ -63,7 +63,7 @@ def main():
threads
[
t
].
start
()
i
+=
1
request_number
+=
1
print
"thread: %i request: %i url: %s"
%
(
i
,
request_number
,
url
)
print
(
"thread: %i request: %i url: %s"
%
(
i
,
request_number
,
url
)
)
break
...
...
@@ -146,17 +146,17 @@ class Checker(URLOpener):
thread
.
start
()
while
thread
.
isAlive
():
sleep
(
0.5
)
print
"Connection to %s went fine"
%
url
print
(
"Connection to %s went fine"
%
url
)
except
IOError
as
err
:
(
errno
,
strerror
)
=
err
.
args
print
"Can't connect to %s because of I/O error(%s): %s"
%
(
url
,
errno
,
strerror
)
print
(
"Can't connect to %s because of I/O error(%s): %s"
%
(
url
,
errno
,
strerror
)
)
def
SearchUrl
(
self
,
url
=
None
):
try
:
conn
=
self
.
open_http
(
url
)
except
IOError
as
err
:
(
errno
,
strerror
)
=
err
.
args
print
"Can't connect to %s because of I/O error(%s): %s"
%
(
url
,
errno
,
strerror
)
print
(
"Can't connect to %s because of I/O error(%s): %s"
%
(
url
,
errno
,
strerror
)
)
def
raise_error
(
self
,
error_key
,
field
):
...
...
product/ERP5/tests/testInvalidationBug.py
View file @
823384b2
...
...
@@ -188,8 +188,8 @@ class TestInvalidationBug(ERP5TypeTestCase):
module
.
setIdGenerator
(
'_generatePerDayId'
)
#module.migrateToHBTree()
self
.
tic
()
print
'OID(%s) = %r'
%
(
module
.
getRelativeUrl
(),
module
.
_p_oid
)
print
' OID(_tree) = %r'
%
module
.
_tree
.
_p_oid
print
(
'OID(%s) = %r'
%
(
module
.
getRelativeUrl
(),
module
.
_p_oid
)
)
print
(
' OID(_tree) = %r'
%
module
.
_tree
.
_p_oid
)
previous
=
DateTime
()
skin_folder
=
self
.
getPortal
().
portal_skins
.
custom
if
'create_script'
in
skin_folder
.
objectIds
():
...
...
product/ERP5/tests/testXHTML.py
View file @
823384b2
...
...
@@ -748,7 +748,7 @@ if validator_to_use == 'tidy':
warning
=
False
validator_path
=
'/usr/bin/tidy'
if
not
os
.
path
.
exists
(
validator_path
):
print
'tidy is not installed at %s'
%
validator_path
print
(
'tidy is not installed at %s'
%
validator_path
)
else
:
validator
=
TidyValidator
(
validator_path
,
show_warnings
)
...
...
product/ERP5OOo/tests/test_document/TEST-en-002.py
View file @
823384b2
...
...
@@ -27,5 +27,5 @@
##############################################################################
def
say_hello
():
print
'hello'
print
(
'hello'
)
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
View file @
823384b2
...
...
@@ -435,10 +435,10 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
def
_verboseErrorLog
(
self
,
size
=
10
):
for
entry
in
self
.
portal
.
error_log
.
getLogEntries
()[:
size
]:
print
"="
*
20
print
"ERROR ID : %s"
%
entry
[
"id"
]
print
"TRACEBACK :"
print
entry
[
"tb_text"
]
print
((
"="
*
20
))
print
((
"ERROR ID : %s"
%
entry
[
"id"
]))
print
(
"TRACEBACK :"
)
print
((
entry
[
"tb_text"
]))
def
testFunctionalTestRunner
(
self
):
# Check the zuite page templates can be rendered, because selenium test
...
...
product/ERP5Type/tests/_testPystone.py
View file @
823384b2
...
...
@@ -33,4 +33,4 @@ class TestPystone(unittest.TestCase):
"""Tests to get pystone value
"""
def
test_pystone
(
self
):
print
"PYSTONE RESULT (time,score) : %r"
%
(
pystone
.
pystones
(),
)
print
((
"PYSTONE RESULT (time,score) : %r"
%
(
pystone
.
pystones
(),))
)
product/ERP5Type/tests/_testSQLBench.py
View file @
823384b2
...
...
@@ -55,11 +55,11 @@ class TestSQLBench(unittest.TestCase):
sqlbench_path
+
'/test-alter-table'
,
'--database'
,
database
,
'--host'
,
host
,
'--user'
,
user
,
'--password'
,
password
]
print
command_list
print
(
command_list
)
process
=
subprocess
.
Popen
(
command_list
,
cwd
=
sqlbench_path
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
output
,
error
=
process
.
communicate
()
self
.
assertEqual
(
0
,
len
(
error
),
error
)
print
output
print
(
output
)
self
.
assertTrue
(
output
.
find
(
"Total time: "
)
>=
0
)
product/ERP5Type/tests/runTestSuite.py
View file @
823384b2
#!/usr/bin/env python2.7
from
__future__
import
absolute_import
from
__future__
import
print_function
# six.PY2
import
argparse
,
sys
,
os
,
textwrap
from
erp5.util
import
taskdistribution
...
...
@@ -8,7 +9,7 @@ from erp5.util import taskdistribution
from
.
import
ERP5TypeTestSuite
def
_parsingErrorHandler
(
data
,
_
):
print
>>
sys
.
stderr
,
'Error parsing data:'
,
repr
(
data
)
print
(
'Error parsing data:'
,
repr
(
data
),
file
=
sys
.
stderr
)
taskdistribution
.
patchRPCParser
(
_parsingErrorHandler
)
def
makeSuite
(
...
...
@@ -119,8 +120,8 @@ def main():
args
.
zserver_frontend_url_list
.
split
(
','
)
if
args
.
zserver_frontend_url_list
else
())
if
args
.
zserver_address_list
and
len
(
args
.
zserver_address_list
)
<
args
.
node_quantity
:
print
>>
sys
.
stderr
,
'Not enough zserver address/frontends for node quantity %s (%r)'
%
(
args
.
node_quantity
,
args
.
zserver_address_list
)
print
(
'Not enough zserver address/frontends for node quantity %s (%r)'
%
(
args
.
node_quantity
,
args
.
zserver_address_list
)
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
# sanity check
...
...
product/ERP5Type/tests/runUnitTest.py
View file @
823384b2
#!/usr/bin/env python2.7
from
__future__
import
print_function
# six.PY2
import
os
import
sys
import
pdb
...
...
@@ -703,7 +704,7 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
transaction
.
commit
()
except
:
import
traceback
print
"runUnitTestList Exception : %r"
%
(
traceback
.
print_exc
(),
)
print
(
"runUnitTestList Exception : %r"
%
(
traceback
.
print_exc
(),)
)
# finally does not expect opened transaction, even in the
# case of a Ctrl-C.
transaction
.
abort
()
...
...
@@ -742,10 +743,10 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
def
usage
(
stream
,
msg
=
None
):
if
msg
:
print
>>
stream
,
msg
print
>>
stream
print
(
msg
,
file
=
stream
)
print
(
file
=
stream
)
program
=
os
.
path
.
basename
(
sys
.
argv
[
0
])
print
>>
stream
,
__doc__
%
{
"program"
:
program
}
print
(
__doc__
%
{
"program"
:
program
},
file
=
stream
)
log_directory
=
None
def
main
(
argument_list
=
None
):
...
...
product/PortalTransforms/tests/test_transforms.py
View file @
823384b2
from
__future__
import
absolute_import
from
__future__
import
print_function
# six.PY2
import
os
import
logging
from
Products.Archetypes.tests.atsitetestcase
import
ATSiteTestCase
...
...
@@ -44,8 +45,8 @@ class TransformTest(ATSiteTestCase):
output
=
open
(
output
)
except
IOError
:
import
sys
print
>>
sys
.
stderr
,
'No output file found.'
print
>>
sys
.
stderr
,
'File %s created, check it !'
%
self
.
output
print
(
'No output file found.'
,
file
=
sys
.
stderr
)
print
(
'File %s created, check it !'
%
self
.
output
,
file
=
sys
.
stderr
)
output
=
open
(
output
,
'w'
)
output
.
write
(
got
)
output
.
close
()
...
...
@@ -238,7 +239,7 @@ def make_tests(test_descr=TRANSFORMS_TESTINFO):
continue
if
TR_NAMES
is
not
None
and
not
_transform
.
name
()
in
TR_NAMES
:
print
'skip test for'
,
_transform
.
name
(
)
print
(
'skip test for'
,
_transform
.
name
()
)
continue
class
TransformTestSubclass
(
TransformTest
):
...
...
product/Zelenium/scripts/tinyWebClient.py
View file @
823384b2
...
...
@@ -2,7 +2,7 @@ import sys
import
httplib
if
(
len
(
sys
.
argv
)
!=
5
):
print
"usage tinyWebClient.py host port method path"
print
(
"usage tinyWebClient.py host port method path"
)
else
:
host
=
sys
.
argv
[
1
]
port
=
sys
.
argv
[
2
]
...
...
@@ -10,7 +10,7 @@ else:
path
=
sys
.
argv
[
4
]
info
=
(
host
,
port
)
print
"%s:%s"
%
info
print
(
"%s:%s"
%
info
)
conn
=
httplib
.
HTTPConnection
(
"%s:%s"
%
info
)
conn
.
request
(
method
,
path
)
print
conn
.
getresponse
().
msg
print
(
conn
.
getresponse
().
msg
)
product/Zelenium/scripts/tinyWebServer.py
View file @
823384b2
...
...
@@ -62,12 +62,12 @@ if __name__ == '__main__':
server_address
=
(
''
,
port
)
httpd
=
BaseHTTPServer
.
HTTPServer
(
server_address
,
HTTPHandler
)
print
"serving at port"
,
port
print
"To run the entire JsUnit test suite, open"
print
(
"serving at port"
,
port
)
print
(
"To run the entire JsUnit test suite, open"
)
print
(
" http://localhost:8000/jsunit/testRunner.html?testPage="
"http://localhost:8000/tests/JsUnitSuite.html&autoRun=true"
)
print
"To run the acceptance test suite, open"
print
" http://localhost:8000/TestRunner.html"
print
(
"To run the acceptance test suite, open"
)
print
(
" http://localhost:8000/TestRunner.html"
)
while
not
HTTPHandler
.
quitRequestReceived
:
httpd
.
handle_request
()
...
...
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