Commit 2580fc77 authored by Jim Fulton's avatar Jim Fulton

Deprecated importing Zope (rather than Zope2).

Changed all imports of and references to the Zope to use Zope2 instead. 
parent 71b0533c
...@@ -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)
......
...@@ -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):
......
...@@ -18,3 +18,10 @@ $Id$ ...@@ -18,3 +18,10 @@ $Id$
import sys, Zope2 import sys, Zope2
sys.modules['Zope'] = 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.10.\n"
,
DeprecationWarning, stacklevel=2)
...@@ -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()
......
<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=""/>
......
<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>
......
...@@ -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