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