diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2021-12-18 01:31:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-18 01:31:31 -0700 |
| commit | 432e9e45c547eeddad3ddb012d4615f900530d00 (patch) | |
| tree | 6fce60b3d8ea2c989fa2a20d9b7008a46a2629ec /progress.py | |
| parent | 93134bb0d4ca020e89549ec90732dd3db3326a79 (diff) | |
Remove git dependancy (#100)
Diffstat (limited to 'progress.py')
| -rw-r--r-- | progress.py | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/progress.py b/progress.py index a907280e3..a7b921cf3 100644 --- a/progress.py +++ b/progress.py @@ -3,12 +3,11 @@ import argparse import json import csv -import git import os import re parser = argparse.ArgumentParser(description="Computes current progress throughout the whole project.") -parser.add_argument("format", nargs="?", default="text", choices=["text", "csv", "shield-json"]) +parser.add_argument("format", nargs="?", default="text", choices=["text", "shield-json", "badge1"]) parser.add_argument("-m", "--matching", dest='matching', action='store_true', help="Output matching progress instead of decompilation progress") args = parser.parse_args() @@ -258,21 +257,21 @@ seg3Pct = 100 * seg3 / seg3_size bytesPerHeartPiece = text_size // 80 -if args.format == 'csv': - version = 1 - git_object = git.Repo().head.object - timestamp = str(git_object.committed_date) - git_hash = git_object.hexsha - - csv_list = [str(version), timestamp, git_hash, - str(text_size), str(mk64Code_size), str(src), str(srcPct), - str(audio), str(audio_size), str(audioPct), str(libultra), - str(libultra_size), str(libultraPct), str(seg2), str(seg2_size), - str(seg2Pct), str(seg3), str(seg3_size), str(seg3Pct), - str(TotalNonMatchingFunctions), str(TotalMipsToCFunctions)] - - print(",".join(csv_list)) -elif args.format == 'shield-json': +#if args.format == 'csv': +# version = 1 +# git_object = git.Repo().head.object +# timestamp = str(git_object.committed_date) +# git_hash = git_object.hexsha + +# csv_list = [str(version), timestamp, git_hash, +# str(text_size), str(mk64Code_size), str(src), str(srcPct), +# str(audio), str(audio_size), str(audioPct), str(libultra), +# str(libultra_size), str(libultraPct), str(seg2), str(seg2_size), +# str(seg2Pct), str(seg3), str(seg3_size), str(seg3Pct), +# str(TotalNonMatchingFunctions), str(TotalMipsToCFunctions)] + +# print(",".join(csv_list)) +if args.format == 'shield-json': # https://shields.io/endpoint print(json.dumps({ "schemaVersion": 1, @@ -280,6 +279,8 @@ elif args.format == 'shield-json': "message": f"{srcPct:.3g}%", "color": 'yellow', })) +elif args.format == 'badge1': + print(str(round(srcPct, 2))+"%") elif args.format == 'text': adjective = "decompiled" if not args.matching else "matched" |
