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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
d46093c8
Commit
d46093c8
authored
Oct 07, 2022
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py2/py3: modernize -f imports_six.
parent
0a7f2aab
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
31 additions
and
28 deletions
+31
-28
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_disableLoyaltyReward.py
...rp5_advanced_ecommerce/WebSection_disableLoyaltyReward.py
+2
-2
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_enableLoyaltyReward.py
...erp5_advanced_ecommerce/WebSection_enableLoyaltyReward.py
+2
-2
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OOoDocument.py
...mplateItem/portal_components/document.erp5.OOoDocument.py
+1
-1
bt5/erp5_base/ModuleComponentTemplateItem/portal_components/module.erp5.ImageUtil.py
...ntTemplateItem/portal_components/module.erp5.ImageUtil.py
+2
-2
bt5/erp5_data_notebook/ExtensionTemplateItem/portal_components/extension.erp5.JupyterCompile.py
...teItem/portal_components/extension.erp5.JupyterCompile.py
+3
-3
bt5/erp5_data_protection/ExtensionTemplateItem/portal_components/extension.erp5.DataProtectionRequestUtils.py
...l_components/extension.erp5.DataProtectionRequestUtils.py
+1
-1
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentManagement.py
...em/portal_components/extension.erp5.DocumentManagement.py
+2
-0
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
...ortal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
+1
-1
bt5/erp5_safeimage/ExtensionTemplateItem/portal_components/extension.erp5.ERP5ZoomifyImage.py
...Item/portal_components/extension.erp5.ERP5ZoomifyImage.py
+1
-1
bt5/erp5_web/ExtensionTemplateItem/portal_components/extension.erp5.WebUtility.py
...mplateItem/portal_components/extension.erp5.WebUtility.py
+1
-1
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebSection_renderDefaultPageAsGadget.py
...5_web_renderjs_ui/WebSection_renderDefaultPageAsGadget.py
+1
-1
bt5/erp5_web_shacache/ExtensionTemplateItem/portal_components/extension.erp5.ShaCache.py
...TemplateItem/portal_components/extension.erp5.ShaCache.py
+2
-2
bt5/erp5_wechat_secure_payment/DocumentTemplateItem/portal_components/document.erp5.WechatService.py
...lateItem/portal_components/document.erp5.WechatService.py
+1
-1
product/ERP5/bin/bigfile_client_example.py
product/ERP5/bin/bigfile_client_example.py
+2
-2
product/ERP5OOo/__init__.py
product/ERP5OOo/__init__.py
+1
-0
product/Zelenium/scripts/tinyWebClient.py
product/Zelenium/scripts/tinyWebClient.py
+2
-2
product/Zelenium/scripts/tinyWebServer.py
product/Zelenium/scripts/tinyWebServer.py
+6
-6
No files found.
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_disableLoyaltyReward.py
View file @
d46093c8
from
url
parse
import
urlparse
from
url
parse
import
parse_qsl
from
six.moves.urllib.
parse
import
urlparse
from
six.moves.urllib.
parse
import
parse_qsl
context
.
REQUEST
.
RESPONSE
.
setCookie
(
"loyalty_reward"
,
"disable"
,
path
=
'/'
)
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_enableLoyaltyReward.py
View file @
d46093c8
from
url
parse
import
urlparse
from
url
parse
import
parse_qsl
from
six.moves.urllib.
parse
import
urlparse
from
six.moves.urllib.
parse
import
parse_qsl
context
.
REQUEST
.
RESPONSE
.
setCookie
(
"loyalty_reward"
,
"enable"
,
path
=
'/'
)
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OOoDocument.py
View file @
d46093c8
...
...
@@ -151,7 +151,7 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
return []
def cached_getTargetFormatItemList(content_type):
from
xmlrpclib
import Fault
from
six.moves.xmlrpc_client
import Fault
server_proxy = DocumentConversionServerProxy(self)
try:
allowed_target_item_list = server_proxy.getAllowedTargetItemList(
...
...
bt5/erp5_base/ModuleComponentTemplateItem/portal_components/module.erp5.ImageUtil.py
View file @
d46093c8
...
...
@@ -26,7 +26,7 @@
#
##############################################################################
import
urllib2
import
six.moves.urllib.request
from
lxml
import
etree
from
erp5.component.document.Document
import
ConversionError
import
base64
...
...
@@ -36,7 +36,7 @@ SVG_DEFAULT_NAMESPACE = "http://www.w3.org/2000/svg"
def
getDataURI
(
url
):
try
:
data
=
urllib2
.
urlopen
(
url
)
data
=
six
.
moves
.
urllib
.
request
.
urlopen
(
url
)
except
Exception
as
e
:
raise
ConversionError
(
"Error to transform url (%s) into data uri. ERROR = %s"
%
(
url
,
Exception
(
e
)))
return
'data:%s;base64,%s'
%
(
data
.
info
()[
"content-type"
],
...
...
bt5/erp5_data_notebook/ExtensionTemplateItem/portal_components/extension.erp5.JupyterCompile.py
View file @
d46093c8
...
...
@@ -6,7 +6,7 @@ from six.moves import cStringIO as StringIO
from
erp5.portal_type
import
Image
from
types
import
ModuleType
from
ZODB.serialize
import
ObjectWriter
import
cPickle
import
six.moves.
cPickle
import
sys
import
traceback
import
ast
...
...
@@ -589,7 +589,7 @@ def canSerialize(obj):
# for example: if the user defines a dict with an object of a class
# that he created the dump will stil work, but the load will fail.
try
:
cPickle
.
loads
(
cPickle
.
dumps
(
obj
))
six
.
moves
.
cPickle
.
loads
(
six
.
moves
.
cPickle
.
dumps
(
obj
))
# By unknowing reasons, trying to catch cPickle.PicklingError in the "normal"
# way isn't working. This issue might be related to some weirdness in
# pickle/cPickle that is reported in this issue: http://bugs.python.org/issue1457119.
...
...
@@ -599,7 +599,7 @@ def canSerialize(obj):
#
# Even though the issue seems complicated, this quickfix should be
# properly rewritten in a better way as soon as possible.
except
(
cPickle
.
PicklingError
,
TypeError
,
NameError
,
AttributeError
):
except
(
six
.
moves
.
cPickle
.
PicklingError
,
TypeError
,
NameError
,
AttributeError
):
return
False
else
:
return
True
...
...
bt5/erp5_data_protection/ExtensionTemplateItem/portal_components/extension.erp5.DataProtectionRequestUtils.py
View file @
d46093c8
...
...
@@ -28,7 +28,7 @@
##############################################################################
from
Products.ERP5Form.FormBox
import
FormBox
from
url
parse
import
urlparse
from
six.moves.urllib.
parse
import
urlparse
def
Base_updatePropertyMapListWithFieldLabel
(
self
,
property_map_list
):
"""Try to get the title of field which edit the given inside property_map_list
...
...
bt5/erp5_dms/ExtensionTemplateItem/portal_components/extension.erp5.DocumentManagement.py
View file @
d46093c8
...
...
@@ -26,6 +26,8 @@
##############################################################################
import
re
def
getLastWorkflowDate
(
self
,
state_name
=
'simulation_state'
,
state
=
(
'released'
,
'public'
)):
'''we can make something more generic out of it
or JP says "there is an API for it" and we trash this one'''
...
...
bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_tryToConvertToBaseFormat.py
View file @
d46093c8
from
erp5.component.document.Document
import
ConversionError
from
erp5.component.module.Log
import
log
from
ZODB.POSException
import
ConflictError
from
xmlrpclib
import
Fault
from
six.moves.xmlrpc_client
import
Fault
from
socket
import
error
as
SocketError
message
=
None
...
...
bt5/erp5_safeimage/ExtensionTemplateItem/portal_components/extension.erp5.ERP5ZoomifyImage.py
View file @
d46093c8
...
...
@@ -28,7 +28,7 @@ try:
except
ImportError
:
# BBB Zope2
from
Globals
import
package_home
import
PIL.Image
as
PIL_Image
import
thread
import
six.moves._
thread
import
random
import
base64
from
OFS.Folder
import
Folder
...
...
bt5/erp5_web/ExtensionTemplateItem/portal_components/extension.erp5.WebUtility.py
View file @
d46093c8
...
...
@@ -25,7 +25,7 @@
#
##############################################################################
from
HTMLP
arser
import
HTMLParser
from
six.moves.html_p
arser
import
HTMLParser
class
HtmlParseHelper
(
HTMLParser
):
"""
Listens to all the HTMLParser methods and push results in a list of tuple.
...
...
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui/WebSection_renderDefaultPageAsGadget.py
View file @
d46093c8
import
json
import
re
from
url
parse
import
urljoin
from
six.moves.urllib.
parse
import
urljoin
if
REQUEST
is
None
:
REQUEST
=
context
.
REQUEST
...
...
bt5/erp5_web_shacache/ExtensionTemplateItem/portal_components/extension.erp5.ShaCache.py
View file @
d46093c8
...
...
@@ -27,7 +27,7 @@
##############################################################################
import
hashlib
,
httplib
import
hashlib
,
six
.
moves
.
http_client
from
Products.ERP5Type.UnrestrictedMethod
import
super_user
...
...
@@ -110,6 +110,6 @@ def WebSite_viewAsWebPost(self, *args, **kwargs):
# security check should be done already.
document
.
publish
()
self
.
REQUEST
.
RESPONSE
.
setStatus
(
httplib
.
CREATED
)
self
.
REQUEST
.
RESPONSE
.
setStatus
(
six
.
moves
.
http_client
.
CREATED
)
return
sha512sum
bt5/erp5_wechat_secure_payment/DocumentTemplateItem/portal_components/document.erp5.WechatService.py
View file @
d46093c8
...
...
@@ -4,7 +4,7 @@ from Products.ERP5Type import Permissions, PropertySheet
from
Products.ERP5Type.XMLObject
import
XMLObject
from
zLOG
import
LOG
,
WARNING
import
random
,
string
,
hashlib
,
urllib2
,
socket
from
url
parse
import
urlparse
from
six.moves.urllib.
parse
import
urlparse
from
six
import
string_types
as
basestring
try
:
import
xml.etree.cElementTree
as
ET
...
...
product/ERP5/bin/bigfile_client_example.py
View file @
d46093c8
input_file
=
open
(
'big_file.log'
,
'r'
)
import
httplib
connection
=
httplib
.
HTTPConnection
(
'192.168.242.68:12001'
)
import
six.moves.http_client
connection
=
six
.
moves
.
http_client
.
HTTPConnection
(
'192.168.242.68:12001'
)
import
base64
base64string
=
base64
.
encodestring
(
'zope:insecure'
)[:
-
1
]
...
...
product/ERP5OOo/__init__.py
View file @
d46093c8
...
...
@@ -67,4 +67,5 @@ def initialize( context ):
# allow import of various exceptions in restricted environment
# so we can catch them in ZODB scripts and inform user nicely
allow_module
(
'xmlrpclib.Fault'
)
allow_module
(
'six.moves.xmlrpc_client'
)
allow_module
(
'socket.error'
)
product/Zelenium/scripts/tinyWebClient.py
View file @
d46093c8
import
sys
import
httplib
import
six.moves.http_client
if
(
len
(
sys
.
argv
)
!=
5
):
print
(
"usage tinyWebClient.py host port method path"
)
...
...
@@ -11,6 +11,6 @@ else:
info
=
(
host
,
port
)
print
(
"%s:%s"
%
info
)
conn
=
httplib
.
HTTPConnection
(
"%s:%s"
%
info
)
conn
=
six
.
moves
.
http_client
.
HTTPConnection
(
"%s:%s"
%
info
)
conn
.
request
(
method
,
path
)
print
(
conn
.
getresponse
().
msg
)
product/Zelenium/scripts/tinyWebServer.py
View file @
d46093c8
...
...
@@ -18,15 +18,15 @@
# cgi-bin directory serves Python CGIs.
from
__future__
import
print_function
import
BaseHTTPServer
import
CGIHTTPServer
import
six.moves.
BaseHTTPServer
import
six.moves.
CGIHTTPServer
import
time
import
httplib
import
six.moves.http_client
import
sys
PORT
=
8000
class
HTTPHandler
(
CGIHTTPServer
.
CGIHTTPRequestHandler
):
class
HTTPHandler
(
six
.
moves
.
CGIHTTPServer
.
CGIHTTPRequestHandler
):
"""
Simple Web Server that can handle query strings in a request URL and
can be stopped with a request
...
...
@@ -48,7 +48,7 @@ class HTTPHandler(CGIHTTPServer.CGIHTTPRequestHandler):
time
.
sleep
(
0.3
)
# Carry on with the rest of the processing...
CGIHTTPServer
.
CGIHTTPRequestHandler
.
do_GET
(
self
)
six
.
moves
.
CGIHTTPServer
.
CGIHTTPRequestHandler
.
do_GET
(
self
)
def
do_QUIT
(
self
):
self
.
send_response
(
200
)
...
...
@@ -61,7 +61,7 @@ if __name__ == '__main__':
port
=
int
(
sys
.
argv
[
1
])
server_address
=
(
''
,
port
)
httpd
=
BaseHTTPServer
.
HTTPServer
(
server_address
,
HTTPHandler
)
httpd
=
six
.
moves
.
BaseHTTPServer
.
HTTPServer
(
server_address
,
HTTPHandler
)
print
(
"serving at port"
,
port
)
print
(
"To run the entire JsUnit test suite, open"
)
...
...
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