From 62e0033375f0bc30bed2021169efa84dc6899cc2 Mon Sep 17 00:00:00 2001 From: KalleDK Date: Mon, 26 Jan 2015 23:55:27 +0100 Subject: [PATCH 1/3] Added relative path option --- doxy-coverage.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doxy-coverage.py b/doxy-coverage.py index 96b2cd3..032a1c8 100755 --- a/doxy-coverage.py +++ b/doxy-coverage.py @@ -149,7 +149,12 @@ def file_cmp (a,b): total_yes += doc_yes total_no += doc_no - print ('%3d%% - %s - (%d of %d)'%(doc_per, f, doc_yes, (doc_yes + doc_no))) + if ns.relative: + file_path = os.path.join(os.path.relpath(os.path.dirname(f), os.path.realpath(os.path.curdir)), os.path.basename(f)) + else: + file_path = f + + print ('%3d%% - %s - (%d of %d)'%(doc_per, file_path, doc_yes, (doc_yes + doc_no))) defs_sorted = defs.keys() defs_sorted.sort() @@ -170,6 +175,7 @@ def main(): parser.add_argument ("dir", action="store", help="Path to Doxygen's XML doc directory") parser.add_argument ("--noerror", action="store_true", help="Do not return error code after execution") parser.add_argument ("--threshold", action="store", help="Min acceptable coverage percentage (Default: %s)"%(ACCEPTABLE_COVERAGE), default=ACCEPTABLE_COVERAGE, type=int) + parser.add_argument ("--relative", action="store_true", help="Use relative path for output") global ns ns = parser.parse_args() From 99250a89e2899f13ce55f67a9aa6cab91e6d3a44 Mon Sep 17 00:00:00 2001 From: KalleDK Date: Tue, 27 Jan 2015 00:35:02 +0100 Subject: [PATCH 2/3] Optional dir --- doxy-coverage.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doxy-coverage.py b/doxy-coverage.py index 032a1c8..664d860 100755 --- a/doxy-coverage.py +++ b/doxy-coverage.py @@ -150,7 +150,11 @@ def file_cmp (a,b): total_no += doc_no if ns.relative: - file_path = os.path.join(os.path.relpath(os.path.dirname(f), os.path.realpath(os.path.curdir)), os.path.basename(f)) + if os.path.exists(ns.relative): + relative_path = ns.relative + else: + relative_path = os.path.curdir + file_path = os.path.join(os.path.relpath(os.path.dirname(f), os.path.realpath(relative_path)), os.path.basename(f)) else: file_path = f @@ -175,7 +179,8 @@ def main(): parser.add_argument ("dir", action="store", help="Path to Doxygen's XML doc directory") parser.add_argument ("--noerror", action="store_true", help="Do not return error code after execution") parser.add_argument ("--threshold", action="store", help="Min acceptable coverage percentage (Default: %s)"%(ACCEPTABLE_COVERAGE), default=ACCEPTABLE_COVERAGE, type=int) - parser.add_argument ("--relative", action="store_true", help="Use relative path for output") + parser.add_argument ("--relative", nargs="?", action="store", help="Use relative path for output (Default: %s)"%(os.path.curdir), const=os.path.curdir) + global ns ns = parser.parse_args() @@ -185,6 +190,7 @@ def main(): # Parse files = parse (ns.dir) + # Print report err = report (files) if ns.noerror: From e0e1e322a113902013388e91088311dad72aa611 Mon Sep 17 00:00:00 2001 From: KalleDK Date: Tue, 27 Jan 2015 00:36:11 +0100 Subject: [PATCH 3/3] Removed space --- doxy-coverage.py | 1 - 1 file changed, 1 deletion(-) diff --git a/doxy-coverage.py b/doxy-coverage.py index 664d860..a2e2715 100755 --- a/doxy-coverage.py +++ b/doxy-coverage.py @@ -190,7 +190,6 @@ def main(): # Parse files = parse (ns.dir) - # Print report err = report (files) if ns.noerror: