*import_cflow
This commit is contained in:
parent
f7f8f9a7fa
commit
2519452834
17
srcxray.py
17
srcxray.py
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue