[Zope3-checkins] SVN: Zope3/trunk/ - removed `usage` cruft

Christian Theune ct at gocept.com
Tue Sep 5 17:25:20 EDT 2006


Log message for revision 69980:
   - removed `usage` cruft
  

Changed:
  U   Zope3/trunk/doc/CHANGES.txt
  U   Zope3/trunk/src/zope/pagetemplate/pagetemplate.py
  D   Zope3/trunk/src/zope/pagetemplate/tests/input/template_usage.html
  D   Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage1.html
  D   Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage2.html
  D   Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage3.html
  D   Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage4.html
  U   Zope3/trunk/src/zope/pagetemplate/tests/test_basictemplate.py

-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt	2006-09-05 18:10:10 UTC (rev 69979)
+++ Zope3/trunk/doc/CHANGES.txt	2006-09-05 21:25:20 UTC (rev 69980)
@@ -32,6 +32,9 @@
       - Removed internal concept of 'warnings' from TAL interpreter as it
         wasn't used at all and does not belongt to any public interface.
 
+      - Removed some cruft from pre-3.0 page templates (The concept of `usage`
+        was removed back then already.)
+
     Bug fixes
 
       - Fixed issue 705, double URL unquoting of GET parameters in

Modified: Zope3/trunk/src/zope/pagetemplate/pagetemplate.py
===================================================================
--- Zope3/trunk/src/zope/pagetemplate/pagetemplate.py	2006-09-05 18:10:10 UTC (rev 69979)
+++ Zope3/trunk/src/zope/pagetemplate/pagetemplate.py	2006-09-05 21:25:20 UTC (rev 69980)
@@ -86,7 +86,6 @@
                 'options': options,
                 'args': args,
                 'nothing': None,
-                'usage': TemplateUsage(options.get("template_usage", u'')),
                 }
         rval.update(self.pt_getEngine().getBaseNames())
         return rval
@@ -197,28 +196,6 @@
         self._v_cooked = 1
 
 
-class TemplateUsage(object):
-    def __init__(self, value):
-        if not isinstance(value, unicode):
-            raise TypeError('TemplateUsage should be initialized with a '
-                            'Unicode string',
-                            repr(value))
-        self.stringValue = value
-
-    def __str__(self):
-        return self.stringValue
-
-    def __getitem__(self, key):
-        if key == self.stringValue:
-            return self.stringValue
-        else:
-            return None
-
-    def __nonzero__(self):
-        return self.stringValue <> u''
-
-
-
 class PTRuntimeError(RuntimeError):
     '''The Page Template has template errors that prevent it from rendering.'''
     pass

Deleted: Zope3/trunk/src/zope/pagetemplate/tests/input/template_usage.html
===================================================================
--- Zope3/trunk/src/zope/pagetemplate/tests/input/template_usage.html	2006-09-05 18:10:10 UTC (rev 69979)
+++ Zope3/trunk/src/zope/pagetemplate/tests/input/template_usage.html	2006-09-05 21:25:20 UTC (rev 69980)
@@ -1,15 +0,0 @@
-<html xmlns:tal="http://xml.zope.org/namespaces/tal">
-  <head><title>Test of documentation templates</title></head>
-  <body>
-      <span tal:content="usage"> blah </span>
-      <p tal:condition="usage">
-      usage is defined.
-      </p>
-      <p tal:condition="usage/test">
-      This is test.
-      </p>
-      <p tal:condition="usage/retest">
-      This is retest.
-      </p>
-  </body>
-</html>

Deleted: Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage1.html
===================================================================
--- Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage1.html	2006-09-05 18:10:10 UTC (rev 69979)
+++ Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage1.html	2006-09-05 21:25:20 UTC (rev 69980)
@@ -1,12 +0,0 @@
-<html>
-  <head><title>Test of documentation templates</title></head>
-  <body>
-      <span>test</span>
-      <p>
-      usage is defined.
-      </p>
-      <p>
-      This is test.
-      </p>
-  </body>
-</html>

Deleted: Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage2.html
===================================================================
--- Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage2.html	2006-09-05 18:10:10 UTC (rev 69979)
+++ Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage2.html	2006-09-05 21:25:20 UTC (rev 69980)
@@ -1,12 +0,0 @@
-<html>
-  <head><title>Test of documentation templates</title></head>
-  <body>
-      <span>retest</span>
-      <p>
-      usage is defined.
-      </p>
-      <p>
-      This is retest.
-      </p>
-  </body>
-</html>

Deleted: Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage3.html
===================================================================
--- Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage3.html	2006-09-05 18:10:10 UTC (rev 69979)
+++ Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage3.html	2006-09-05 21:25:20 UTC (rev 69980)
@@ -1,9 +0,0 @@
-<html>
-  <head><title>Test of documentation templates</title></head>
-  <body>
-      <span>other</span>
-      <p>
-      usage is defined.
-      </p>
-  </body>
-</html>

Deleted: Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage4.html
===================================================================
--- Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage4.html	2006-09-05 18:10:10 UTC (rev 69979)
+++ Zope3/trunk/src/zope/pagetemplate/tests/output/template_usage4.html	2006-09-05 21:25:20 UTC (rev 69980)
@@ -1,6 +0,0 @@
-<html>
-  <head><title>Test of documentation templates</title></head>
-  <body>
-      <span></span>
-  </body>
-</html>

Modified: Zope3/trunk/src/zope/pagetemplate/tests/test_basictemplate.py
===================================================================
--- Zope3/trunk/src/zope/pagetemplate/tests/test_basictemplate.py	2006-09-05 18:10:10 UTC (rev 69979)
+++ Zope3/trunk/src/zope/pagetemplate/tests/test_basictemplate.py	2006-09-05 21:25:20 UTC (rev 69980)
@@ -61,26 +61,6 @@
         expect = util.read_output('dtml1b.html')
         util.check_xml(expect, o)
 
-    def test_template_usage(self):
-        tal = util.read_input('template_usage.html')
-        self.t.write(tal)
-
-        o = self.t(template_usage=u"test")
-        expect = util.read_output('template_usage1.html')
-        util.check_xml(expect, o)
-
-        o = self.t(template_usage=u"retest")
-        expect = util.read_output('template_usage2.html')
-        util.check_xml(expect, o)
-
-        o = self.t(template_usage=u"other")
-        expect = util.read_output('template_usage3.html')
-        util.check_xml(expect, o)
-
-        o = self.t(template_usage=u"")
-        expect = util.read_output('template_usage4.html')
-        util.check_xml(expect, o)
-
     def test_batches_and_formatting(self):
         # DTML test 3: batches and formatting:
         pass # for unittest



More information about the Zope3-Checkins mailing list