Skip to content

Commit b57a0cd

Browse files
author
Richard Jones
committed
oops
1 parent 119f33b commit b57a0cd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

roundup/cgi/templating.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ def __str__(self):
6969
'items of class %(class)s') % {
7070
'action': self.action, 'class': self.klass}
7171

72-
def find_template(dir, name, extension):
72+
def find_template(dir, name, view):
7373
''' Find a template in the nominated dir
7474
'''
7575
# find the source
76-
if extension:
77-
filename = '%s.%s'%(name, extension)
76+
if view:
77+
filename = '%s.%s'%(name, view)
7878
else:
7979
filename = name
8080

@@ -90,12 +90,12 @@ def find_template(dir, name, extension):
9090
if os.path.exists(src):
9191
return (src, filename)
9292

93-
# no extension == no generic template is possible
94-
if not extension:
93+
# no view == no generic template is possible
94+
if not view:
9595
raise NoTemplate, 'Template file "%s" doesn\'t exist'%name
9696

9797
# try for a _generic template
98-
generic = '_generic.%s'%extension
98+
generic = '_generic.%s'%view
9999
src = os.path.join(dir, generic)
100100
if os.path.exists(src):
101101
return (src, generic)
@@ -107,7 +107,7 @@ def find_template(dir, name, extension):
107107
return (src, generic)
108108

109109
raise NoTemplate, 'No template file exists for templating "%s" '\
110-
'with template "%s" (neither "%s" nor "%s")'%(name, extension,
110+
'with template "%s" (neither "%s" nor "%s")'%(name, view,
111111
filename, generic)
112112

113113
class Templates:
@@ -123,14 +123,15 @@ def precompileTemplates(self):
123123
# skip subdirs
124124
if os.path.isdir(filename):
125125
continue
126+
126127
# skip files without ".html" or ".xml" extension - .css, .js etc.
127128
for extension in '.html', '.xml':
128129
if filename.endswith(extension):
129130
break
130131
else:
131132
continue
132133

133-
# remove "html" extension
134+
# remove extension
134135
filename = filename[:-len(extension)]
135136

136137
# load the template

0 commit comments

Comments
 (0)