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
9234240b
Commit
9234240b
authored
Dec 05, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Same as 2_5 branch.
parent
8aaebe82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
src/ZODB/Mount.py
src/ZODB/Mount.py
+16
-21
No files found.
src/ZODB/Mount.py
View file @
9234240b
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
##############################################################################
##############################################################################
"""Mounted database support
"""Mounted database support
$Id: Mount.py,v 1.1
2 2001/12/04 23:04:14
shane Exp $"""
$Id: Mount.py,v 1.1
3 2001/12/05 16:45:58
shane Exp $"""
__version__
=
'$Revision: 1.1
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
import
thread
,
Persistence
,
Acquisition
import
thread
,
Persistence
,
Acquisition
import
ExtensionClass
,
string
,
time
,
sys
import
ExtensionClass
,
string
,
time
,
sys
...
@@ -28,20 +28,18 @@ dbs = {}
...
@@ -28,20 +28,18 @@ dbs = {}
# dblock is locked every time dbs is accessed.
# dblock is locked every time dbs is accessed.
dblock
=
thread
.
allocate_lock
()
dblock
=
thread
.
allocate_lock
()
try
:
# Make special provisions for ZClasses if we're in a Zope
def
parentClassFactory
(
jar
,
module
,
name
):
# installation.
# Use the class factory from the parent database.
from
Zope.ClassFactory
import
ClassFactory
parent_db
=
getattr
(
getattr
(
jar
,
'_mount_parent_jar'
,
None
),
'_db'
,
None
)
def
RootDefsClassFactory
(
jar
,
module
,
name
):
if
parent_db
is
None
:
# Use the class definitions given at
_globals
=
{}
# the root of the Zope installation.
_silly
=
(
'__doc__'
,)
while
hasattr
(
jar
,
'_mount_parent_jar'
):
return
getattr
(
__import__
(
jar
=
jar
.
_mount_parent_jar
module
,
_globals
,
_globals
,
_silly
),
name
)
return
ClassFactory
(
jar
,
module
,
name
)
else
:
except
:
return
parent_db
.
_classFactory
(
jar
,
module
,
name
)
ClassFactory
=
None
RootDefsClassFactory
=
None
class
MountPoint
(
Persistence
.
Persistent
,
Acquisition
.
Implicit
):
class
MountPoint
(
Persistence
.
Persistent
,
Acquisition
.
Implicit
):
...
@@ -104,11 +102,8 @@ class MountPoint(Persistence.Persistent, Acquisition.Implicit):
...
@@ -104,11 +102,8 @@ class MountPoint(Persistence.Persistent, Acquisition.Implicit):
newMount
=
1
newMount
=
1
dbs
[
params
]
=
(
db
,
{
self
.
__mountpoint_id
:
1
})
dbs
[
params
]
=
(
db
,
{
self
.
__mountpoint_id
:
1
})
if
RootDefsClassFactory
is
not
None
and
\
if
getattr
(
self
,
'_classDefsFromRoot'
,
1
):
getattr
(
self
,
'_classDefsFromRoot'
,
1
):
db
.
setClassFactory
(
parentClassFactory
)
db
.
setClassFactory
(
RootDefsClassFactory
)
elif
ClassFactory
is
not
None
:
db
.
setClassFactory
(
ClassFactory
)
else
:
else
:
db
,
mounts
=
dbInfo
db
,
mounts
=
dbInfo
# Be sure this object is in the list of mount points.
# Be sure this object is in the list of mount points.
...
...
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