4 # Copyright (c) 2016-2022 by Someone <someone@somenet.org> (aka. Jan Vales <jan@jvales.net>)
5 # published under MIT-License
7 # This is started by the init script.
14 with open(sys.argv[2], "r", encoding="utf-8") as f:
17 print(stats["header"])
19 if sys.argv[1] == "code":
21 for c, count in sorted(stats["data"].items(), key=lambda x: x[1], reverse=True):
22 if sys.argv[1] == "code":
23 print(c+" ["+str(count)+"]")
25 print("|"+sys.argv[3]+c+"|"+str(count)+"|")
26 if sys.argv[1] == "code":
29 print(stats["no_data_text"])
30 print(stats["footer"])