Commit 8c9fb0ee authored by Jim Fulton's avatar Jim Fulton

Renamed the Zope package to Zope2

Import of the Zope package is now deprecated, but will
be supported until Zope 2.11.
parents e9a0c154 7943a5ca
......@@ -22,8 +22,8 @@ from Testing.makerequest import makerequest
import transaction
import Zope
Zope.startup()
import Zope2
Zope2.startup()
from AccessControl import Unauthorized
from AccessControl.SecurityManagement import newSecurityManager
......@@ -36,7 +36,7 @@ class UserFolderTests(unittest.TestCase):
def setUp(self):
transaction.begin()
self.app = makerequest(Zope.app())
self.app = makerequest(Zope2.app())
try:
# Set up a user and role
self.uf = UserFolder().__of__(self.app)
......
......@@ -17,8 +17,8 @@
import os, sys, unittest
import Testing
import Zope
Zope.startup()
import Zope2
Zope2.startup()
import App.config
import App.FindHomes
......
......@@ -20,7 +20,7 @@ Usage: python pyskel.py dotted_name
Example:
cd lib/python
python Interface/pyskel.py Zope.App.Security.IRoleService.IRoleService
python Interface/pyskel.py Zope2.App.Security.IRoleService.IRoleService
The dotted name is the module name and interface object name connected
with a dot.
......
......@@ -16,7 +16,7 @@ import os, sys, unittest, tempfile, cStringIO
import ZODB
from OFS.Application import Application, AppInitializer, get_products
import Zope.Startup
import Zope2.Startup
import ZConfig
from App.config import getConfiguration, setConfiguration
......@@ -46,7 +46,7 @@ good_cfg = bad_cfg + """
"""
def getSchema():
startup = os.path.dirname(os.path.realpath(Zope.Startup.__file__))
startup = os.path.dirname(os.path.realpath(Zope2.Startup.__file__))
schemafile = os.path.join(startup, 'zopeschema.xml')
return ZConfig.loadSchema(schemafile)
......
import Testing
import Zope
Zope.startup()
import Zope2
Zope2.startup()
import os, sys
import unittest
......
from unittest import TestCase, TestSuite, makeSuite, main
import Testing
import Zope
Zope.startup()
import Zope2
Zope2.startup()
from Interface.Verify import verifyClass
from OFS.CopySupport import CopySource
......
from unittest import TestCase, TestSuite, makeSuite, main
import Testing
import Zope
Zope.startup()
import Zope2
Zope2.startup()
from Interface.Verify import verifyClass
from OFS.OrderedFolder import OrderedFolder
......
......@@ -16,7 +16,7 @@ import os, sys, unittest, tempfile, shutil, cStringIO
import ZODB
from OFS.Application import Application, AppInitializer, get_products
import Zope.Startup
import Zope2.Startup
import ZConfig
from App.config import getConfiguration, setConfiguration
......@@ -56,7 +56,7 @@ meta_types = ( {'name':'grabass', 'action':'amethod'}, )
"""
def getSchema():
startup = os.path.dirname(os.path.realpath(Zope.Startup.__file__))
startup = os.path.dirname(os.path.realpath(Zope2.Startup.__file__))
schemafile = os.path.join(startup, 'zopeschema.xml')
return ZConfig.loadSchema(schemafile)
......@@ -95,7 +95,7 @@ class TestProductInit( unittest.TestCase ):
text = text.replace("<<PRODUCTS2>>", TEMPPRODUCTS2)
sio = cStringIO.StringIO(text)
conf, handler = ZConfig.loadConfigFile(schema, sio)
from Zope.Startup.handlers import handleConfig
from Zope2.Startup.handlers import handleConfig
handleConfig(conf, handler)
self.assertEqual(conf.instancehome, TEMPNAME)
setConfiguration(conf)
......
......@@ -29,7 +29,7 @@ class DummyTranslationService:
return ustr(mapping[m.group(m.lastindex)])
cre = re.compile(r'\$(?:(%s)|\{(%s)\})' % (NAME_RE, NAME_RE))
return cre.sub(repl, default or msgid)
# XXX Not all of Zope.I18n.ITranslationService is implemented.
# XXX Not all of Zope2.I18n.ITranslationService is implemented.
translationService = DummyTranslationService()
......
......@@ -8,7 +8,7 @@ Note: Tests require Zope >= 2.7
import unittest
import Zope
import Zope2
import transaction
from Testing.makerequest import makerequest
......@@ -17,7 +17,7 @@ class ZPTRegressions(unittest.TestCase):
def setUp(self):
transaction.begin()
self.app = makerequest(Zope.app())
self.app = makerequest(Zope2.app())
f = self.app.manage_addProduct['PageTemplates'].manage_addPageTemplate
self._addPT = f
self.title = 'title of page template'
......
......@@ -11,7 +11,7 @@
#
##############################################################################
import Zope
import Zope2
import unittest
from DateTime import DateTime
......
......@@ -11,7 +11,7 @@
#
##############################################################################
import Zope
import Zope2
import unittest
import sys
......
import Zope
import Zope2
from ZPublisher.BeforeTraverse import NameCaller, rewriteBeforeTraverse
from Products.SiteAccess.AccessRule import AccessRule
......@@ -31,7 +31,7 @@ def _cvt_btr(app):
if __name__ == '__main__':
print "Converting SiteAccess objects from 1.x to 2.x ..."
app = Zope.app()
app = Zope2.app()
_cvt_btr(app)
get_transaction().commit()
print "Done."
......@@ -12,8 +12,8 @@ $Id$
from Testing.makerequest import makerequest
import Zope
Zope.startup()
import Zope2
Zope2.startup()
import transaction
......@@ -24,7 +24,7 @@ class VHMRegressions(unittest.TestCase):
def setUp(self):
transaction.begin()
self.app = makerequest(Zope.app())
self.app = makerequest(Zope2.app())
try:
#self.app.manage_addProduct['SiteAccess'].manage_addVirtualHostMonster('VHM')
# now we have a VHM as virtual_hosting per default
......
......@@ -7,8 +7,8 @@ $Id: testSiteErrorLog.py 27325 2004-08-29 09:59:28Z jens $
from Testing.makerequest import makerequest
import Zope
Zope.startup()
import Zope2
Zope2.startup()
import transaction
......@@ -20,7 +20,7 @@ class SiteErrorLogTests(unittest.TestCase):
def setUp(self):
transaction.begin()
self.app = makerequest(Zope.app())
self.app = makerequest(Zope2.app())
try:
self.app.manage_addDTMLMethod('doc', '')
except:
......
......@@ -207,7 +207,7 @@ def loadinc(name, mb, f, max=99999999, wait=1):
from ZODB.POSException import ConflictError
from time import sleep
from whrandom import uniform
import Zope, sys
import Zope2, sys
rconflicts=wconflicts=0
i=0
......@@ -218,7 +218,7 @@ def loadinc(name, mb, f, max=99999999, wait=1):
# sys.stderr.write("%s " % i)
# sys.stdout.flush()
if wait: sleep(uniform(0,wait))
jar=Zope.DB.open()
jar=Zope2.DB.open()
app=jar.root()['Application']
mdest=getattr(app, name)
if i%100 == 0 and VERBOSE:
......@@ -260,14 +260,14 @@ def loadinc(name, mb, f, max=99999999, wait=1):
def base():
try: os.unlink('../../var/Data.fs')
except: pass
import Zope
app=Zope.app()
import Zope2
app=Zope2.app()
if len(sys.argv) > 3:
max = atoi(sys.argv[3])
else:
max = -1
print do(Zope.DB, loadmail, (app, 'mail', sys.argv[2], max))
Zope.DB.close()
print do(Zope2.DB, loadmail, (app, 'mail', sys.argv[2], max))
Zope2.DB.close()
class RE:
def redirect(*args, **kw): pass
......@@ -281,9 +281,9 @@ def indexf(app):
def index():
os.environ['STUPID_LOG_FILE']=''
os.environ['STUPID_LOG_SEVERITY']='-111'
import Zope, Products.ZCatalog.ZCatalog
import Zope2, Products.ZCatalog.ZCatalog
import AccessControl.SecurityManagement, AccessControl.SpecialUsers
app=Zope.app()
app=Zope2.app()
Products.ZCatalog.ZCatalog.manage_addZCatalog(app, 'cat', '')
try:
app.cat.threshold = atoi(sys.argv[2])
......@@ -311,13 +311,13 @@ def index():
AccessControl.SecurityManagement.newSecurityManager(None, system)
r=RE()
r.PARENTS=[app.cat, app]
print do(Zope.DB, indexf, (app,))
print do(Zope2.DB, indexf, (app,))
#hist(sys.argv[2])
Zope.DB.close()
Zope2.DB.close()
def initmaili(n):
import Zope
app=Zope.app()
import Zope2
app=Zope2.app()
try:
import Products.BTreeFolder.BTreeFolder
except:
......@@ -329,8 +329,8 @@ def initmaili(n):
app._p_jar.close()
def hist(n):
import Zope
app=Zope.app()
import Zope2
app=Zope2.app()
import cPickle
pickler=cPickle.Pickler(open("h%s.hist" % n, 'w'))
h=app.cat._catalog.indexes['PrincipiaSearchSource'].histogram()
......@@ -339,7 +339,7 @@ def hist(n):
#pickler.dump(list(h))
def inc():
import Zope, thread
import Zope2, thread
min, max = atoi(sys.argv[3]), atoi(sys.argv[4])
count = max-min
try: threads=atoi(sys.argv[5])
......@@ -356,7 +356,7 @@ def inc():
omin=min
db=Zope.DB
db=Zope2.DB
size=db.getSize()
mem=VmSize()
......@@ -383,7 +383,7 @@ def inc():
argss.append((lock, (dest, mb, f, count, wait), returnf))
for lock, args, returnf in argss:
thread.start_new_thread(do, (Zope.DB, loadinc, args, returnf))
thread.start_new_thread(do, (Zope2.DB, loadinc, args, returnf))
for lock, args, returnf in argss:
lock.acquire()
......@@ -397,12 +397,12 @@ def inc():
#hist("%s-%s-%s" % (omin, count, threads))
Zope.DB.close()
Zope2.DB.close()
def catdel():
import Zope
app = Zope.app()
db = Zope.DB
import Zope2
app = Zope2.app()
db = Zope2.DB
t = time.time()
c = time.clock()
size = db.getSize()
......@@ -605,14 +605,14 @@ words=['banishment', 'indirectly', 'imprecise', 'peeks',
from ZODB.utils import u64
def incedit(edits, wait, ndel=20, nins=20):
import Zope, whrandom, string, time
import Zope2, whrandom, string, time
from ZODB.POSException import ConflictError
rconflicts=wconflicts=0
did=str(edits.pop())
while edits:
if wait: time.sleep(whrandom.uniform(0,wait))
jar=Zope.DB.open()
jar=Zope2.DB.open()
app=jar.root()['Application']
doc=getattr(app.mail, did)
......@@ -650,7 +650,7 @@ def incedit(edits, wait, ndel=20, nins=20):
return rconflicts, wconflicts
def edit():
import Zope, thread
import Zope2, thread
nedit, ndel, nins = atoi(sys.argv[2]), atoi(sys.argv[3]), atoi(sys.argv[4])
try: threads=atoi(sys.argv[5])
except:
......@@ -664,8 +664,8 @@ def edit():
if threads==1: start_new_thread=apply
else: start_new_thread=thread.start_new_thread
db=Zope.DB
app=Zope.app()
db=Zope2.DB
app=Zope2.app()
number_of_messages=app.mail.number_of_messages
app._p_jar.close()
......@@ -696,7 +696,7 @@ def edit():
argss.append((lock, (edits, wait, ndel, nins), returnf))
for lock, args, returnf in argss:
start_new_thread(do, (Zope.DB, incedit, args, returnf))
start_new_thread(do, (Zope2.DB, incedit, args, returnf))
for lock, args, returnf in argss:
lock.acquire()
......@@ -710,7 +710,7 @@ def edit():
#hist("e%s" % (threads))
Zope.DB.close()
Zope2.DB.close()
def VmSize():
try: f=open('/proc/%s/status' % os.getpid())
......
......@@ -16,7 +16,7 @@ os.environ['STUPID_LOG_FILE']= "debug.log"
here = os.getcwd()
import Zope
import Zope2
import ZODB, ZODB.FileStorage
from Products.ZCatalog import ZCatalog,Vocabulary
from Products.ZCatalog.Catalog import CatalogError
......
......@@ -17,7 +17,7 @@ os.environ['STUPID_LOG_FILE']=os.path.join(os.environ['INSTANCE_HOME'],'var',
'debug.log')
here = os.getcwd()
import Zope
import Zope2
import mailbox, time, httplib
from string import strip, find, split, lower, atoi, join
from urllib import quote
......@@ -36,7 +36,7 @@ TextTestRunner = VerboseTextTestRunner
class TestTimeIndex(TestCase):
def setUp(self):
self.app = makerequest(Zope.app())
self.app = makerequest(Zope2.app())
try: self.app._delObject('catalogtest')
except AttributeError: pass
self.app.manage_addFolder('catalogtest')
......
import os,sys
import unittest
import Zope
import Zope2
from Products.ZCatalog.ZCatalog import ZCatalog
from Products.PluginIndexes.TextIndex import Splitter
......
......@@ -17,8 +17,8 @@ $Id:$
import unittest
import Testing
import Zope
Zope.startup()
import Zope2
Zope2.startup()
from Interface.Verify import verifyClass
from itertools import chain
......
......@@ -38,7 +38,7 @@ class TestDBConfig:
def getDB(self):
from ZODB.config import DemoStorage
from ZODB.Connection import Connection
from Zope.Startup.datatypes import ZopeDatabase
from Zope2.Startup.datatypes import ZopeDatabase
self.name = self.fname
self.base = None
self.path = os.path.join(os.path.dirname(__file__), self.fname)
......
......@@ -24,8 +24,8 @@ from DocumentTemplate.DT_Util import ustr
IDomain = None
try:
from Zope.I18n.ITranslationService import ITranslationService
from Zope.I18n.IDomain import IDomain
from Zope2.I18n.ITranslationService import ITranslationService
from Zope2.I18n.IDomain import IDomain
except ImportError:
pass
if IDomain is None:
......
......@@ -7,9 +7,9 @@
#
# Typically used as in
#
# import ZopeLite as Zope
# Zope.installProduct('SomeProduct')
# app = Zope.app()
# import ZopeLite as Zope2
# Zope2.installProduct('SomeProduct')
# app = Zope2.app()
#
# $Id: ZopeLite.py,v 1.24 2004/08/18 09:28:54 shh42 Exp $
......@@ -53,10 +53,10 @@ config = App.config.getConfiguration()
config.debug_mode = 0
App.config.setConfiguration(config)
# Need to import Zope early on as the
# Need to import Zope2 early on as the
# ZTUtils package relies on it
_exec('import Zope')
import Zope
_exec('import Zope2')
import Zope2
_exec('import ZODB')
import ZODB
_write('.')
......@@ -96,7 +96,7 @@ from OFS.Application import get_folder_permissions, get_products, install_produc
from OFS.Folder import Folder
import Products
_theApp = Zope.app()
_theApp = Zope2.app()
_installedProducts = {}
def hasProduct(name):
......@@ -144,16 +144,16 @@ installProduct('OFSP', 1)
#installProduct('MailHost', 1)
# So people can use ZopeLite.app()
app = Zope.app
debug = Zope.debug
DB = Zope.DB
configure = Zope.configure
app = Zope2.app
debug = Zope2.debug
DB = Zope2.DB
configure = Zope2.configure
def startup(): pass
from ZODB.DemoStorage import DemoStorage
def sandbox(base=None):
'''Returns what amounts to a sandbox copy of the base ZODB.'''
if base is None: base = Zope.DB
if base is None: base = Zope2.DB
base_storage = base._storage
quota = getattr(base_storage, '_quota', None)
storage = DemoStorage(base=base_storage, quota=quota)
......
......@@ -4,7 +4,7 @@
# $Id: __init__.py,v 1.13 2004/08/19 15:52:55 shh42 Exp $
import ZopeLite as Zope
import ZopeLite as Zope2
import utils
from ZopeLite import installProduct
......
......@@ -4,7 +4,7 @@
# $Id: base.py,v 1.1 2004/08/19 13:59:41 shh42 Exp $
import ZopeLite as Zope
import ZopeLite as Zope2
import unittest
import transaction
......@@ -19,7 +19,7 @@ _connections = utils.ConnectionRegistry()
def app():
'''Opens a ZODB connection and returns the app object.'''
app = Zope.app()
app = Zope2.app()
_connections.register(app._p_jar)
return utils.makerequest(app)
......
......@@ -4,7 +4,7 @@
# $Id: sandbox.py,v 1.2 2004/08/19 15:31:26 shh42 Exp $
import ZopeLite as Zope
import ZopeLite as Zope2
import transaction
import utils
......@@ -19,7 +19,7 @@ class Sandboxed:
def _app(self):
'''Returns the app object for a test.'''
app = Zope.app(Zope.sandbox().open())
app = Zope2.app(Zope.sandbox().open())
AppZapper().set(app)
return utils.makerequest(app)
......
......@@ -18,7 +18,7 @@ def zserverRunner(host, port, log=None):
if log is None: log = dummyLOG
lg = logger.file_logger(log)
hs = zhttp_server(ip=host, port=port, resolver=None, logger_object=lg)
zh = zhttp_handler(module='Zope', uri_base='')
zh = zhttp_handler(module='Zope2', uri_base='')
hs.install_handler(zh)
asyncore.loop()
......
......@@ -17,7 +17,7 @@ ZODB objects
Usage:
import makerequest
app = makerequest.makerequest(Zope.app())
app = makerequest.makerequest(Zope2.app())
$Id$
......
......@@ -37,7 +37,7 @@ class Environment:
v = os.environ.get("INSTANCE_HOME")
if v is None:
# looking for a Zope/var directory assuming that this code
# is installed in Zope/lib/python/ZEO
# is installed in Zope2/lib/python/ZEO
p = parentdir(argv0, 4)
if os.path.isdir(os.path.join(p, "var")):
v = p
......
......@@ -69,12 +69,12 @@ It is instructive to watch what happens to the internal data structures
as changes are made. For example, in Zope, you can create an external
method::
import Zope
import Zope2
def info(RESPONSE):
RESPONSE['Content-type']= 'text/plain'
return Zope.DB._storage._splat()
return Zope2.DB._storage._splat()
and call it to monitor the storage.
......
from unittest import TestCase, TestSuite, makeSuite, main
import Zope
Zope.startup()
import Zope2
Zope2.startup()
from Acquisition import Implicit
from ZPublisher.BaseRequest import BaseRequest
......
......@@ -35,7 +35,7 @@ tracer = Tracer()
class TransactionsManager:
"""Mock TransactionManager to replace
Zope.App.startup.TransactionsManager.
Zope2.App.startup.TransactionsManager.
"""
def abort(self):
......@@ -55,7 +55,7 @@ zpublisher_transactions_manager = TransactionsManager()
def zpublisher_exception_hook(published, request, t, v, traceback):
"""Mock zpublisher_exception_hook to replace
Zope.App.startup.zpublisher_exception_hook
Zope2.App.startup.zpublisher_exception_hook
"""
if issubclass(t, ConflictError):
......
##############################################################################
#
# Copyright (c) 2005 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.
#
##############################################################################
"""Legacy Zope "package" that redirects to the new Zope 2 package
$Id$
"""
import sys, Zope2
sys.modules['Zope'] = Zope2
import warnings
warnings.warn("The Zope package has been renamed to Zope2.\n"
"Import of a package named 'Zope' is deprecated\n"
"and will be disabled starting in Zope 2.11.\n"
,
DeprecationWarning, stacklevel=2)
......@@ -10,7 +10,7 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""Initialize the Zope Package and provide a published module
"""Initialize the Zope2 Package and provide a published module
"""
from AccessControl.SecurityManagement import getSecurityManager
......@@ -33,7 +33,7 @@ import os
import sys
import ZODB
import ZODB.ZApplication
import Zope
import Zope2
import ZPublisher
......@@ -58,7 +58,7 @@ def startup():
DB = configuration.dbtab.getDatabase('/', is_root=1)
Globals.BobobaseName = DB.getName()
else:
m=imp.load_module('Zope.custom_zodb', m[0], m[1], m[2])
m=imp.load_module('Zope2.custom_zodb', m[0], m[1], m[2])
if hasattr(m,'DB'):
DB=m.DB
else:
......@@ -66,14 +66,14 @@ def startup():
DB = ZODB.DB(storage)
Globals.BobobaseName = DB.getName()
sys.modules['Zope.custom_zodb']=m
sys.modules['Zope2.custom_zodb']=m
if DB.getActivityMonitor() is None:
from ZODB.ActivityMonitor import ActivityMonitor
DB.setActivityMonitor(ActivityMonitor())
Globals.DB = DB # Ick, this is temporary until we come up with some registry
Zope.DB = DB
Zope2.DB = DB
# Hook for providing multiple transaction object manager undo support:
Globals.UndoManager=DB
......@@ -90,7 +90,7 @@ def startup():
app = ZODB.ZApplication.ZApplicationWrapper(
DB, 'Application', OFS.Application.Application, (),
Globals.VersionNameName)
Zope.bobo_application = app
Zope2.bobo_application = app
# Initialize the app object
application = app()
......@@ -104,17 +104,13 @@ def startup():
# "Log off" as system user
noSecurityManager()
# This is really ugly. Please remember to remove Main.py before
# Zope 2.7 and fix whatever breaks, if anything.
sys.modules['Main'] = sys.modules['Zope']
global startup_time
startup_time = log_time()
Zope.zpublisher_transactions_manager = TransactionsManager()
Zope.zpublisher_exception_hook = zpublisher_exception_hook
Zope.zpublisher_validated_hook = validated_hook
Zope.__bobo_before__ = noSecurityManager
Zope2.zpublisher_transactions_manager = TransactionsManager()
Zope2.zpublisher_exception_hook = zpublisher_exception_hook
Zope2.zpublisher_validated_hook = validated_hook
Zope2.__bobo_before__ = noSecurityManager
def validated_hook(request, user):
......@@ -129,7 +125,7 @@ def validated_hook(request, user):
expires="Mon, 25-Jan-1999 23:59:59 GMT",
path=(request['BASEPATH1'] or '/'),
)
Zope.DB.removeVersionPool(version)
Zope2.DB.removeVersionPool(version)
raise Unauthorized, "You don't have permission to enter versions."
......
......@@ -252,8 +252,8 @@ class ZopeStarter:
def startZope(self):
# Import Zope
import Zope
Zope.startup()
import Zope2
Zope2.startup()
def makeLockFile(self):
if not self.cfg.zserver_read_only_mode:
......@@ -268,7 +268,7 @@ class ZopeStarter:
# if we can't lock it.
# we need a separate lock file because on win32, locks are not
# advisory, otherwise we would just use the pid file
from Zope.Startup.misc.lock_file import lock_file
from Zope2.Startup.misc.lock_file import lock_file
lock_filename = self.cfg.lock_filename
try:
if os.path.exists(lock_filename):
......
......@@ -150,7 +150,7 @@ def root_handler(config):
for factory in config.servers:
factory.prepare(config.ip_address or '',
config.dns_resolver,
"Zope",
"Zope2",
config.cgi_environment,
config.port_base)
......
......@@ -14,8 +14,8 @@
def run():
""" Start a Zope instance """
import Zope.Startup
starter = Zope.Startup.get_starter()
import Zope2.Startup
starter = Zope2.Startup.get_starter()
opts = _setconfig()
starter.setConfiguration(opts.configroot)
starter.prepare()
......@@ -23,11 +23,11 @@ def run():
def configure(configfile):
""" Provide an API which allows scripts like zopectl to configure
Zope before attempting to do 'app = Zope.app(). Should be used as
follows: from Zope.Startup.run import configure;
configure('/path/to/configfile'); import Zope; app = Zope.app() """
import Zope.Startup
starter = Zope.Startup.get_starter()
Zope before attempting to do 'app = Zope2.app(). Should be used as
follows: from Zope2.Startup.run import configure;
configure('/path/to/configfile'); import Zope2; app = Zope2.app() """
import Zope2.Startup
starter = Zope2.Startup.get_starter()
opts = _setconfig(configfile)
starter.setConfiguration(opts.configroot)
starter.setupSecurityOptions()
......@@ -38,7 +38,7 @@ def _setconfig(configfile=None):
""" Configure a Zope instance based on ZopeOptions. Optionally
accept a configfile argument (string path) in order to specify
where the configuration file exists. """
from Zope.Startup import options, handlers
from Zope2.Startup import options, handlers
from App import config
opts = options.ZopeOptions()
if configfile:
......
......@@ -12,4 +12,4 @@
#
##############################################################################
"""Tests of the Zope.Startup package."""
"""Tests of the Zope2.Startup package."""
......@@ -25,7 +25,7 @@ import ZConfig
from ZConfig.components.logger.tests import test_logger
from ZConfig.components.logger.loghandler import NullHandler
import Zope.Startup
import Zope2.Startup
from App.config import getConfiguration, setConfiguration
......@@ -33,7 +33,7 @@ TEMPNAME = tempfile.mktemp()
TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
def getSchema():
startup = os.path.dirname(Zope.Startup.__file__)
startup = os.path.dirname(Zope2.Startup.__file__)
schemafile = os.path.join(startup, 'zopeschema.xml')
return ZConfig.loadSchema(schemafile)
......@@ -70,7 +70,7 @@ class ZopeStarterTestCase(test_logger.LoggingTestBase):
logger.__dict__.update(logger_states[name])
def get_starter(self, conf):
starter = Zope.Startup.get_starter()
starter = Zope2.Startup.get_starter()
starter.setConfiguration(conf)
return starter
......@@ -183,7 +183,7 @@ class ZopeStarterTestCase(test_logger.LoggingTestBase):
starter = self.get_starter(conf)
# do the job the 'handler' would have done (call prepare)
for server in conf.servers:
server.prepare('', None, 'Zope', {}, None)
server.prepare('', None, 'Zope2', {}, None)
try:
starter.setupServers()
import ZServer
......@@ -213,7 +213,7 @@ class ZopeStarterTestCase(test_logger.LoggingTestBase):
## starter = self.get_starter(conf)
## # do the job the 'handler' would have done (call prepare)
## for server in conf.servers:
## server.prepare('', None, 'Zope', {}, None)
## server.prepare('', None, 'Zope2', {}, None)
## try:
## self.assertRaises(ZConfig.ConfigurationError, starter.setupServers)
## finally:
......@@ -385,7 +385,7 @@ class ZopeStarterTestCase(test_logger.LoggingTestBase):
sys.argv = [sys.argv[0]]
try:
fname = os.path.join(TEMPNAME, 'zope.conf')
from Zope import configure
from Zope2 import configure
f = open(fname, 'w')
f.write('instancehome %s\nzserver-threads 100\n' % TEMPNAME)
f.flush()
......
......@@ -20,9 +20,9 @@ import tempfile
import unittest
import ZConfig
import Zope.Startup
import Zope2.Startup
from Zope.Startup import datatypes
from Zope2.Startup import datatypes
from App.config import getConfiguration
......@@ -31,7 +31,7 @@ TEMPNAME = tempfile.mktemp()
TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
def getSchema():
startup = os.path.dirname(os.path.realpath(Zope.Startup.__file__))
startup = os.path.dirname(os.path.realpath(Zope2.Startup.__file__))
schemafile = os.path.join(startup, 'zopeschema.xml')
return ZConfig.loadSchema(schemafile)
......
......@@ -22,9 +22,9 @@ import unittest
import warnings
import ZConfig
import Zope.Startup
import Zope2.Startup
from Zope.Startup import datatypes
from Zope2.Startup import datatypes
from App.config import getConfiguration
......@@ -32,7 +32,7 @@ TEMPNAME = tempfile.mktemp()
TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
def getSchema():
startup = os.path.dirname(os.path.realpath(Zope.Startup.__file__))
startup = os.path.dirname(os.path.realpath(Zope2.Startup.__file__))
schemafile = os.path.join(startup, 'zopeschema.xml')
return ZConfig.loadSchema(schemafile)
......@@ -75,7 +75,7 @@ class TestWarnFilter(unittest.TestCase):
<warnfilter>
action error
message .*test.*
category Zope.Startup.tests.test_warnfilter.TestSchemaWarning
category Zope2.Startup.tests.test_warnfilter.TestSchemaWarning
module .*test_warnfilter.*
lineno 0
</warnfilter>
......@@ -102,7 +102,7 @@ class TestWarnFilter(unittest.TestCase):
instancehome <<INSTANCE_HOME>>
<warnfilter>
action wontwork
category Zope.Startup.tests.test_schema.TestSchemaWarning
category Zope2.Startup.tests.test_schema.TestSchemaWarning
</warnfilter>
""")
......
<component prefix="Zope.Startup.warnfilter">
<component prefix="Zope2.Startup.warnfilter">
<sectiontype name="warnfilter" datatype=".warning_filter_handler">
<key name="action" datatype=".warn_action" default="default"/>
<key name="message" default=""/>
......
......@@ -40,7 +40,7 @@ import sys
import signal
import zdaemon
import Zope.Startup
import Zope2.Startup
from zdaemon.zdctl import ZDCmd
from zdaemon.zdoptions import ZDOptions
......@@ -60,7 +60,7 @@ class ZopeCtlOptions(ZDOptions):
positional_args_allowed = 1
program = "zopectl"
schemadir = os.path.dirname(Zope.Startup.__file__)
schemadir = os.path.dirname(Zope2.Startup.__file__)
schemafile = "zopeschema.xml"
uid = gid = None
......@@ -166,7 +166,7 @@ class ZopeCmd(ZDCmd):
def do_debug(self, arg):
cmdline = self.get_startup_cmd(self.options.python + ' -i',
'import Zope; app=Zope.app()')
'import Zope2; app=Zope2.app()')
print ('Starting debugger (the name "app" is bound to the top-level '
'Zope object)')
os.system(cmdline)
......@@ -194,7 +194,7 @@ class ZopeCmd(ZDCmd):
if len(tup) > 1:
argv = tup[1:]
cmd += '[sys.argv.append(x) for x in %s];' % argv
cmd += 'import Zope; app=Zope.app(); execfile(\'%s\')' % script
cmd += 'import Zope2; app=Zope2.app(); execfile(\'%s\')' % script
cmdline = self.get_startup_cmd(self.options.python, cmd)
os.system(cmdline)
......@@ -212,7 +212,7 @@ class ZopeCmd(ZDCmd):
return
cmdline = self.get_startup_cmd(
self.options.python ,
'import Zope; app=Zope.app();'
'import Zope2; app=Zope2.app();'
'app.acl_users._doAddUser(\'%s\', \'%s\', [\'Manager\'], []);'
'get_transaction().commit()'
) % (name, password)
......
<schema prefix="Zope.Startup.datatypes"
<schema prefix="Zope2.Startup.datatypes"
datatype=".root_config"
handler="root_handler">
......@@ -9,7 +9,7 @@
<import package="ZODB"/>
<import package="ZServer"/>
<import package="tempstorage"/>
<import package="Zope.Startup" file="warnfilter.xml"/>
<import package="Zope2.Startup" file="warnfilter.xml"/>
<sectiontype name="logger" datatype=".LoggerFactory">
<description>
......
......@@ -26,9 +26,9 @@
# This version is transitional. If you have a script that no longer
# works because it needs the database to be opened on calling "import
# Zope", you can set the environment variable ZOPE_COMPATIBLE_STARTUP
# to a non-empty value. Then "import Zope" will automatically open
# to a non-empty value. Then "import Zope2" will automatically open
# the database as it used to. Or better, update the script to call
# Zope.startup() right after importing the Zope package. A future
# Zope2.startup() right after importing the Zope package. A future
# version of Zope will remove this backward compatibility, since the
# old behavior is likely to cause problems as ZODB backends, like ZEO,
# gain new features.
......@@ -43,7 +43,7 @@ def startup():
return
_began_startup = 1
_configure()
from Zope.App.startup import startup as _startup
from Zope2.App.startup import startup as _startup
_startup()
def app(*args, **kw):
......@@ -57,7 +57,7 @@ def debug(*args, **kw):
import ZPublisher
return ZPublisher.test('Zope', *args, **kw)
from Zope.Startup.run import configure
from Zope2.Startup.run import configure
def _configure():
# Load configuration file from (optional) environment variable
......@@ -67,7 +67,7 @@ def _configure():
if configfile is not None:
configure(configfile)
# Zope.App.startup.startup() sets the following variables in this module.
# Zope2.App.startup.startup() sets the following variables in this module.
DB = None
bobo_application = None
zpublisher_transactions_manager = None
......
......@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""ZODB undo support for Zope.
"""ZODB undo support for Zope2.
This package is used to support the Prefix object that Zope uses for
undo. It is a separate package only to aid configuration management.
......
......@@ -605,9 +605,9 @@ setup(
name='Zope',
author=AUTHOR,
packages=['Zope', 'Zope.App', 'Zope.Startup', 'Zope.Startup.misc',
'Zope.Startup.nt', 'Zope.Startup.tests'],
data_files=[ ['Zope/Startup', ['Zope/Startup/*.xml']] ],
packages=['Zope2', 'Zope2.App', 'Zope2.Startup', 'Zope2.Startup.misc',
'Zope2.Startup.nt', 'Zope2.Startup.tests'],
data_files=[ ['Zope2/Startup', ['Zope2/Startup/*.xml']] ],
)
# webdav
......
......@@ -8,6 +8,6 @@ SOFTWARE_HOME="<<SOFTWARE_HOME>>"
PYTHONPATH="$SOFTWARE_HOME"
export PYTHONPATH INSTANCE_HOME SOFTWARE_HOME
ZOPE_RUN="$SOFTWARE_HOME/Zope/Startup/run.py"
ZOPE_RUN="$SOFTWARE_HOME/Zope2/Startup/run.py"
exec "$PYTHON" "$ZOPE_RUN" -C "$CONFIG_FILE" "$@"
......@@ -8,6 +8,6 @@ SOFTWARE_HOME="<<SOFTWARE_HOME>>"
PYTHONPATH="$SOFTWARE_HOME"
export PYTHONPATH INSTANCE_HOME SOFTWARE_HOME
ZDCTL="$SOFTWARE_HOME/Zope/Startup/zopectl.py"
ZDCTL="$SOFTWARE_HOME/Zope2/Startup/zopectl.py"
exec "$PYTHON" "$ZDCTL" -C "$CONFIG_FILE" "$@"
......@@ -661,8 +661,8 @@ def main(module_filter, test_filter, libdir):
if config_file:
config_file = os.path.realpath(config_file)
print "Parsing %s" % config_file
import Zope
Zope.configure(config_file)
import Zope2
Zope2.configure(config_file)
if not keepStaleBytecode:
from App.config import getConfiguration
......
......@@ -197,10 +197,10 @@ def setup(lib_python):
os.remove(os.path.join(lib_python, '..', '..', 'var', 'Data.fs'))
except:
pass
import Zope
import Zope2
import Products
import AccessControl.SecurityManagement
app=Zope.app()
app=Zope2.app()
Products.ZCatalog.ZCatalog.manage_addZCatalog(app, 'cat', '')
......@@ -279,16 +279,16 @@ def run1(tid, db, factory, job, args):
factory.__name__, r)
def run(jobs, tid=''):
import Zope
import Zope2
while 1:
factory, job, args, repeatp = jobs.next()
run1(tid, Zope.DB, factory, job, args)
run1(tid, Zope2.DB, factory, job, args)
if repeatp:
while 1:
i = random.randint(0,100)
if i > repeatp:
break
run1(tid, Zope.DB, factory, job, args)
run1(tid, Zope2.DB, factory, job, args)
def index(connection, messages, catalog):
......@@ -733,8 +733,8 @@ def main(args=None):
if options.has_key('setup'):
setup(lib_python)
else:
import Zope
Zope.startup()
import Zope2
Zope2.startup()
#from ThreadedAsync.LoopCallback import loop
#threading.Thread(target=loop, args=(), name='asyncore').start()
......
......@@ -15,7 +15,7 @@
$Id$
"""
import Zope
import Zope2
import os,sys,re,getopt
from types import IntType
from BTrees.IIBTree import IISet,difference,intersection
......@@ -23,7 +23,7 @@ from BTrees.IIBTree import IISet,difference,intersection
def checkCatalog(path,indexes):
""" perform some consistency checks on a ZCatalog instance"""
root = Zope.app()
root = Zope2.app()
try:
catalog = root.unrestrictedTraverse(path)
......
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