diff --git a/zoomeye/__init__.py b/zoomeye/__init__.py index 1a8c58c..9689819 100644 --- a/zoomeye/__init__.py +++ b/zoomeye/__init__.py @@ -11,5 +11,5 @@ __name__ = 'zoomeye' __package__ = 'zoomeye' -__version__ = ' 2.0.4.3' +__version__ = ' 2.0.4.4' __site__ = "https://www.zoomeye.org/doc" diff --git a/zoomeye/show.py b/zoomeye/show.py index ddb155e..fb60960 100644 --- a/zoomeye/show.py +++ b/zoomeye/show.py @@ -34,15 +34,15 @@ def convert_str(s): d = { '\n': '\\n', '\r': '\\r', - '\t': '\\t' + '\t': '\\t', + '\b': '\\b', + '\a': '\\a', } for c in s: - if ord(c) in range(32, 127): - res.append(c) - elif c in d.keys(): + if c in d.keys(): res.append(d[c]) else: - res.append('\\x%.2x' % ord(c)) + res.append(c) return ''.join(res) @@ -320,9 +320,9 @@ def print_filter_history(fileds, hist_data, condition=None): for condition_item in condition: k, v = condition_item.split('=') re_result = re.search(str(v), str(item_item), re.I | re.M) - content = "\033[31m{}\033[0m".format(re_result.group()) # replace to highlight if re_result: - item_item = item_item.replace(re_result.group(), content) + content_item = "\033[31m{}\033[0m".format(re_result.group()) + item_item = str(item_item).replace(re_result.group(), content_item) content += "{:<27}".format(item_item) printf(content)