Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
c43ca4e3
Commit
c43ca4e3
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
c03a4a29
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 @
c43ca4e3
...
@@ -76,6 +76,12 @@ Install
...
@@ -76,6 +76,12 @@ Install
The C header file ``ring.h`` is now installed.
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?
What's new in ZODB3 3.3?
========================
========================
...
...
src/BTrees/check.py
View file @
c43ca4e3
...
@@ -39,7 +39,7 @@ from BTrees.OIBTree import OIBTree, OIBucket, OISet, OITreeSet
...
@@ -39,7 +39,7 @@ from BTrees.OIBTree import OIBTree, OIBucket, OISet, OITreeSet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.IOBTree
import
IOBTree
,
IOBucket
,
IOSet
,
IOTreeSet
from
BTrees.IIBTree
import
IIBTree
,
IIBucket
,
IISet
,
IITreeSet
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
)
TYPE_UNKNOWN
,
TYPE_BTREE
,
TYPE_BUCKET
=
range
(
3
)
...
@@ -200,7 +200,11 @@ def crack_bucket(b, is_mapping):
...
@@ -200,7 +200,11 @@ def crack_bucket(b, is_mapping):
return
keys
,
values
return
keys
,
values
def
type_and_adr
(
obj
):
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
# Walker implements a depth-first search of a BTree (or TreeSet or Set or
# Bucket). Subclasses must implement the visit_btree() and visit_bucket()
# 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