Add option to stringtablediag to only show markdown

This commit is contained in:
KoffeinFlummi 2015-05-08 19:27:42 +02:00
parent 41761bc196
commit 24505f59e1

View File

@ -57,12 +57,14 @@ def main():
projectpath = os.path.dirname(os.path.dirname(scriptpath)) projectpath = os.path.dirname(os.path.dirname(scriptpath))
projectpath = os.path.join(projectpath, "addons") projectpath = os.path.join(projectpath, "addons")
if "--markdown" not in sys.argv:
print("#########################") print("#########################")
print("# Stringtable Diag Tool #") print("# Stringtable Diag Tool #")
print("#########################") print("#########################")
languages = get_all_languages(projectpath) languages = get_all_languages(projectpath)
if "--markdown" not in sys.argv:
print("\nLanguages present in the repo:") print("\nLanguages present in the repo:")
print(", ".join(languages)) print(", ".join(languages))
@ -76,19 +78,21 @@ def main():
if keynumber == 0: if keynumber == 0:
continue continue
if "--markdown" not in sys.argv:
print("\n# " + module) print("\n# " + module)
keysum += keynumber keysum += keynumber
for i in range(len(localized)): for i in range(len(localized)):
if "--markdown" not in sys.argv:
print(" %s %s / %i" % ((languages[i]+":").ljust(10), str(localized[i]).ljust(3), keynumber)) print(" %s %s / %i" % ((languages[i]+":").ljust(10), str(localized[i]).ljust(3), keynumber))
localizedsum[i] += localized[i] localizedsum[i] += localized[i]
if localized[i] < keynumber: if localized[i] < keynumber:
missing[i].append(module) missing[i].append(module)
if "--markdown" not in sys.argv:
print("\n###########") print("\n###########")
print("# RESULTS #") print("# RESULTS #")
print("###########") print("###########")
print("\nTotal number of keys: %i\n" % (keysum)) print("\nTotal number of keys: %i\n" % (keysum))
for i in range(len(languages)): for i in range(len(languages)):
@ -98,9 +102,9 @@ def main():
print("%s %s missing stringtable entry/entries." % ((languages[i] + ":").ljust(12), str(keysum - localizedsum[i]).rjust(4)), end="") print("%s %s missing stringtable entry/entries." % ((languages[i] + ":").ljust(12), str(keysum - localizedsum[i]).rjust(4)), end="")
print(" ("+", ".join(missing[i])+")") print(" ("+", ".join(missing[i])+")")
print("\n\n### MARKDOWN ###") print("\n\n### MARKDOWN ###\n")
print("\nTotal number of keys: %i\n" % (keysum)) print("Total number of keys: %i\n" % (keysum))
print("| Language | Missing Entries | Relevant Modules | % done |") print("| Language | Missing Entries | Relevant Modules | % done |")
print("|----------|----------------:|------------------|--------|") print("|----------|----------------:|------------------|--------|")