@@ -288,7 +288,7 @@ def __str__(self):
288288
289289class LoaderBase :
290290 """ Base for engine-specific template Loader class."""
291- def __init__ (self , dir ):
291+ def __init__ (self , template_dir ):
292292 # loaders are given the template directory as a first argument
293293 pass
294294
@@ -317,13 +317,13 @@ def check(self, name):
317317class TALLoaderBase (LoaderBase ):
318318 """ Common methods for the legacy TAL loaders."""
319319
320- def __init__ (self , dir ):
321- self .dir = dir
320+ def __init__ (self , template_dir ):
321+ self .template_dir = template_dir
322322
323323 def _find (self , name ):
324324 """ Find template, return full path and filename of the
325325 template if it is found, None otherwise."""
326- realsrc = os .path .realpath (self .dir )
326+ realsrc = os .path .realpath (self .template_dir )
327327 for extension in ['' , '.html' , '.xml' ]:
328328 f = name + extension
329329 src = os .path .join (realsrc , f )
@@ -338,7 +338,7 @@ def check(self, name):
338338
339339 def precompile (self ):
340340 """ Precompile templates in load directory by loading them """
341- for filename in os .listdir (self .dir ):
341+ for filename in os .listdir (self .template_dir ):
342342 # skip subdirs
343343 if os .path .isdir (filename ):
344344 continue
@@ -392,7 +392,7 @@ class TemplateBase:
392392 content_type = 'text/html'
393393
394394
395- def get_loader (dir , template_engine ):
395+ def get_loader (template_dir , template_engine ):
396396
397397 # Support for multiple engines using fallback mechanizm
398398 # meaning that if first engine can't find template, we
@@ -411,7 +411,7 @@ def get_loader(dir, template_engine):
411411 from .engine_zopetal import Loader
412412 else :
413413 raise Exception ('Unknown template engine "%s"' % engine_name )
414- ml .add_loader (Loader (dir ))
414+ ml .add_loader (Loader (template_dir ))
415415
416416 if len (engines ) == 1 :
417417 return ml .loaders [0 ]
@@ -3110,18 +3110,18 @@ def _parse_sort(self, var, name):
31103110 cls = self .client .db .getclass (self .classname )
31113111 for f , d in zip_longest (fields , dirs ):
31123112 if f .startswith ('-' ):
3113- dir , propname = '-' , f [1 :]
3113+ direction , propname = '-' , f [1 :]
31143114 elif d :
3115- dir , propname = '-' , f
3115+ direction , propname = '-' , f
31163116 else :
3117- dir , propname = '+' , f
3117+ direction , propname = '+' , f
31183118 # if no classname, just append the propname unchecked.
31193119 # this may be valid for some actions that bypass classes.
31203120 if self .classname and cls .get_transitive_prop (propname ) is None :
31213121 self .client .add_error_message ("Unknown %s property %s" % (
31223122 name , propname ))
31233123 else :
3124- var .append ((dir , propname ))
3124+ var .append ((direction , propname ))
31253125
31263126 def _form_has_key (self , name ):
31273127 try :
@@ -3297,16 +3297,16 @@ def add(k, v):
32973297 add (sc + 'columns' , ',' .join (self .columns ))
32983298 if sort :
32993299 val = []
3300- for dir , attr in self .sort :
3301- if dir == '-' :
3300+ for direction , attr in self .sort :
3301+ if direction == '-' :
33023302 val .append ('-' + attr )
33033303 else :
33043304 val .append (attr )
33053305 add (sc + 'sort' , ',' .join (val ))
33063306 if group :
33073307 val = []
3308- for dir , attr in self .group :
3309- if dir == '-' :
3308+ for direction , attr in self .group :
3309+ if direction == '-' :
33103310 val .append ('-' + attr )
33113311 else :
33123312 val .append (attr )
@@ -3362,16 +3362,16 @@ def indexargs_url(self, url, args):
33623362 l .append (sc + 'columns=%s' % (',' .join (self .columns )))
33633363 if self .sort and 'sort' not in specials :
33643364 val = []
3365- for dir , attr in self .sort :
3366- if dir == '-' :
3365+ for direction , attr in self .sort :
3366+ if direction == '-' :
33673367 val .append ('-' + attr )
33683368 else :
33693369 val .append (attr )
33703370 l .append (sc + 'sort=%s' % (',' .join (val )))
33713371 if self .group and 'group' not in specials :
33723372 val = []
3373- for dir , attr in self .group :
3374- if dir == '-' :
3373+ for direction , attr in self .group :
3374+ if direction == '-' :
33753375 val .append ('-' + attr )
33763376 else :
33773377 val .append (attr )
0 commit comments