[ZPT] CVS: Zope3/lib/python/Zope/TAL - DummyEngine.py:1.28.14.3.4.2

Barry Warsaw barry@wooz.org
Tue, 4 Jun 2002 12:40:37 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/TAL
In directory cvs.zope.org:/tmp/cvs-serv7629

Modified Files:
      Tag: fdrake-tal-i18n-branch
	DummyEngine.py 
Log Message:
evaluateMacro(), findMacroDocument(): Don't import the driver module
at the top level because it' imposes too may cross dependencies with
the DummyEngine module.  Instead just import the function when needed.


=== Zope3/lib/python/Zope/TAL/DummyEngine.py 1.28.14.3.4.1 => 1.28.14.3.4.2 ===
 import sys
 
-import driver
-
 from TALDefs import NAME_RE, TALESError, ErrorInfo
 
 Default = object()
@@ -136,7 +134,8 @@
             macro = self.macros[localName]
         else:
             # External macro
-            program, macros = driver.compilefile(file)
+            from driver import compilefile
+            program, macros = compilefile(file)
             macro = macros.get(localName)
             if not macro:
                 raise TALESError("macro %s not found in file %s" %
@@ -147,7 +146,8 @@
         file, localName = self.findMacroFile(macroName)
         if not file:
             return file, localName
-        doc = driver.parsefile(file)
+        from driver import parsefile
+        doc = parsefile(file)
         return doc, localName
 
     def findMacroFile(self, macroName):