From 251945283436521898149e2943818a670bc3ff84 Mon Sep 17 00:00:00 2001 From: Costa Shulyupin Date: Thu, 26 Jul 2018 08:36:48 +0300 Subject: [PATCH] *import_cflow --- srcxray.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/srcxray.py b/srcxray.py index 785a2ad..05e4978 100755 --- a/srcxray.py +++ b/srcxray.py @@ -452,16 +452,25 @@ def cflow_preprocess(a): sys.stdout.write(s) -def import_cflow(): - cf = nx.DiGraph() +def import_cflow(a=None): + if not a: + # arg = "$(find -name '*.[ch]' -o -name '*.cpp' -o -name '*.hh')" + arg = "*.c *.h *.cpp *.hh " + elif isinstance(a, list): + pass + elif os.path.isdir(a): + pass + elif os.path.isfile(a): + arg = a + pass + cf = my_graph() stack = list() nprev = -1 # "--depth=%d " %(level_limit+1) + cflow = (r"cflow " + "--preprocess='srcxray.py cflow_preprocess' " + "--include=_sxt --brief --level-indent='0=\t' " + - " *.[ch] *.cpp *.hh ") - # " $(find -name '*.[ch]' -o -name '*.cpp' -o -name '*.hh') " + arg) for line in popen(cflow): # --print-level m = re.match(r'^([\t]*)([^(^ ^<]+)', str(line))