*import_cflow

This commit is contained in:
Costa Shulyupin 2018-07-26 08:36:48 +03:00
parent f7f8f9a7fa
commit 2519452834
1 changed files with 13 additions and 4 deletions

View File

@ -452,16 +452,25 @@ def cflow_preprocess(a):
sys.stdout.write(s) sys.stdout.write(s)
def import_cflow(): def import_cflow(a=None):
cf = nx.DiGraph() 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() stack = list()
nprev = -1 nprev = -1
# "--depth=%d " %(level_limit+1) + # "--depth=%d " %(level_limit+1) +
cflow = (r"cflow " + cflow = (r"cflow " +
"--preprocess='srcxray.py cflow_preprocess' " + "--preprocess='srcxray.py cflow_preprocess' " +
"--include=_sxt --brief --level-indent='0=\t' " + "--include=_sxt --brief --level-indent='0=\t' " +
" *.[ch] *.cpp *.hh ") arg)
# " $(find -name '*.[ch]' -o -name '*.cpp' -o -name '*.hh') "
for line in popen(cflow): for line in popen(cflow):
# --print-level # --print-level
m = re.match(r'^([\t]*)([^(^ ^<]+)', str(line)) m = re.match(r'^([\t]*)([^(^ ^<]+)', str(line))