Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
1aefbb9b
Commit
1aefbb9b
authored
Jul 12, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added logic to get a custom database storage by importing the
custom_zodb module from INSTANCE_HOME.
parent
2a1d2933
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
lib/python/Zope/__init__.py
lib/python/Zope/__init__.py
+13
-2
No files found.
lib/python/Zope/__init__.py
View file @
1aefbb9b
...
...
@@ -7,7 +7,7 @@ import sys, os, App.FindHomes
sys
.
path
.
insert
(
0
,
os
.
path
.
join
(
SOFTWARE_HOME
,
'ZopeZODB3'
))
#######################################################################
import
ZODB
,
ZODB
.
FileStorage
,
ZODB
.
ZApplication
import
ZODB
,
ZODB
.
ZApplication
,
imp
import
Globals
,
OFS
.
Application
,
sys
Globals
.
BobobaseName
=
'%s/Data.fs'
%
Globals
.
data_dir
...
...
@@ -17,7 +17,18 @@ Globals.DatabaseVersion='3'
OFS
.
Application
.
import_products
()
# Open the database
DB
=
ZODB
.
FileStorage
.
FileStorage
(
Globals
.
BobobaseName
)
try
:
# Try to use custom storage
m
=
imp
.
find_module
(
'custom_zodb'
,[
INSTANCE_HOME
])
except
:
import
ZODB.FileStorage
DB
=
ZODB
.
FileStorage
.
FileStorage
(
Globals
.
BobobaseName
)
else
:
m
=
imp
.
load_module
(
'Zope.custom_zodb'
,
m
[
0
],
m
[
1
],
m
[
2
])
DB
=
m
.
Storage
Globals
.
BobobaseName
=
DB
.
getName
()
sys
.
modules
[
'Zope.custom_zodb'
]
=
m
DB
=
ZODB
.
DB
(
DB
)
Globals
.
DB
=
DB
# Ick, this is temporary until we come up with some registry
Globals
.
opened
.
append
(
DB
)
...
...
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