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
142
Merge Requests
142
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
1d916974
Commit
1d916974
authored
Apr 30, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: prevent DeprecationWarning with inspect.getargspec
parent
ebb18881
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
product/ERP5Type/Utils.py
product/ERP5Type/Utils.py
+5
-1
product/ERP5Type/XMLExportImport/__init__.py
product/ERP5Type/XMLExportImport/__init__.py
+5
-2
product/ERP5Type/patches/MailHost.py
product/ERP5Type/patches/MailHost.py
+10
-3
No files found.
product/ERP5Type/Utils.py
View file @
1d916974
...
...
@@ -440,7 +440,11 @@ def fill_args_from_request(*optional_args):
required by the method.
"""
def
decorator
(
wrapped
):
names
=
inspect
.
getargspec
(
wrapped
)[
0
]
if
six
.
PY3
:
getfullargspec
=
inspect
.
getfullargspec
else
:
getfullargspec
=
inspect
.
getargspec
names
=
getfullargspec
(
wrapped
)[
0
]
assert
names
[:
2
]
==
[
'self'
,
'REQUEST'
]
del
names
[:
2
]
names
+=
optional_args
...
...
product/ERP5Type/XMLExportImport/__init__.py
View file @
1d916974
...
...
@@ -241,7 +241,10 @@ from ZODB.ExportImport import TemporaryFile, export_end_marker
from
ZODB.utils
import
p64
from
ZODB.utils
import
u64
from
functools
import
partial
from
inspect
import
getargspec
if
six
.
PY2
:
from
inspect
import
getargspec
as
getfullargspec
else
:
from
inspect
import
getfullargspec
from
OFS
import
ObjectManager
from
.
import
ppml
...
...
@@ -328,7 +331,7 @@ def exportXML(jar, oid, file=None):
# can have values that have a shorter representation in 'repr' instead of
# 'base64' (see ppml.convert) and ppml.String does not support this.
load
=
jar
.
_storage
.
load
if
'version'
in
getargspec
(
load
).
args
:
# BBB: ZODB<5 (TmpStore)
if
'version'
in
get
full
argspec
(
load
).
args
:
# BBB: ZODB<5 (TmpStore)
load
=
partial
(
load
,
version
=
''
)
pickle_dict
=
{
oid
:
None
}
max_cache
=
[
1e7
]
# do not cache more than 10MB of pickle data
...
...
product/ERP5Type/patches/MailHost.py
View file @
1d916974
...
...
@@ -18,13 +18,20 @@ Change default behaviour of MailHost to send mails immediately.
In ERP5, we have Activity Tool to postpone mail delivery.
"""
from
inspect
import
getargspec
,
isfunction
from
Products.MailHost.MailHost
import
MailBase
from
inspect
import
isfunction
import
six
if
six
.
PY3
:
from
inspect
import
getfullargspec
else
:
from
inspect
import
getargspec
as
getfullargspec
from
Products.MailHost.MailHost
import
MailBase
for
f
in
six
.
itervalues
(
MailBase
.
__dict__
):
if
isfunction
(
f
):
args
,
_
,
_
,
defaults
=
getargspec
(
f
)
argspec
=
getfullargspec
(
f
)
args
=
argspec
.
args
defaults
=
argspec
.
defaults
try
:
i
=
args
.
index
(
'immediate'
)
-
len
(
args
)
except
ValueError
:
...
...
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