@@ -288,7 +288,7 @@ def __str__(self):
288
288
289
289
class LoaderBase :
290
290
""" Base for engine-specific template Loader class."""
291
- def __init__ (self , dir ):
291
+ def __init__ (self , template_dir ):
292
292
# loaders are given the template directory as a first argument
293
293
pass
294
294
@@ -317,13 +317,13 @@ def check(self, name):
317
317
class TALLoaderBase (LoaderBase ):
318
318
""" Common methods for the legacy TAL loaders."""
319
319
320
- def __init__ (self , dir ):
321
- self .dir = dir
320
+ def __init__ (self , template_dir ):
321
+ self .template_dir = template_dir
322
322
323
323
def _find (self , name ):
324
324
""" Find template, return full path and filename of the
325
325
template if it is found, None otherwise."""
326
- realsrc = os .path .realpath (self .dir )
326
+ realsrc = os .path .realpath (self .template_dir )
327
327
for extension in ['' , '.html' , '.xml' ]:
328
328
f = name + extension
329
329
src = os .path .join (realsrc , f )
@@ -338,7 +338,7 @@ def check(self, name):
338
338
339
339
def precompile (self ):
340
340
""" 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 ):
342
342
# skip subdirs
343
343
if os .path .isdir (filename ):
344
344
continue
@@ -392,7 +392,7 @@ class TemplateBase:
392
392
content_type = 'text/html'
393
393
394
394
395
- def get_loader (dir , template_engine ):
395
+ def get_loader (template_dir , template_engine ):
396
396
397
397
# Support for multiple engines using fallback mechanizm
398
398
# meaning that if first engine can't find template, we
@@ -411,7 +411,7 @@ def get_loader(dir, template_engine):
411
411
from .engine_zopetal import Loader
412
412
else :
413
413
raise Exception ('Unknown template engine "%s"' % engine_name )
414
- ml .add_loader (Loader (dir ))
414
+ ml .add_loader (Loader (template_dir ))
415
415
416
416
if len (engines ) == 1 :
417
417
return ml .loaders [0 ]
@@ -3110,18 +3110,18 @@ def _parse_sort(self, var, name):
3110
3110
cls = self .client .db .getclass (self .classname )
3111
3111
for f , d in zip_longest (fields , dirs ):
3112
3112
if f .startswith ('-' ):
3113
- dir , propname = '-' , f [1 :]
3113
+ direction , propname = '-' , f [1 :]
3114
3114
elif d :
3115
- dir , propname = '-' , f
3115
+ direction , propname = '-' , f
3116
3116
else :
3117
- dir , propname = '+' , f
3117
+ direction , propname = '+' , f
3118
3118
# if no classname, just append the propname unchecked.
3119
3119
# this may be valid for some actions that bypass classes.
3120
3120
if self .classname and cls .get_transitive_prop (propname ) is None :
3121
3121
self .client .add_error_message ("Unknown %s property %s" % (
3122
3122
name , propname ))
3123
3123
else :
3124
- var .append ((dir , propname ))
3124
+ var .append ((direction , propname ))
3125
3125
3126
3126
def _form_has_key (self , name ):
3127
3127
try :
@@ -3297,16 +3297,16 @@ def add(k, v):
3297
3297
add (sc + 'columns' , ',' .join (self .columns ))
3298
3298
if sort :
3299
3299
val = []
3300
- for dir , attr in self .sort :
3301
- if dir == '-' :
3300
+ for direction , attr in self .sort :
3301
+ if direction == '-' :
3302
3302
val .append ('-' + attr )
3303
3303
else :
3304
3304
val .append (attr )
3305
3305
add (sc + 'sort' , ',' .join (val ))
3306
3306
if group :
3307
3307
val = []
3308
- for dir , attr in self .group :
3309
- if dir == '-' :
3308
+ for direction , attr in self .group :
3309
+ if direction == '-' :
3310
3310
val .append ('-' + attr )
3311
3311
else :
3312
3312
val .append (attr )
@@ -3362,16 +3362,16 @@ def indexargs_url(self, url, args):
3362
3362
l .append (sc + 'columns=%s' % (',' .join (self .columns )))
3363
3363
if self .sort and 'sort' not in specials :
3364
3364
val = []
3365
- for dir , attr in self .sort :
3366
- if dir == '-' :
3365
+ for direction , attr in self .sort :
3366
+ if direction == '-' :
3367
3367
val .append ('-' + attr )
3368
3368
else :
3369
3369
val .append (attr )
3370
3370
l .append (sc + 'sort=%s' % (',' .join (val )))
3371
3371
if self .group and 'group' not in specials :
3372
3372
val = []
3373
- for dir , attr in self .group :
3374
- if dir == '-' :
3373
+ for direction , attr in self .group :
3374
+ if direction == '-' :
3375
3375
val .append ('-' + attr )
3376
3376
else :
3377
3377
val .append (attr )
0 commit comments