mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 05:03:43 +01:00
Allow cov-display to take directories as arguments
This commit is contained in:
parent
1d63ecbed0
commit
ebff18d18e
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
import sys, re
|
||||
import sys, re, os
|
||||
|
||||
none0, some0 = 0,0
|
||||
branchTaken0, branchNot0 = 0,0
|
||||
@ -20,7 +20,16 @@ def show(name, none, some):
|
||||
none = 1
|
||||
print name, none, some, "%.02f"%(100*(float(some)/(some+none)))
|
||||
|
||||
for fn in sys.argv[1:]:
|
||||
|
||||
file_args = sys.argv[1:]
|
||||
files = []
|
||||
for fn in file_args:
|
||||
if os.path.isdir(fn):
|
||||
files.extend(os.path.join(fn, f) for f in os.listdir(fn))
|
||||
else:
|
||||
files.append(fn)
|
||||
|
||||
for fn in files:
|
||||
none = some = branchTaken = branchNot = 0
|
||||
inFunc = ""
|
||||
for line in open(fn, 'r'):
|
||||
|
Loading…
Reference in New Issue
Block a user