##// END OF EJS Templates
templatekw: eliminate unnecessary temporary variable 'names' from _showlist()...
Yuya Nishihara -
r32034:579bbcb4 default
parent child Browse files
Show More
@@ -106,11 +106,10 b' def _showlist(name, values, plural=None,'
106 expand 'end_foos'.
106 expand 'end_foos'.
107 '''
107 '''
108 templ = args['templ']
108 templ = args['templ']
109 if plural:
109 if not plural:
110 names = plural
110 plural = name + 's'
111 else: names = name + 's'
112 if not values:
111 if not values:
113 noname = 'no_' + names
112 noname = 'no_' + plural
114 if noname in templ:
113 if noname in templ:
115 yield templ(noname, **args)
114 yield templ(noname, **args)
116 return
115 return
@@ -121,7 +120,7 b' def _showlist(name, values, plural=None,'
121 for v in values:
120 for v in values:
122 yield dict(v, **args)
121 yield dict(v, **args)
123 return
122 return
124 startname = 'start_' + names
123 startname = 'start_' + plural
125 if startname in templ:
124 if startname in templ:
126 yield templ(startname, **args)
125 yield templ(startname, **args)
127 vargs = args.copy()
126 vargs = args.copy()
@@ -144,7 +143,7 b' def _showlist(name, values, plural=None,'
144 yield one(v)
143 yield one(v)
145 if last is not None:
144 if last is not None:
146 yield one(last, tag=lastname)
145 yield one(last, tag=lastname)
147 endname = 'end_' + names
146 endname = 'end_' + plural
148 if endname in templ:
147 if endname in templ:
149 yield templ(endname, **args)
148 yield templ(endname, **args)
150
149
General Comments 0
You need to be logged in to leave comments. Login now