From 758dad6b58ecba729121f63c2306662bccef6ae8 Mon Sep 17 00:00:00 2001 From: Costa Shulyupin Date: Sat, 26 Dec 2020 15:08:50 +0200 Subject: [PATCH] show_ignored --- srcxray.py | 12 ++++++++++-- stop.txt | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 stop.txt diff --git a/srcxray.py b/srcxray.py index 45d5818..6a8d82d 100755 --- a/srcxray.py +++ b/srcxray.py @@ -43,6 +43,7 @@ import xml.etree.ElementTree as ET default_root = 'starts' ignores = list() +show_ignored = False level_limit = 6 lines = 0 lines_limit = 20 @@ -294,11 +295,18 @@ def call_tree(node, printed=None, level=0): local_printed = set() for line in popen('cscope -d -L2 "%s"' % (node)): a = line.split()[1] - if a in local_printed or a in ignores: + if a in local_printed: + continue + if a in ignores: + if show_ignored: + print_limited2((level + 1)*'\t' + '\033[2;30m' + a + + (' ^' if a in local_printed else '') + + '\033[0m') + local_printed.add(a) continue local_printed.add(a) # try: - call_tree(line.split()[1], printed, level + 1) + call_tree(a, printed, level + 1) # except Exception: # pass diff --git a/stop.txt b/stop.txt new file mode 100644 index 0000000..9c0eb3f --- /dev/null +++ b/stop.txt @@ -0,0 +1 @@ +enqueue