Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
nexedi
ZEO
Commits
9a540d0f
Commit
9a540d0f
authored
21 years ago
by
Jim Fulton
Browse files
Options
Download
Email Patches
Plain Diff
Renamed the _classFactory attribute to classFactory.
parent
0fb08404
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
28 deletions
+13
-28
src/ZODB/Connection.py
src/ZODB/Connection.py
+3
-3
src/ZODB/DB.py
src/ZODB/DB.py
+5
-20
src/ZODB/Mount.py
src/ZODB/Mount.py
+4
-4
src/ZODB/tests/testConnection.py
src/ZODB/tests/testConnection.py
+1
-1
No files found.
src/ZODB/Connection.py
View file @
9a540d0f
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Database connection support
$Id: Connection.py,v 1.13
5
2004/03/04
19:48:03 jeremy
Exp $"""
$Id: Connection.py,v 1.13
6
2004/03/04
22:41:50 jim
Exp $"""
import
logging
import
sys
...
...
@@ -125,7 +125,7 @@ class Connection(ExportImport, object):
their state and register changes. The methods are setstate(),
register(), setklassstate().
$Id: Connection.py,v 1.13
5
2004/03/04
19:48:03 jeremy
Exp $
$Id: Connection.py,v 1.13
6
2004/03/04
22:41:50 jim
Exp $
"""
_tmp
=
None
...
...
@@ -348,7 +348,7 @@ class Connection(ExportImport, object):
else
:
self
.
_flush_invalidations
()
self
.
_reader
=
ConnectionObjectReader
(
self
,
self
.
_cache
,
self
.
_db
.
_
classFactory
)
self
.
_db
.
classFactory
)
self
.
_opened
=
time
()
def
_resetCache
(
self
):
...
...
This diff is collapsed.
Click to expand it.
src/ZODB/DB.py
View file @
9a540d0f
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Database objects
$Id: DB.py,v 1.
69
2004/03/04
19:48:04 jeremy
Exp $"""
$Id: DB.py,v 1.
70
2004/03/04
22:41:50 jim
Exp $"""
import
cPickle
,
cStringIO
,
sys
from
thread
import
allocate_lock
...
...
@@ -45,9 +45,8 @@ class DB(object):
it to provide a different connection implementation.
The database provides a few methods intended for application code
-- open, close, undo, pack, setClassFactory -- and a large
collection of methods for inspecting the database and its connections'
caches.
-- open, close, undo, and pack -- and a large collection of
methods for inspecting the database and its connections' caches.
"""
klass
=
Connection
# Class to use for connections
...
...
@@ -142,9 +141,6 @@ class DB(object):
else
:
m
=
None
return
m
def
_classFactory
(
self
,
connection
,
modulename
,
globalname
):
return
find_global
(
modulename
,
globalname
)
def
_closeConnection
(
self
,
connection
):
"""Return a connection to the pool"""
self
.
_a
()
...
...
@@ -574,19 +570,8 @@ class DB(object):
for
c
in
pool_info
[
1
]:
c
.
_cache
.
cache_size
=
v
def
setClassFactory
(
self
,
factory
):
"""Override default mechanism for loading object classes.
The database stores objects, but uses Python's standard import
to load the code for those objects. The class factory is used
by the database serialization layer to find the classes. It
uses ZODB.broken.find_global by default.
This method can be used to override the default class loading
code. See ZODB.broken.find_global for details
about the contract of factory.
"""
self
.
_classFactory
=
factory
def
classFactory
(
self
,
connection
,
modulename
,
globalname
):
return
find_global
(
modulename
,
globalname
)
def
setPoolSize
(
self
,
v
):
self
.
_pool_size
=
v
...
...
This diff is collapsed.
Click to expand it.
src/ZODB/Mount.py
View file @
9a540d0f
...
...
@@ -13,8 +13,8 @@
##############################################################################
"""Mounted database support
$Id: Mount.py,v 1.2
2
2004/0
2/27 00:31:53 faassen
Exp $"""
__version__
=
'$Revision: 1.2
2
$'
[
11
:
-
2
]
$Id: Mount.py,v 1.2
3
2004/0
3/04 22:41:50 jim
Exp $"""
__version__
=
'$Revision: 1.2
3
$'
[
11
:
-
2
]
import
thread
,
persistent
,
Acquisition
from
Acquisition
import
aq_base
...
...
@@ -41,7 +41,7 @@ def parentClassFactory(jar, module, name):
return
getattr
(
__import__
(
module
,
_globals
,
_globals
,
_silly
),
name
)
else
:
return
parent_db
.
_
classFactory
(
parent_conn
,
module
,
name
)
return
parent_db
.
classFactory
(
parent_conn
,
module
,
name
)
class
MountPoint
(
persistent
.
Persistent
,
Acquisition
.
Implicit
):
...
...
@@ -105,7 +105,7 @@ class MountPoint(persistent.Persistent, Acquisition.Implicit):
dbs
[
params
]
=
(
db
,
{
self
.
__mountpoint_id
:
1
})
if
getattr
(
self
,
'_classDefsFromRoot'
,
1
):
db
.
setC
lassFactory
(
parentClassFactory
)
db
.
c
lassFactory
=
parentClassFactory
else
:
db
,
mounts
=
dbInfo
# Be sure this object is in the list of mount points.
...
...
This diff is collapsed.
Click to expand it.
src/ZODB/tests/testConnection.py
View file @
9a540d0f
...
...
@@ -569,7 +569,7 @@ class StubDatabase:
def
__init__
(
self
):
self
.
_storage
=
StubStorage
()
_
classFactory
=
None
classFactory
=
None
def
invalidate
(
self
,
transaction
,
dict_with_oid_keys
,
connection
):
pass
...
...
This diff is collapsed.
Click to expand it.
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