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
b50fbf0a
Commit
b50fbf0a
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
08059483
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
trunk/src/ZEO/ClientStorage.py
trunk/src/ZEO/ClientStorage.py
+6
-8
No files found.
trunk/src/ZEO/ClientStorage.py
View file @
b50fbf0a
...
@@ -416,11 +416,16 @@ class ClientStorage:
...
@@ -416,11 +416,16 @@ class ClientStorage:
stub
=
self
.
StorageServerStubClass
(
conn
)
stub
=
self
.
StorageServerStubClass
(
conn
)
self
.
_oids
=
[]
self
.
_oids
=
[]
self
.
_info
.
update
(
stub
.
get_info
())
self
.
_info
.
update
(
stub
.
get_info
())
self
.
_handle_extensions
()
self
.
verify_cache
(
stub
)
self
.
verify_cache
(
stub
)
if
not
conn
.
is_async
():
if
not
conn
.
is_async
():
log2
(
INFO
,
"Waiting for cache verification to finish"
)
log2
(
INFO
,
"Waiting for cache verification to finish"
)
self
.
_wait_sync
()
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
):
def
set_server_addr
(
self
,
addr
):
# Normalize server address and convert to string
# Normalize server address and convert to string
if
isinstance
(
addr
,
types
.
StringType
):
if
isinstance
(
addr
,
types
.
StringType
):
...
@@ -548,7 +553,7 @@ class ClientStorage:
...
@@ -548,7 +553,7 @@ class ClientStorage:
Dictionary values should be None; this will be a handy place
Dictionary values should be None; this will be a handy place
for extra marshalling information, should we need it
for extra marshalling information, should we need it
"""
"""
return
self
.
_info
[
'extensionMethods'
]
return
self
.
_info
.
get
(
'extensionMethods'
,
{})
def
supportsUndo
(
self
):
def
supportsUndo
(
self
):
"""Storage API: return whether we support undo."""
"""Storage API: return whether we support undo."""
...
@@ -619,12 +624,6 @@ class ClientStorage:
...
@@ -619,12 +624,6 @@ class ClientStorage:
"""
"""
return
self
.
_server
.
history
(
oid
,
version
,
length
)
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
):
def
loadSerial
(
self
,
oid
,
serial
):
"""Storage API: load a historical revision of an object."""
"""Storage API: load a historical revision of an object."""
return
self
.
_server
.
loadSerial
(
oid
,
serial
)
return
self
.
_server
.
loadSerial
(
oid
,
serial
)
...
@@ -757,7 +756,6 @@ class ClientStorage:
...
@@ -757,7 +756,6 @@ class ClientStorage:
self
.
_tbuf
.
clear
()
self
.
_tbuf
.
clear
()
self
.
_seriald
.
clear
()
self
.
_seriald
.
clear
()
del
self
.
_serials
[:]
del
self
.
_serials
[:]
self
.
_tbuf
.
clear
()
def
end_transaction
(
self
):
def
end_transaction
(
self
):
"""Internal helper to end a transaction."""
"""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