Commit 80a25f8b authored by Stefan H. Holek's avatar Stefan H. Holek

Remove some backward compatibility baggage.

parent f6ba922d
...@@ -42,32 +42,27 @@ def _exec(cmd): ...@@ -42,32 +42,27 @@ def _exec(cmd):
_write('Loading Zope, please stand by ') _write('Loading Zope, please stand by ')
_start = time.time() _start = time.time()
# Zope 2.7 specifics # Configure logging
try: if not sys.modules.has_key('logging'):
import App.config import logging
except ImportError: logging.basicConfig()
pass # Zope < 2.7
else: # Debug mode is dog slow ...
# Configure logging import App.config
if not sys.modules.has_key('logging'): config = App.config.getConfiguration()
import logging config.debug_mode = 0
logging.basicConfig() App.config.setConfiguration(config)
# Need to import Zope early on as the
# ZTUtils package relies on it # Need to import Zope early on as the
config = App.config.getConfiguration() # ZTUtils package relies on it
config.debug_mode = 0 _exec('import Zope')
App.config.setConfiguration(config) import Zope
_exec('import Zope')
import Zope
_exec('import ZODB') _exec('import ZODB')
import ZODB import ZODB
_write('.') _write('.')
_exec('import Globals') _exec('import Globals')
import Globals import Globals
# Work around a bug in Zope 2.7.0
Globals.DevelopmentMode = 0
_exec('import OFS.SimpleItem') _exec('import OFS.SimpleItem')
import OFS.SimpleItem import OFS.SimpleItem
_exec('import OFS.ObjectManager') _exec('import OFS.ObjectManager')
...@@ -97,11 +92,6 @@ App.ProductContext.ProductContext.registerHelp = _null_register_help ...@@ -97,11 +92,6 @@ App.ProductContext.ProductContext.registerHelp = _null_register_help
# Make sure to use a temporary client cache # Make sure to use a temporary client cache
if os.environ.get('ZEO_CLIENT'): del os.environ['ZEO_CLIENT'] if os.environ.get('ZEO_CLIENT'): del os.environ['ZEO_CLIENT']
# Load Zope (< 2.7)
_exec('import Zope')
import Zope
_write('.')
from OFS.Application import get_folder_permissions, get_products, install_product from OFS.Application import get_folder_permissions, get_products, install_product
from OFS.Folder import Folder from OFS.Folder import Folder
import Products import Products
...@@ -157,11 +147,8 @@ installProduct('OFSP', 1) ...@@ -157,11 +147,8 @@ installProduct('OFSP', 1)
app = Zope.app app = Zope.app
debug = Zope.debug debug = Zope.debug
DB = Zope.DB DB = Zope.DB
# startup appeared in Zope 2.6.1 configure = Zope.configure
def startup(): pass def startup(): pass
# configure appeared in Zope 2.7
try: configure = Zope.configure
except AttributeError: pass
from ZODB.DemoStorage import DemoStorage from ZODB.DemoStorage import DemoStorage
def sandbox(base=None): def sandbox(base=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment