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
bf7db408
Commit
bf7db408
authored
Jul 11, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got rid of unused error class.
Changed to use keys() rather than items to iterate over the index.
parent
f349b994
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/ZODB/MappingStorage.py
src/ZODB/MappingStorage.py
+9
-8
No files found.
src/ZODB/MappingStorage.py
View file @
bf7db408
...
@@ -158,20 +158,17 @@ method::
...
@@ -158,20 +158,17 @@ method::
and call it to minotor the storage.
and call it to minotor the storage.
"""
"""
__version__
=
'$Revision: 1.
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
import
base64
,
POSException
,
BTree
,
BaseStorage
,
time
,
string
,
utils
import
base64
,
POSException
,
BTree
,
BaseStorage
,
time
,
string
,
utils
from
TimeStamp
import
TimeStamp
from
TimeStamp
import
TimeStamp
class
DemoStorageError
:
pass
class
MappingStorage
(
BaseStorage
.
BaseStorage
):
class
MappingStorage
(
BaseStorage
.
BaseStorage
):
def
__init__
(
self
,
name
=
'Mapping Storage'
):
def
__init__
(
self
,
name
=
'Mapping Storage'
):
BaseStorage
.
BaseStorage
.
__init__
(
self
,
name
)
BaseStorage
.
BaseStorage
.
__init__
(
self
,
name
)
# We use a BTree because the items are sorted!
self
.
_index
=
{}
self
.
_index
=
{}
self
.
_tindex
=
[]
self
.
_tindex
=
[]
...
@@ -180,7 +177,9 @@ class MappingStorage(BaseStorage.BaseStorage):
...
@@ -180,7 +177,9 @@ class MappingStorage(BaseStorage.BaseStorage):
def
getSize
(
self
):
def
getSize
(
self
):
s
=
32
s
=
32
for
oid
,
p
in
self
.
_index
.
items
():
index
=
self
.
_index
for
oid
in
index
.
keys
():
p
=
index
[
oid
]
s
=
s
+
56
+
len
(
p
)
s
=
s
+
56
+
len
(
p
)
return
s
return
s
...
@@ -252,9 +251,11 @@ class MappingStorage(BaseStorage.BaseStorage):
...
@@ -252,9 +251,11 @@ class MappingStorage(BaseStorage.BaseStorage):
"""
"""
o
=
[]
o
=
[]
o
.
append
(
'Index:'
)
o
.
append
(
'Index:'
)
items
=
self
.
_index
.
items
()
index
=
self
.
_index
items
.
sort
()
keys
=
index
.
keys
()
for
oid
,
r
in
items
:
keys
.
sort
()
for
oid
in
keys
:
r
=
index
[
oid
]
o
.
append
(
' %s: %s, %s'
%
o
.
append
(
' %s: %s, %s'
%
(
utils
.
u64
(
oid
),
TimeStamp
(
r
[:
8
]),
`r[8:]`
))
(
utils
.
u64
(
oid
),
TimeStamp
(
r
[:
8
]),
`r[8:]`
))
...
...
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