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
0c48ab0e
Commit
0c48ab0e
authored
Apr 27, 2003
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow Zope.startup() to work without loading a particular configuration.
parent
dec5501d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
24 deletions
+34
-24
lib/python/App/config.py
lib/python/App/config.py
+6
-0
lib/python/Zope/Startup/datatypes.py
lib/python/Zope/Startup/datatypes.py
+28
-24
No files found.
lib/python/App/config.py
View file @
0c48ab0e
...
...
@@ -71,7 +71,13 @@ def setConfiguration(cfg):
class
DefaultConfiguration
:
def
__init__
(
self
):
from
App
import
FindHomes
from
Zope.Startup.datatypes
import
getDefaultDatabaseFactory
self
.
clienthome
=
FindHomes
.
CLIENT_HOME
self
.
instancehome
=
FindHomes
.
INSTANCE_HOME
self
.
softwarehome
=
FindHomes
.
SOFTWARE_HOME
self
.
zopehome
=
FindHomes
.
ZOPE_HOME
self
.
db_mount_tab
=
{
'/'
:
'main'
}
self
.
db_name_tab
=
{
'main'
:
getDefaultDatabaseFactory
(
self
)}
lib/python/Zope/Startup/datatypes.py
View file @
0c48ab0e
...
...
@@ -100,30 +100,7 @@ def root_config(section):
section
.
lock_filename
=
os
.
path
.
join
(
section
.
clienthome
,
'Z2.lock'
)
if
not
section
.
databases
:
# default to a filestorage named 'Data.fs' in clienthome
from
ZODB.config
import
FileStorage
from
ZODB.config
import
ZODBDatabase
class
dummy
:
def
__init__
(
self
,
name
):
self
.
name
=
name
def
getSectionName
(
self
):
return
self
.
name
path
=
os
.
path
.
join
(
section
.
clienthome
,
'Data.fs'
)
ns
=
dummy
(
'default filestorage at %s'
%
path
)
ns
.
path
=
path
ns
.
create
=
None
ns
.
read_only
=
None
ns
.
quota
=
None
storage
=
FileStorage
(
ns
)
ns2
=
dummy
(
'default zodb database using filestorage at %s'
%
path
)
ns2
.
storage
=
storage
ns2
.
cache_size
=
5000
ns2
.
pool_size
=
7
ns2
.
version_pool_size
=
3
ns2
.
version_cache_size
=
100
ns2
.
mount_points
=
[
'/'
]
section
.
databases
=
[
ZODBDatabase
(
ns2
)]
section
.
databases
=
[
getDefaultDatabaseFactory
(
section
)]
section
.
db_mount_tab
=
db_mount_tab
=
{}
section
.
db_name_tab
=
db_name_tab
=
{}
...
...
@@ -141,3 +118,30 @@ def root_config(section):
db_mount_tab
[
point
]
=
name
return
section
def
getDefaultDatabaseFactory
(
context
):
# default to a filestorage named 'Data.fs' in clienthome
from
ZODB.config
import
FileStorage
from
ZODB.config
import
ZODBDatabase
class
dummy
:
def
__init__
(
self
,
name
):
self
.
name
=
name
def
getSectionName
(
self
):
return
self
.
name
path
=
os
.
path
.
join
(
context
.
clienthome
,
'Data.fs'
)
fs_ns
=
dummy
(
'default filestorage at %s'
%
path
)
fs_ns
.
path
=
path
fs_ns
.
create
=
None
fs_ns
.
read_only
=
None
fs_ns
.
quota
=
None
storage
=
FileStorage
(
fs_ns
)
db_ns
=
dummy
(
'default zodb database using filestorage at %s'
%
path
)
db_ns
.
storage
=
storage
db_ns
.
cache_size
=
5000
db_ns
.
pool_size
=
7
db_ns
.
version_pool_size
=
3
db_ns
.
version_cache_size
=
100
db_ns
.
mount_points
=
[
'/'
]
return
ZODBDatabase
(
db_ns
)
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