Skip to content

Commit

Permalink
Renamed the Zope package to Zope2
Browse files Browse the repository at this point in the history
Import of the Zope package is now deprecated, but will
be supported until Zope 2.11.
  • Loading branch information
Jim Fulton committed Jan 31, 2005
1 parent ea24d78 commit 104fb45
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 34 deletions.
56 changes: 28 additions & 28 deletions regressiontests/loadmail.py
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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])
Expand Down Expand Up @@ -311,13 +311,13 @@ class extra:
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:
Expand All @@ -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()
Expand All @@ -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])
Expand All @@ -356,7 +356,7 @@ def inc():

omin=min

db=Zope.DB
db=Zope2.DB

size=db.getSize()
mem=VmSize()
Expand All @@ -383,7 +383,7 @@ def returnf(t, c, size, mem, r, lock=lock):
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()
Expand All @@ -397,12 +397,12 @@ def returnf(t, c, size, mem, r, lock=lock):

#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()
Expand Down Expand Up @@ -605,14 +605,14 @@ def catdel():
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)

Expand Down Expand Up @@ -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:
Expand All @@ -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()

Expand Down Expand Up @@ -696,7 +696,7 @@ def returnf(t, c, size, mem, r, lock=lock):
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()
Expand All @@ -710,7 +710,7 @@ def returnf(t, c, size, mem, r, lock=lock):

#hist("e%s" % (threads))

Zope.DB.close()
Zope2.DB.close()

def VmSize():
try: f=open('/proc/%s/status' % os.getpid())
Expand Down
2 changes: 1 addition & 1 deletion regressiontests/regressionCatalog.py
Expand Up @@ -16,7 +16,7 @@

here = os.getcwd()

import Zope
import Zope2
import ZODB, ZODB.FileStorage
from Products.ZCatalog import ZCatalog,Vocabulary
from Products.ZCatalog.Catalog import CatalogError
Expand Down
4 changes: 2 additions & 2 deletions regressiontests/regressionCatalogTiming.py
Expand Up @@ -17,7 +17,7 @@
'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
Expand All @@ -36,7 +36,7 @@

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')
Expand Down
2 changes: 1 addition & 1 deletion regressiontests/regressionUnicode.py
@@ -1,7 +1,7 @@
import os,sys
import unittest

import Zope
import Zope2
from Products.ZCatalog.ZCatalog import ZCatalog

from Products.PluginIndexes.TextIndex import Splitter
Expand Down
4 changes: 2 additions & 2 deletions tests/testCatalog.py
Expand Up @@ -17,8 +17,8 @@

import unittest
import Testing
import Zope
Zope.startup()
import Zope2
Zope2.startup()
from Interface.Verify import verifyClass

from itertools import chain
Expand Down

0 comments on commit 104fb45

Please sign in to comment.