From 6b6db5024fc31c9c35a20fb9433cbb43e2ab609c Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 12 May 2014 17:24:45 -0400 Subject: [PATCH] Rename a parameter to better represent what it does. --- xonstat/util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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: -- 2.39.2