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
141
Merge Requests
141
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
2bb09f1c
Commit
2bb09f1c
authored
Apr 21, 2024
by
Jérome Perrin
Committed by
Arnaud Fontaine
Jul 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dqe: fix python3 compatibility
parent
7b46dd5d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
bt5/erp5_dqe/DocumentTemplateItem/portal_components/document.erp5.DQEDataValidatorClientConnector.py
...mponents/document.erp5.DQEDataValidatorClientConnector.py
+4
-4
bt5/erp5_dqe/SkinTemplateItem/portal_skins/erp5_dqe/HTTPExchange_getSentToDQEValueCaption.py
...l_skins/erp5_dqe/HTTPExchange_getSentToDQEValueCaption.py
+2
-2
No files found.
bt5/erp5_dqe/DocumentTemplateItem/portal_components/document.erp5.DQEDataValidatorClientConnector.py
View file @
2bb09f1c
import
requests
import
requests
from
json
import
loads
from
json
import
loads
from
socket
import
timeout
from
socket
import
timeout
from
requests
import
ConnectionError
,
Timeout
from
requests
import
ConnectionError
as
_ConnectionError
,
Timeout
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.XMLObject
import
XMLObject
from
urllib
import
urlencode
from
six.moves
import
urllib
from
zLOG
import
LOG
,
INFO
from
zLOG
import
LOG
,
INFO
class
DQEDataValidatorClientConnector
(
XMLObject
):
class
DQEDataValidatorClientConnector
(
XMLObject
):
...
@@ -23,7 +23,7 @@ class DQEDataValidatorClientConnector(XMLObject):
...
@@ -23,7 +23,7 @@ class DQEDataValidatorClientConnector(XMLObject):
try
:
try
:
base_url
=
self
.
getServerUrl
()
+
method_name
+
'/'
base_url
=
self
.
getServerUrl
()
+
method_name
+
'/'
response
=
requests
.
get
(
base_url
,
params
=
params
,
timeout
=
self
.
getTimeout
())
response
=
requests
.
get
(
base_url
,
params
=
params
,
timeout
=
self
.
getTimeout
())
except
(
Timeout
,
timeout
,
ConnectionError
):
except
(
Timeout
,
timeout
,
_
ConnectionError
):
raw_response
=
'TIMEOUT'
raw_response
=
'TIMEOUT'
result_dict
=
{}
result_dict
=
{}
else
:
else
:
...
@@ -41,7 +41,7 @@ class DQEDataValidatorClientConnector(XMLObject):
...
@@ -41,7 +41,7 @@ class DQEDataValidatorClientConnector(XMLObject):
archiveExchange
=
self
.
_getTypeBasedMethod
(
'archiveExchange'
)
archiveExchange
=
self
.
_getTypeBasedMethod
(
'archiveExchange'
)
if
archiveExchange
is
not
None
:
if
archiveExchange
is
not
None
:
archiveExchange
(
archiveExchange
(
raw_request
=
base_url
+
'?'
+
urlencode
(
params
),
# XXX is this correct?
raw_request
=
base_url
+
'?'
+
url
lib
.
urlparse
.
url
encode
(
params
),
# XXX is this correct?
raw_response
=
raw_response
,
raw_response
=
raw_response
,
service
=
service
,
service
=
service
,
archive_kw
=
archive_kw
,
archive_kw
=
archive_kw
,
...
...
bt5/erp5_dqe/SkinTemplateItem/portal_skins/erp5_dqe/HTTPExchange_getSentToDQEValueCaption.py
View file @
2bb09f1c
import
urlparse
from
six.moves
import
urllib
resource_value
=
context
.
getResourceValue
()
resource_value
=
context
.
getResourceValue
()
if
not
resource_value
.
isMemberOf
(
'http_exchange_resource/dqe'
):
if
not
resource_value
.
isMemberOf
(
'http_exchange_resource/dqe'
):
...
@@ -7,7 +7,7 @@ if not resource_value.isMemberOf('http_exchange_resource/dqe'):
...
@@ -7,7 +7,7 @@ if not resource_value.isMemberOf('http_exchange_resource/dqe'):
request
=
context
.
getRequest
()
request
=
context
.
getRequest
()
if
not
request
:
if
not
request
:
return
''
return
''
query_dict
=
url
parse
.
parse_qs
(
urlparse
.
urlparse
(
request
).
query
)
query_dict
=
url
lib
.
urlparse
.
parse_qs
(
urllib
.
urlparse
.
urlparse
(
request
).
query
)
dqe_resource_category
=
context
.
getPortalObject
().
portal_categories
.
http_exchange_resource
.
dqe
dqe_resource_category
=
context
.
getPortalObject
().
portal_categories
.
http_exchange_resource
.
dqe
service_value_to_key_list_dict
=
{
service_value_to_key_list_dict
=
{
dqe_resource_category
.
DefaultEmail
:
(
'Email'
,
),
dqe_resource_category
.
DefaultEmail
:
(
'Email'
,
),
...
...
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