Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Kirill Smelkov
ZODB
Commits
f3283c17
Commit
f3283c17
authored
Nov 11, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
type_and_adr(): Display the oid too.
parent
bc634ac2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
NEWS.txt
NEWS.txt
+6
-0
src/BTrees/check.py
src/BTrees/check.py
+6
-2
No files found.
NEWS.txt
View file @
f3283c17
...
...
@@ -76,6 +76,12 @@ Install
The C header file ``ring.h`` is now installed.
Tools
-----
- ``BTrees.check.display()`` now displays the oids (if any) of the
BTree's or TreeSet's constituent objects.
What's new in ZODB3 3.3?
========================
...
...
src/BTrees/check.py
View file @
f3283c17
...
...
@@ -39,7 +39,7 @@ from BTrees.OIBTree import OIBTree, OIBucket, OISet, OITreeSet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
,
IITreeSet
from
ZODB.utils
import
positive_id
from
ZODB.utils
import
positive_id
,
oid_repr
TYPE_UNKNOWN
,
TYPE_BTREE
,
TYPE_BUCKET
=
range
(
3
)
...
...
@@ -200,7 +200,11 @@ def crack_bucket(b, is_mapping):
return
keys
,
values
def
type_and_adr
(
obj
):
return
"%s (0x%x)"
%
(
type
(
obj
).
__name__
,
positive_id
(
obj
))
if
hasattr
(
obj
,
'_p_oid'
):
oid
=
oid_repr
(
obj
.
_p_oid
)
else
:
oid
=
'None'
return
"%s (0x%x oid=%s)"
%
(
type
(
obj
).
__name__
,
positive_id
(
obj
),
oid
)
# Walker implements a depth-first search of a BTree (or TreeSet or Set or
# Bucket). Subclasses must implement the visit_btree() and visit_bucket()
...
...
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