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
nexedi
ZODB
Commits
64855162
Commit
64855162
authored
May 23, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle extension methods explicitly rather than be getattr hack.
parent
be6fc1f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+6
-8
No files found.
src/ZEO/ClientStorage.py
View file @
64855162
...
...
@@ -416,11 +416,16 @@ class ClientStorage:
stub
=
self
.
StorageServerStubClass
(
conn
)
self
.
_oids
=
[]
self
.
_info
.
update
(
stub
.
get_info
())
self
.
_handle_extensions
()
self
.
verify_cache
(
stub
)
if
not
conn
.
is_async
():
log2
(
INFO
,
"Waiting for cache verification to finish"
)
self
.
_wait_sync
()
def
_handle_extensions
(
self
):
for
name
in
self
.
getExtensionMethods
():
setattr
(
self
,
name
,
self
.
_server
.
extensionMethod
(
name
))
def
set_server_addr
(
self
,
addr
):
# Normalize server address and convert to string
if
isinstance
(
addr
,
types
.
StringType
):
...
...
@@ -548,7 +553,7 @@ class ClientStorage:
Dictionary values should be None; this will be a handy place
for extra marshalling information, should we need it
"""
return
self
.
_info
[
'extensionMethods'
]
return
self
.
_info
.
get
(
'extensionMethods'
,
{})
def
supportsUndo
(
self
):
"""Storage API: return whether we support undo."""
...
...
@@ -619,12 +624,6 @@ class ClientStorage:
"""
return
self
.
_server
.
history
(
oid
,
version
,
length
)
def
__getattr__
(
self
,
name
):
if
self
.
getExtensionMethods
().
has_key
(
name
):
return
self
.
_server
.
extensionMethod
(
name
)
else
:
raise
AttributeError
(
name
)
def
loadSerial
(
self
,
oid
,
serial
):
"""Storage API: load a historical revision of an object."""
return
self
.
_server
.
loadSerial
(
oid
,
serial
)
...
...
@@ -757,7 +756,6 @@ class ClientStorage:
self
.
_tbuf
.
clear
()
self
.
_seriald
.
clear
()
del
self
.
_serials
[:]
self
.
_tbuf
.
clear
()
def
end_transaction
(
self
):
"""Internal helper to end a transaction."""
...
...
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