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
0b9fe0e6
Commit
0b9fe0e6
authored
Feb 08, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
persistent_migration: py3
parent
8c019d80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
product/ERP5Type/dynamic/persistent_migration.py
product/ERP5Type/dynamic/persistent_migration.py
+8
-2
No files found.
product/ERP5Type/dynamic/persistent_migration.py
View file @
0b9fe0e6
...
@@ -42,6 +42,9 @@ from persistent import Persistent, wref
...
@@ -42,6 +42,9 @@ from persistent import Persistent, wref
from
ZODB.serialize
import
ObjectWriter
,
ObjectReader
from
ZODB.serialize
import
ObjectWriter
,
ObjectReader
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Base
import
Base
,
TempBase
,
WorkflowMethod
from
Products.ERP5Type.Base
import
Base
,
TempBase
,
WorkflowMethod
from
zodbpickle
import
binary
import
six
log
=
logging
.
getLogger
(
'ERP5Type'
)
log
=
logging
.
getLogger
(
'ERP5Type'
)
log
.
trace
=
lambda
*
args
,
**
kw
:
log
.
log
(
5
,
*
args
,
**
kw
)
log
.
trace
=
lambda
*
args
,
**
kw
:
log
.
log
(
5
,
*
args
,
**
kw
)
...
@@ -96,7 +99,6 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
...
@@ -96,7 +99,6 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
if
_setOb
:
if
_setOb
:
if
isinstance
(
_setOb
,
WorkflowMethod
):
if
isinstance
(
_setOb
,
WorkflowMethod
):
_setOb
=
_setOb
.
_m
_setOb
=
_setOb
.
_m
import
six
if
six
.
get_unbound_function
(
_setOb
)
is
six
.
get_unbound_function
(
OFS_Folder
.
_setOb
):
if
six
.
get_unbound_function
(
_setOb
)
is
six
.
get_unbound_function
(
OFS_Folder
.
_setOb
):
self
.
lazy
=
Ghost
self
.
lazy
=
Ghost
elif
klass
.
__module__
[:
7
]
==
'BTrees.'
and
klass
.
__name__
!=
'Length'
:
elif
klass
.
__module__
[:
7
]
==
'BTrees.'
and
klass
.
__name__
!=
'Length'
:
...
@@ -113,8 +115,12 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
...
@@ -113,8 +115,12 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
self
.
do_migrate
=
args
!=
(
klass
.
__module__
,
klass
.
__name__
)
and
\
self
.
do_migrate
=
args
!=
(
klass
.
__module__
,
klass
.
__name__
)
and
\
not
isOldBTree
(
'%s.%s'
%
args
)
not
isOldBTree
(
'%s.%s'
%
args
)
unpickler
.
find_global
=
self
.
_get_class
unpickler
.
find_global
=
self
.
_get_class
if
six
.
PY3
:
unpickler
.
find_class
=
self
.
_get_class
return
self
.
_get_class
(
*
args
)
return
self
.
_get_class
(
*
args
)
unpickler
.
find_global
=
find_global
unpickler
.
find_global
=
find_global
if
six
.
PY3
:
unpickler
.
find_class
=
find_global
unpickler
.
load
()
# class
unpickler
.
load
()
# class
state
=
unpickler
.
load
()
state
=
unpickler
.
load
()
if
isinstance
(
self
.
lazy
,
LazyPersistent
):
if
isinstance
(
self
.
lazy
,
LazyPersistent
):
...
@@ -152,7 +158,7 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
...
@@ -152,7 +158,7 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
def
persistent_id
(
self
,
obj
):
def
persistent_id
(
self
,
obj
):
assert
type
(
obj
)
is
not
Ghost
assert
type
(
obj
)
is
not
Ghost
oid
=
self
.
getOid
(
obj
)
oid
=
self
.
getOid
(
obj
)
if
type
(
oid
)
is
str
:
if
isinstance
(
oid
,
(
bytes
,
binary
))
:
try
:
try
:
return
self
.
oid_dict
[
oid
]
return
self
.
oid_dict
[
oid
]
except
KeyError
:
except
KeyError
:
...
...
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