Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
26c19c8a
Commit
26c19c8a
authored
Jul 02, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #2256.
parent
5c29ffa8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
22 deletions
+28
-22
lib/python/OFS/Uninstalled.py
lib/python/OFS/Uninstalled.py
+28
-22
No files found.
lib/python/OFS/Uninstalled.py
View file @
26c19c8a
...
...
@@ -88,8 +88,11 @@ Objects for packages that have been uninstalled.
import
string
,
SimpleItem
,
Globals
,
Acquisition
from
Acquisition
import
Acquired
import
Persistence
from
thread
import
allocate_lock
from
zLOG
import
LOG
,
WARNING
broken_klasses
=
{}
broken_klasses_lock
=
allocate_lock
()
class
BrokenClass
(
Acquisition
.
Explicit
,
SimpleItem
.
Item
,
Persistence
.
Overridable
):
...
...
@@ -117,16 +120,17 @@ class BrokenClass(Acquisition.Explicit, SimpleItem.Item,
manage_workspace
=
manage
def
Broken
(
self
,
oid
,
klass
):
if
broken_klasses
.
has_key
(
klass
):
klass
=
broken_klasses
[
klass
]
def
Broken
(
self
,
oid
,
pair
):
broken_klasses_lock
.
acquire
()
try
:
if
broken_klasses
.
has_key
(
pair
):
klass
=
broken_klasses
[
pair
]
else
:
module
,
klass
=
klass
module
,
klassname
=
pair
d
=
{
'BrokenClass'
:
BrokenClass
}
exec
(
"class %s(BrokenClass): ' '; __module__=%s"
%
(
klass
,
`module`
))
in
d
broken_klasses
[
klass
]
=
d
[
klass
]
klass
=
d
[
klass
]
%
(
klassname
,
`module`
))
in
d
klass
=
broken_klasses
[
pair
]
=
d
[
klassname
]
module
=
string
.
split
(
module
,
'.'
)
if
len
(
module
)
>
2
and
module
[
0
]
==
'Products'
:
klass
.
product_name
=
module
[
1
]
...
...
@@ -137,10 +141,12 @@ def Broken(self, oid, klass):
klass
.
info
=
(
'This object
\
'
s class was %s in module %s.'
%
(
klass
.
__name__
,
klass
.
__module__
))
LOG
(
'ZODB'
,
WARNING
,
'Could not import class %s '
'from module %s'
%
(
`klass.__name__`
,
`klass.__module__`
))
finally
:
broken_klasses_lock
.
release
()
if
oid
is
None
:
return
klass
i
=
klass
()
i
.
_p_oid
=
oid
i
.
_p_jar
=
self
return
i
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