[Zodb-checkins] CVS: ZODB4/BDBStorage/Doc - custom_zodb.py:2.0

Barry Warsaw barry@wooz.org
Wed, 4 Dec 2002 14:41:06 -0500


Update of /cvs-repository/ZODB4/BDBStorage/Doc
In directory cvs.zope.org:/tmp/cvs-serv16565

Modified Files:
      Tag: 2.0
	custom_zodb.py 
Log Message:
Some more useful defaults


=== Added File ZODB4/BDBStorage/Doc/custom_zodb.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################

# Sample custom_zodb.py for running Zope with a Berkeley storage

import os
from BDBStorage.BerkeleyBase import BerkeleyConfig
from BDBStorage.BDBFullStorage import BDBFullStorage
from BDBStorage.BDBMinimalStorage import BDBMinimalStorage

import BDBStorage
print 'Using BDBStorage version', BDBStorage.__version__

# The config instance has several attributes which can be used to tune the
# Berkeley storages.  See the BDBStorage.BerkeleyConfig class docstring for
# details.  You should consider at least setting logdir and frequency.
config = BerkeleyConfig()
#config.logdir = '/directory/on/different/disk'
config.interval = 60
config.frequency = 900
config.packtime = 3600
config.classicpack = 2

# Pick one
Class = BDBFullStorage
#Class = BDBMinimalStorage

envpath = os.path.join('var', 'full')
Storage = Class(envpath, config=config)