From: Ant Zucaro Date: Mon, 12 May 2014 21:24:45 +0000 (-0400) Subject: Rename a parameter to better represent what it does. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6b6db5024fc31c9c35a20fb9433cbb43e2ab609c;p=xonotic%2Fxonstat.git Rename a parameter to better represent what it does. --- diff --git a/xonstat/util.py b/xonstat/util.py index dc752f7..4f4581b 100644 --- a/xonstat/util.py +++ b/xonstat/util.py @@ -140,10 +140,10 @@ _hex_colors = re.compile(r'\^x([\dA-Fa-f])([\dA-Fa-f])([\dA-Fa-f])') _contrast_threshold = 0.5 -def qfont_decode(qstr='', for_html=False): +def qfont_decode(qstr='', glyph_translation=False): """ Convert the qfont characters in a string to ascii. - for_html - determines whether to convert the unicode characters to + glyph_translation - determines whether to convert the unicode characters to their ascii counterparts (if False, the default) or to the mapped glyph in the Xolonium font (if True). """ @@ -152,7 +152,7 @@ def qfont_decode(qstr='', for_html=False): chars = [] for c in qstr: if u'\ue000' <= c <= u'\ue0ff': - if for_html: + if glyph_translation: c = _qfont_unicode_glyphs[ord(c) - 0xe000] else: c = _qfont_ascii_table[ord(c) - 0xe000] @@ -186,7 +186,7 @@ def hex_repl(match): def html_colors(qstr='', limit=None): - qstr = html_escape(qfont_decode(qstr, for_html=True)) + qstr = html_escape(qfont_decode(qstr, glyph_translation=True)) qstr = qstr.replace('^^', '^') if limit is not None and limit > 0: