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
df64f044
Commit
df64f044
authored
Apr 29, 2022
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Python2-only, check on Python3.
parent
569729fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
product/ERP5Type/Tool/MemcachedTool.py
product/ERP5Type/Tool/MemcachedTool.py
+0
-2
product/ERP5Type/patches/ExternalMethod.py
product/ERP5Type/patches/ExternalMethod.py
+6
-4
No files found.
product/ERP5Type/Tool/MemcachedTool.py
View file @
df64f044
...
@@ -59,8 +59,6 @@ def encodeKey(key):
...
@@ -59,8 +59,6 @@ def encodeKey(key):
"""
"""
# According to the memcached's protocol.txt, the key cannot contain
# According to the memcached's protocol.txt, the key cannot contain
# control characters and white spaces.
# control characters and white spaces.
if
isinstance
(
key
,
str
):
key
=
key
.
encode
()
return
encodestring
(
key
,
True
).
replace
(
b'
\
n
'
,
b''
).
replace
(
b'
\
r
'
,
b''
)
return
encodestring
(
key
,
True
).
replace
(
b'
\
n
'
,
b''
).
replace
(
b'
\
r
'
,
b''
)
if
memcache
is
not
None
:
if
memcache
is
not
None
:
...
...
product/ERP5Type/patches/ExternalMethod.py
View file @
df64f044
...
@@ -26,7 +26,7 @@ class _(PatchClass(ExternalMethod)):
...
@@ -26,7 +26,7 @@ class _(PatchClass(ExternalMethod)):
reloadIfChanged
=
getFuncDefaults
=
getFuncCode
=
filepath
=
None
reloadIfChanged
=
getFuncDefaults
=
getFuncCode
=
filepath
=
None
@
property
@
property
def
func_defaults
(
self
):
def
__defaults__
(
self
):
"""Return a tuple of default values.
"""Return a tuple of default values.
The first value is for the "second" parameter (self is ommited)
The first value is for the "second" parameter (self is ommited)
...
@@ -35,10 +35,12 @@ class _(PatchClass(ExternalMethod)):
...
@@ -35,10 +35,12 @@ class _(PatchClass(ExternalMethod)):
will have func_defaults = ('', )
will have func_defaults = ('', )
"""
"""
return
self
.
_getFunction
()[
1
]
return
self
.
_getFunction
()[
1
]
func_defaults
=
__defaults__
@
property
@
property
def
func_code
(
self
):
def
__code__
(
self
):
return
self
.
_getFunction
()[
2
]
return
self
.
_getFunction
()[
2
]
func_code
=
__code__
@
property
@
property
def
func_args
(
self
):
def
func_args
(
self
):
...
@@ -80,7 +82,7 @@ class _(PatchClass(ExternalMethod)):
...
@@ -80,7 +82,7 @@ class _(PatchClass(ExternalMethod)):
return
_f
return
_f
except
AttributeError
:
except
AttributeError
:
pass
pass
code
=
f
.
__code__
code
=
f
.
func_code
argument_object
=
getargs
(
code
)
argument_object
=
getargs
(
code
)
# reconstruct back the original names
# reconstruct back the original names
arg_list
=
argument_object
.
args
[:]
arg_list
=
argument_object
.
args
[:]
...
@@ -95,7 +97,7 @@ class _(PatchClass(ExternalMethod)):
...
@@ -95,7 +97,7 @@ class _(PatchClass(ExternalMethod)):
i
+=
has_self
i
+=
has_self
if
i
:
if
i
:
code
=
FuncCode
(
ff
,
i
)
code
=
FuncCode
(
ff
,
i
)
self
.
_v_f
=
_f
=
(
f
,
f
.
__defaults__
,
code
,
has_self
,
arg_list
)
self
.
_v_f
=
_f
=
(
f
,
f
.
func_defaults
,
code
,
has_self
,
arg_list
)
return
_f
return
_f
def
__call__
(
self
,
*
args
,
**
kw
):
def
__call__
(
self
,
*
args
,
**
kw
):
...
...
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