started statistics
This commit is contained in:
@ -4,13 +4,12 @@
|
||||
|
||||
This script runs with Python 3, it could also with Python 2 with some minor tweaks probably, but that's not important.
|
||||
|
||||
TODO check for "_{One line description}_" or "- Wikipedia: {URL}" in game files and print warning
|
||||
TODO print all games without license or code information
|
||||
TODO for those games with github repositories get activity, number of open issues, number of merge requests and display in a health monitor file
|
||||
TODO get number of games with github or bitbucket repository and list those who have neither
|
||||
TODO list those with exotic licenses (not GPL, zlib, MIT, BSD) or without licenses
|
||||
TODO Which C, C++ projects do not use CMake
|
||||
TODO list those inactive (sort by year backwards)
|
||||
TODO for those games with github repositories get activity, number of open issues, number of merge requests and display in a health monitor file
|
||||
"""
|
||||
|
||||
import os
|
||||
@ -299,6 +298,31 @@ def check_template_leftovers():
|
||||
if content.find(check_string) >= 0:
|
||||
print('{}: found {}'.format(os.path.basename(entry_path), check_string))
|
||||
|
||||
def generate_statistics():
|
||||
"""
|
||||
|
||||
"""
|
||||
statistics_path = os.path.join(games_path, 'statistics.md')
|
||||
statistics = '[comment]: # (autogenerated content, do not edit)\n# Statistics\n\n'
|
||||
|
||||
# get category paths
|
||||
category_paths = get_category_paths()
|
||||
|
||||
# for each category
|
||||
for category_path in category_paths:
|
||||
# get paths of all entries in this category
|
||||
entry_paths = get_entry_paths(category_path)
|
||||
|
||||
for entry_path in entry_paths:
|
||||
# read it line by line
|
||||
with open(entry_path) as f:
|
||||
content = f.read()
|
||||
|
||||
with open(statistics_path, 'w') as f:
|
||||
f.write(statistics)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# paths
|
||||
@ -311,8 +335,11 @@ if __name__ == "__main__":
|
||||
# generate list in toc files
|
||||
#update_category_tocs()
|
||||
|
||||
# generate report
|
||||
generate_statistics()
|
||||
|
||||
# check for unfilled template lines
|
||||
check_template_leftovers()
|
||||
# check_template_leftovers()
|
||||
|
||||
# check external links (only rarely)
|
||||
#check_validity_external_links()
|
||||
|
Reference in New Issue
Block a user