mirror of https://github.com/zeldaret/tmc.git
Merge pull request #206 from EllipticEllipsis/progress_reformat
This commit is contained in:
commit
f0a7a8fa51
|
|
@ -26,8 +26,9 @@ pipeline {
|
|||
}
|
||||
steps {
|
||||
sh 'mkdir reports'
|
||||
sh 'python3 progress.py >> reports/progress_tmc.csv'
|
||||
sh 'python3 progress.py -m >> reports/progress_tmc_matching.csv'
|
||||
sh 'python3 progress.py csv >> reports/progress-tmc-nonmatching.csv'
|
||||
sh 'python3 progress.py csv -m >> reports/progress-tmc-matching.csv'
|
||||
sh 'python3 progress.py shield-json > reports/progress-tmc-shield.json'
|
||||
stash includes: 'reports/*', name: 'reports'
|
||||
}
|
||||
}
|
||||
|
|
@ -40,8 +41,9 @@ pipeline {
|
|||
}
|
||||
steps {
|
||||
unstash 'reports'
|
||||
sh 'cat reports/progress_tmc.csv >> /var/www/html/reports/progress_tmc.csv'
|
||||
sh 'cat reports/progress_tmc_matching.csv >> /var/www/html/reports/progress_tmc_matching.csv'
|
||||
sh 'cat reports/progress-tmc-nonmatching.csv >> /var/www/zelda64.dev/assets/csv/progress-tmc-nonmatching.csv'
|
||||
sh 'cat reports/progress-tmc-matching.csv >> /var/www/zelda64.dev/assets/csv/progress-tmc-matching.csv'
|
||||
sh 'cat reports/progress-tmc-shield.json > /var/www/zelda64.dev/assets/csv/progress-tmc-shield.json'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
15
README.md
15
README.md
|
|
@ -1,6 +1,19 @@
|
|||
# The Legend of Zelda: The Minish Cap
|
||||
|
||||
**Progress:** [⬛⬛⬛⬛⬛⬛⬛⬛⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜] 45%
|
||||
|
||||
[![Build Status][jenkins-badge]][jenkins] [![Decompilation Progress][progress-badge]][progress] [![Contributors][contributors-badge]][contributors] [![Discord Channel][discord-badge]][discord]
|
||||
|
||||
[jenkins]: https://jenkins.deco.mp/job/TMC/job/master
|
||||
[jenkins-badge]: https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins.deco.mp%2Fjob%2FTMC%2Fjob%2Fmaster
|
||||
|
||||
[progress]: https://zelda64.dev/games/tmc
|
||||
[progress-badge]: https://img.shields.io/endpoint?url=https://zelda64.dev/assets/csv/progress-tmc-shield.json
|
||||
|
||||
[contributors]: https://github.com/zeldaret/tmc/graphs/contributors
|
||||
[contributors-badge]: https://img.shields.io/github/contributors/zeldaret/tmc
|
||||
|
||||
[discord]: https://discord.zelda64.dev
|
||||
[discord-badge]: https://img.shields.io/discord/688807550715560050?color=%237289DA&logo=discord&logoColor=%23FFFFFF
|
||||
|
||||
```diff
|
||||
- WARNING! -
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import git
|
||||
import os
|
||||
import re
|
||||
|
|
@ -80,9 +83,13 @@ def parse_map(non_matching_funcs):
|
|||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-m', '--matching', dest='matching', action='store_true',
|
||||
help='Output matching progress instead of decompilation progress')
|
||||
|
||||
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("-m", "--matching", dest='matching', action='store_true',
|
||||
help="Output matching progress instead of decompilation progress")
|
||||
args = parser.parse_args()
|
||||
|
||||
matching = args.matching
|
||||
|
||||
non_matching_funcs = []
|
||||
|
|
@ -101,21 +108,42 @@ def main():
|
|||
total = src + asm
|
||||
data_total = src_data + data
|
||||
|
||||
src_pct = '%.4f' % (100 * src / total)
|
||||
asm_pct = '%.4f' % (100 * asm / total)
|
||||
src_percent = 100 * src / total
|
||||
asm_percent = 100 * asm / total
|
||||
|
||||
src_data_pct = '%.4f' % (100 * src_data / data_total)
|
||||
data_pct = '%.4f' % (100 * data / data_total)
|
||||
src_data_percent = 100 * src_data / data_total
|
||||
data_percent = 100 * data / data_total
|
||||
|
||||
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(src_pct),
|
||||
str(asm_pct), str(src_data_pct), str(data_pct)]
|
||||
if args.format == 'csv':
|
||||
version = 2
|
||||
git_object = git.Repo().head.object
|
||||
timestamp = str(git_object.committed_date)
|
||||
git_hash = git_object.hexsha
|
||||
|
||||
print(','.join(csv_list))
|
||||
csv_list = [str(version), timestamp, git_hash, str(src),
|
||||
str(total), str(src_data), str(data_total)]
|
||||
|
||||
print(','.join(csv_list))
|
||||
|
||||
elif args.format == 'shield-json':
|
||||
# https://shields.io/endpoint
|
||||
print(json.dumps({
|
||||
"schemaVersion": 1,
|
||||
"label": "progress",
|
||||
"message": f"{src_percent:.3g}%",
|
||||
"color": 'yellow',
|
||||
}))
|
||||
|
||||
elif args.format == 'text':
|
||||
adjective = "decompiled" if not args.matching else "matched"
|
||||
|
||||
print("src: {:>9} / {:>8} total bytes {:<10} {:>9.4f}%".format(src, total, adjective, round(src_percent, 4)))
|
||||
# print()
|
||||
print("data: {:>9} / {:>8} total bytes analysed {:>9.4f}%".format(src_data, data_total, round(src_data_percent, 4)))
|
||||
|
||||
else:
|
||||
print("Unknown format argument: " + args.format)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in New Issue