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
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
Nicolas Wavrant
ZODB
Commits
ae899e2a
Commit
ae899e2a
authored
Jan 06, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish configuration for DemoStorage.
There's now concrete test of recursively defined section types.
parent
8713bd6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
src/ZODB/config.py
src/ZODB/config.py
+13
-1
src/ZODB/config.xml
src/ZODB/config.xml
+1
-2
src/ZODB/tests/testConfig.py
src/ZODB/tests/testConfig.py
+9
-0
No files found.
src/ZODB/config.py
View file @
ae899e2a
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Open database and storage from a configuration.
$Id: config.py,v 1.
2 2003/01/03 21:19:06 fdrake
Exp $"""
$Id: config.py,v 1.
3 2003/01/06 22:42:17 jeremy
Exp $"""
import
os
import
StringIO
...
...
@@ -63,6 +63,18 @@ class MappingStorage(StorageConfig):
from
ZODB.MappingStorage
import
MappingStorage
return
MappingStorage
(
self
.
config
.
name
)
class
DemoStorage
(
StorageConfig
):
def
open
(
self
):
from
ZODB.DemoStorage
import
DemoStorage
if
self
.
config
.
base
:
base
=
self
.
config
.
base
.
open
()
else
:
base
=
None
return
DemoStorage
(
self
.
config
.
name
,
base
=
base
,
quota
=
self
.
config
.
quota
)
class
FileStorage
(
StorageConfig
):
def
open
(
self
):
...
...
src/ZODB/config.xml
View file @
ae899e2a
...
...
@@ -56,8 +56,7 @@
<key
name=
"read_only_fallback"
datatype=
"boolean"
default=
"off"
/>
</sectiontype>
<sectiontype
type=
"demostorage"
>
<!--datatype="ZODB.config.DemoStorage"-->
<sectiontype
type=
"demostorage"
datatype=
"ZODB.config.DemoStorage"
>
<key
name=
"name"
default=
"Demo Storage"
/>
<section
type=
"storage"
name=
"*"
attribute=
"base"
/>
<key
name=
"quota"
datatype=
"integer"
/>
...
...
src/ZODB/tests/testConfig.py
View file @
ae899e2a
...
...
@@ -76,6 +76,15 @@ class ZODBConfigTest(ConfigTestBase):
"""
self
.
assertRaises
(
ClientDisconnected
,
self
.
_test
,
cfg
)
def
test_demo_config
(
self
):
cfg
=
"""
<demostorage>
name foo
<mappingstorage/>
</demostorage>
"""
self
.
_test
(
cfg
)
class
BDBConfigTest
(
ConfigTestBase
):
def
setUp
(
self
):
self
.
_path
=
tempfile
.
mktemp
()
...
...
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