[Zope3-checkins] SVN: Zope3/trunk/src/zope/tal/dummyengine.py - remove unused function: findMacroDocument()

Fred L. Drake, Jr. fdrake at gmail.com
Thu Oct 21 09:58:23 EDT 2004


Log message for revision 28231:
  - remove unused function: findMacroDocument()
  - organize methods by interface
  - add some comments for internal methods and subclass-overridable methods
  

Changed:
  U   Zope3/trunk/src/zope/tal/dummyengine.py

-=-
Modified: Zope3/trunk/src/zope/tal/dummyengine.py
===================================================================
--- Zope3/trunk/src/zope/tal/dummyengine.py	2004-10-21 13:46:48 UTC (rev 28230)
+++ Zope3/trunk/src/zope/tal/dummyengine.py	2004-10-21 13:58:22 UTC (rev 28231)
@@ -47,18 +47,22 @@
         self.translationDomain = DummyTranslationDomain()
         self.useEngineAttrDicts = False
 
+    # zope.tal.interfaces.ITALExpressionCompiler
+
     def getCompilerError(self):
         return CompilerError
 
+    def compile(self, expr):
+        return "$%s$" % expr
+
+    # zope.tal.interfaces.ITALExpressionEngine
+
     def setSourceFile(self, source_file):
         self.source_file = source_file
 
     def setPosition(self, position):
         self.position = position
 
-    def compile(self, expr):
-        return "$%s$" % expr
-
     def beginScope(self):
         self.stack.append(self.locals)
 
@@ -115,6 +119,7 @@
             return '%s (%s,%s)' % (self.source_file, lineno, offset)
         raise TALExpressionError("unrecognized expression: " + `expression`)
 
+    # implementation; can be overridden
     def evaluatePathOrVar(self, expr):
         expr = expr.strip()
         if self.locals.has_key(expr):
@@ -142,6 +147,7 @@
         # TODO Should return None or a DOM tree
         return self.evaluate(expr)
 
+    # implementation; can be overridden
     def evaluateSequence(self, expr):
         # TODO: Should return a sequence
         return self.evaluate(expr)
@@ -164,14 +170,7 @@
                                          (localName, file))
         return macro
 
-    def findMacroDocument(self, macroName):
-        file, localName = self.findMacroFile(macroName)
-        if not file:
-            return file, localName
-        import driver
-        doc = driver.parsefile(file)
-        return doc, localName
-
+    # internal
     def findMacroFile(self, macroName):
         if not macroName:
             raise TALExpressionError("empty macro name")



More information about the Zope3-Checkins mailing list