comparison mercurial/templatefilters.py @ 36552:a185b1af207c

templatefilters: stop using str as a variable name str() is an inbuilt function. Differential Revision: https://phab.mercurial-scm.org/D2531
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 02 Mar 2018 04:59:27 +0530
parents b546181ae451
children 9d71bd25554b
comparison
equal deleted inserted replaced
36551:98d4c642d7f2 36552:a185b1af207c
262 def lower(text): 262 def lower(text):
263 """Any text. Converts the text to lowercase.""" 263 """Any text. Converts the text to lowercase."""
264 return encoding.lower(text) 264 return encoding.lower(text)
265 265
266 @templatefilter('nonempty') 266 @templatefilter('nonempty')
267 def nonempty(str): 267 def nonempty(text):
268 """Any text. Returns '(none)' if the string is empty.""" 268 """Any text. Returns '(none)' if the string is empty."""
269 return str or "(none)" 269 return text or "(none)"
270 270
271 @templatefilter('obfuscate') 271 @templatefilter('obfuscate')
272 def obfuscate(text): 272 def obfuscate(text):
273 """Any text. Returns the input text rendered as a sequence of 273 """Any text. Returns the input text rendered as a sequence of
274 XML entities. 274 XML entities.