diff roundup/cgi/engine_zopetal.py @ 4749:0421390b3094

templating: Move common TAL methods to TALLoaderBase class
author anatoly techtonik <techtonik@gmail.com>
date Tue, 22 Jan 2013 17:29:06 +0300
parents fe9568a6cbd6
children 198b6e810c67
line wrap: on
line diff
--- a/roundup/cgi/engine_zopetal.py	Mon Jan 21 23:51:39 2013 +0300
+++ b/roundup/cgi/engine_zopetal.py	Tue Jan 22 17:29:06 2013 +0300
@@ -8,29 +8,22 @@
 import os
 import os.path
 
-from roundup.cgi.templating import StringIO, context, translationService, LoaderBase
+from roundup.cgi.templating import StringIO, context, translationService, TALLoaderBase
 from roundup.cgi.PageTemplates import PageTemplate, GlobalTranslationService
 from roundup.cgi.PageTemplates.Expressions import getEngine
 from roundup.cgi.TAL import TALInterpreter
 
 GlobalTranslationService.setGlobalTranslationService(translationService)
 
-class Loader(LoaderBase):
+class Loader(TALLoaderBase):
     templates = {}
 
     def __init__(self, dir):
         self.dir = dir
 
-    def check(self, name):
-        for extension in ['', '.html', '.xml']:
-            f = name + extension
-            src = os.path.join(self.dir, f)
-            if os.path.exists(src):
-                return (src, f)
-
     def load(self, tplname):
         # find the source
-        src, filename = self.check(tplname)
+        src, filename = self._find(tplname)
 
         # has it changed?
         try:

Roundup Issue Tracker: http://roundup-tracker.org/