[Checkins] SVN: z3c.pt/trunk/ Explicitly enable the cache in python code instead of relying on environment variables

Wichert Akkerman wichert at wiggy.net
Fri Aug 8 06:43:42 EDT 2008


Log message for revision 89541:
  Explicitly enable the cache in python code instead of relying on environment variables

Changed:
  U   z3c.pt/trunk/benchmark/benchmark/tests.py
  U   z3c.pt/trunk/buildout.cfg
  U   z3c.pt/trunk/src/z3c/pt/loader.py

-=-
Modified: z3c.pt/trunk/benchmark/benchmark/tests.py
===================================================================
--- z3c.pt/trunk/benchmark/benchmark/tests.py	2008-08-08 10:16:44 UTC (rev 89540)
+++ z3c.pt/trunk/benchmark/benchmark/tests.py	2008-08-08 10:43:40 UTC (rev 89541)
@@ -154,6 +154,7 @@
     def setUp(self):
         BaseTestCase.setUp(self)
         self.files = os.path.abspath(os.path.join(__file__, '..', 'input'))
+        self.cache = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'cache'))
 
     def _testfile(self, name):
         return os.path.join(self.files, name)
@@ -163,7 +164,8 @@
         table = self.table
 
         z3cfile = z3c.pt.PageTemplateFile(
-            self._testfile('bigtable_python_z3c.pt'))
+            self._testfile('bigtable_python_z3c.pt'),
+            cachedir=self.cache)
 
         zopefile = zope.pagetemplate.pagetemplatefile.PageTemplateFile(
             self._testfile('bigtable_python_zope.pt'))

Modified: z3c.pt/trunk/buildout.cfg
===================================================================
--- z3c.pt/trunk/buildout.cfg	2008-08-08 10:16:44 UTC (rev 89540)
+++ z3c.pt/trunk/buildout.cfg	2008-08-08 10:43:40 UTC (rev 89541)
@@ -23,7 +23,6 @@
 
 [benchmark-environment]
 Z3C_PT_DEBUG = False
-Z3C_PT_FILECACHE = ${buildout:directory}/cache
 zope_i18n_allowed_languages = en, da, de
 
 [py]

Modified: z3c.pt/trunk/src/z3c/pt/loader.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/loader.py	2008-08-08 10:16:44 UTC (rev 89540)
+++ z3c.pt/trunk/src/z3c/pt/loader.py	2008-08-08 10:43:40 UTC (rev 89541)
@@ -13,7 +13,7 @@
         self.cachedir = cachedir
         if cachedir is not None:
             if not os.path.isdir(cachedir):
-                raise ValueError, "Invalid cachedir")
+                raise ValueError("Invalid cachedir")
 
 
     def _load(self, filename, klass):



More information about the Checkins mailing list