From fred at zope.com Tue Feb 11 12:17:38 2003 From: fred at zope.com (Fred L. Drake, Jr.) Date: Sun Aug 10 17:05:18 2008 Subject: [ZPT-CVS] CVS: Zope/lib/python/Products/PageTemplates - PageTemplateFile.py:1.23 Message-ID: <200302111717.h1BHHc422329@cvs.baymountain.com> Update of /cvs-repository/Zope/lib/python/Products/PageTemplates In directory cvs.zope.org:/tmp/cvs-serv22003/lib/python/Products/PageTemplates Modified Files: PageTemplateFile.py Log Message: Add the App.config module and use the API it exports to get configuration values. === Zope/lib/python/Products/PageTemplates/PageTemplateFile.py 1.22 => 1.23 === --- Zope/lib/python/Products/PageTemplates/PageTemplateFile.py:1.22 Mon Oct 14 18:36:26 2002 +++ Zope/lib/python/Products/PageTemplates/PageTemplateFile.py Tue Feb 11 12:17:07 2003 @@ -29,6 +29,7 @@ from ComputedAttribute import ComputedAttribute from ExtensionClass import Base from Acquisition import aq_parent, aq_inner +from App.config import getConfiguration class PageTemplateFile(Script, PageTemplate, Traversable): "Zope wrapper for filesystem Page Template using TAL, TALES, and METAL" @@ -48,7 +49,8 @@ def __init__(self, filename, _prefix=None, **kw): self.ZBindings_edit(self._default_bindings) - if _prefix is None: _prefix=SOFTWARE_HOME + if _prefix is None: + _prefix = getConfiguration().softwarehome elif type(_prefix) is not type(''): _prefix = package_home(_prefix) name = kw.get('__name__') From fred at zope.com Tue Feb 25 10:09:10 2003 From: fred at zope.com (Fred L. Drake, Jr.) Date: Sun Aug 10 17:05:18 2008 Subject: [ZPT-CVS] CVS: Zope/lib/python/ZTUtils/tests - __init__.py:1.2 Message-ID: <200302251509.h1PF9Ak23050@cvs.baymountain.com> Update of /cvs-repository/Zope/lib/python/ZTUtils/tests In directory cvs.zope.org:/tmp/cvs-serv23033/ZTUtils/tests Added Files: __init__.py Log Message: Make ZTUtils.tests a package. === Zope/lib/python/ZTUtils/tests/__init__.py 1.1 => 1.2 === --- /dev/null Tue Feb 25 10:09:10 2003 +++ Zope/lib/python/ZTUtils/tests/__init__.py Tue Feb 25 10:09:09 2003 @@ -0,0 +1 @@ +# This file is needed to make this directory a Python package. From fred at zope.com Thu Feb 27 11:18:43 2003 From: fred at zope.com (Fred L. Drake, Jr.) Date: Sun Aug 10 17:05:18 2008 Subject: [ZPT-CVS] CVS: Zope/lib/python/Products/PageTemplates/tests - testTALES.py:1.8 Message-ID: <200302271618.h1RGIho24087@cvs.baymountain.com> Update of /cvs-repository/Zope/lib/python/Products/PageTemplates/tests In directory cvs.zope.org:/tmp/cvs-serv24053/Products/PageTemplates/tests Modified Files: testTALES.py Log Message: Get rid of apply(); extended call syntax is not news anymore, and apply() will generate a PendingDeprecationWarning in Python 2.3. === Zope/lib/python/Products/PageTemplates/tests/testTALES.py 1.7 => 1.8 === --- Zope/lib/python/Products/PageTemplates/tests/testTALES.py:1.7 Mon Jan 27 13:53:46 2003 +++ Zope/lib/python/Products/PageTemplates/tests/testTALES.py Thu Feb 27 11:18:41 2003 @@ -88,7 +88,7 @@ e = TALES.Engine() e.registerType('simple', TALES.SimpleExpr) e.registerType('unicode', DummyUnicodeExpr) - return apply(e.getContext, (), kws) + return e.getContext(**kws) def testContext0(self): '''Test use of Context''' From fred at zope.com Thu Feb 27 11:19:12 2003 From: fred at zope.com (Fred L. Drake, Jr.) Date: Sun Aug 10 17:05:18 2008 Subject: [ZPT-CVS] CVS: Zope/lib/python/TAL - TALInterpreter.py:1.77 markbench.py:1.5 timer.py:1.13 Message-ID: <200302271619.h1RGJCg24700@cvs.baymountain.com> Update of /cvs-repository/Zope/lib/python/TAL In directory cvs.zope.org:/tmp/cvs-serv24053/TAL Modified Files: TALInterpreter.py markbench.py timer.py Log Message: Get rid of apply(); extended call syntax is not news anymore, and apply() will generate a PendingDeprecationWarning in Python 2.3. === Zope/lib/python/TAL/TALInterpreter.py 1.76 => 1.77 === --- Zope/lib/python/TAL/TALInterpreter.py:1.76 Thu Jan 30 13:18:44 2003 +++ Zope/lib/python/TAL/TALInterpreter.py Thu Feb 27 11:18:40 2003 @@ -90,7 +90,7 @@ def emit(self, *args): if self.enabled: - apply(TALGenerator.emit, (self,) + args) + TALGenerator.emit(self, *args) def emitStartElement(self, name, attrlist, taldict, metaldict, i18ndict, position=(None, None), isend=0): === Zope/lib/python/TAL/markbench.py 1.4 => 1.5 === --- Zope/lib/python/TAL/markbench.py:1.4 Wed Aug 14 17:58:54 2002 +++ Zope/lib/python/TAL/markbench.py Thu Feb 27 11:18:40 2003 @@ -33,14 +33,14 @@ def time_apply(f, args, kwargs, count): for i in range(4): - apply(f, args, kwargs) + f(*args, **kwargs) r = [None] * count t0 = time.clock() for i in r: pass t1 = time.clock() for i in r: - apply(f, args, kwargs) + f(*args, **kwargs) t = time.clock() - t1 - (t1 - t0) return t / count === Zope/lib/python/TAL/timer.py 1.12 => 1.13 === --- Zope/lib/python/TAL/timer.py:1.12 Wed Aug 14 17:58:54 2002 +++ Zope/lib/python/TAL/timer.py Thu Feb 27 11:18:40 2003 @@ -47,7 +47,7 @@ sys.stderr.flush() t0 = time.clock() for i in range(count): - result = apply(func, args) + result = func(*args) t1 = time.clock() sys.stderr.write("%6.3f secs for %d calls, i.e. %4.0f msecs per call\n" % ((t1-t0), count, 1000*(t1-t0)/count)) From fred at zope.com Thu Feb 27 11:23:41 2003 From: fred at zope.com (Fred L. Drake, Jr.) Date: Sun Aug 10 17:05:18 2008 Subject: [ZPT-CVS] CVS: Zope/lib/python/Products/PageTemplates/tests - testHTMLTests.py:1.17 Message-ID: <200302271623.h1RGNfx26010@cvs.baymountain.com> Update of /cvs-repository/Zope/lib/python/Products/PageTemplates/tests In directory cvs.zope.org:/tmp/cvs-serv25987 Modified Files: testHTMLTests.py Log Message: Remove more uses of apply(). === Zope/lib/python/Products/PageTemplates/tests/testHTMLTests.py 1.16 => 1.17 === --- Zope/lib/python/Products/PageTemplates/tests/testHTMLTests.py:1.16 Thu Jan 30 13:18:39 2003 +++ Zope/lib/python/Products/PageTemplates/tests/testHTMLTests.py Thu Feb 27 11:23:39 2003 @@ -77,7 +77,7 @@ t.write(util.read_input(fname)) assert not t._v_errors, 'Template errors: %s' % t._v_errors expect = util.read_output(fname) - out = apply(t, args, kwargs) + out = t(*args, **kwargs) util.check_html(expect, out) def assert_expected_unicode(self, t, fname, *args, **kwargs): @@ -85,7 +85,7 @@ assert not t._v_errors, 'Template errors: %s' % t._v_errors expect = util.read_output(fname) expect = unicode(expect, 'utf8') - out = apply(t, args, kwargs) + out = t(*args, **kwargs) util.check_html(expect, out) def getProducts(self):