|
|
|
@ -8,6 +8,9 @@
|
|
|
|
|
TODO Which C, C++ projects do not use CMake
|
|
|
|
|
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 search for ?? and replace with either nothing or missing information
|
|
|
|
|
TODO replace () with nothing in the imported info
|
|
|
|
|
TODO sort Home/Media/Download... in all files according to a canonic order
|
|
|
|
|
TODO create website with dynamic table
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
@ -32,7 +35,7 @@ def read_first_line_from_file(file):
|
|
|
|
|
"""
|
|
|
|
|
Convenience function because we only need the first line of a category overview really.
|
|
|
|
|
"""
|
|
|
|
|
with open(file, 'r') as f:
|
|
|
|
|
with open(file, mode='r', encoding='utf-8') as f:
|
|
|
|
|
line = f.readline()
|
|
|
|
|
return line
|
|
|
|
|
|
|
|
|
@ -41,7 +44,7 @@ def read_interesting_info_from_file(file):
|
|
|
|
|
Parses a file for some interesting fields and concatenates the content. To be displayed after the game name in the
|
|
|
|
|
category overview.
|
|
|
|
|
"""
|
|
|
|
|
with open(file, 'r') as f:
|
|
|
|
|
with open(file, mode='r', encoding='utf-8') as f:
|
|
|
|
|
text = f.read()
|
|
|
|
|
|
|
|
|
|
output = [None, None, None]
|
|
|
|
@ -78,7 +81,7 @@ def update_readme():
|
|
|
|
|
print('update readme file')
|
|
|
|
|
|
|
|
|
|
# read readme
|
|
|
|
|
with open(readme_path) as f:
|
|
|
|
|
with open(readme_path, mode='r', encoding='utf-8') as f:
|
|
|
|
|
readme_text = f.read()
|
|
|
|
|
|
|
|
|
|
# compile regex for identifying the building blocks
|
|
|
|
@ -116,7 +119,7 @@ def update_readme():
|
|
|
|
|
text = start + "[comment]: # (start of autogenerated content, do not edit)\n" + update + "\n[comment]: # (end of autogenerated content)" + end
|
|
|
|
|
|
|
|
|
|
# write to readme
|
|
|
|
|
with open(readme_path, 'w') as f:
|
|
|
|
|
with open(readme_path, mode='w', encoding='utf-8') as f:
|
|
|
|
|
f.write(text)
|
|
|
|
|
|
|
|
|
|
def update_category_tocs():
|
|
|
|
@ -157,7 +160,7 @@ def update_category_tocs():
|
|
|
|
|
text = toc_header + '\n' + "[comment]: # (start of autogenerated content, do not edit)\n" + update + "\n[comment]: # (end of autogenerated content)"
|
|
|
|
|
|
|
|
|
|
# write to toc file
|
|
|
|
|
with open(toc_file, 'w') as f:
|
|
|
|
|
with open(toc_file, mode='w', encoding='utf-8') as f:
|
|
|
|
|
f.write(text)
|
|
|
|
|
|
|
|
|
|
def check_validity_external_links():
|
|
|
|
@ -184,7 +187,7 @@ def check_validity_external_links():
|
|
|
|
|
# for each entry
|
|
|
|
|
for entry_path in entry_paths:
|
|
|
|
|
# read entry
|
|
|
|
|
with open(entry_path, 'r') as f:
|
|
|
|
|
with open(entry_path, 'r', 'utf-8') as f:
|
|
|
|
|
content = f.read()
|
|
|
|
|
|
|
|
|
|
# apply regex
|
|
|
|
@ -230,7 +233,7 @@ def fix_notation():
|
|
|
|
|
|
|
|
|
|
for entry_path in entry_paths:
|
|
|
|
|
# read it line by line
|
|
|
|
|
with open(entry_path) as f:
|
|
|
|
|
with open(entry_path, 'r', 'utf-8') as f:
|
|
|
|
|
content = f.readlines()
|
|
|
|
|
|
|
|
|
|
# apply regex on every line
|
|
|
|
@ -245,7 +248,7 @@ def fix_notation():
|
|
|
|
|
content[line] = "- Code license details:{}\n".format(match)
|
|
|
|
|
|
|
|
|
|
# write it line by line
|
|
|
|
|
with open(entry_path, "w") as f:
|
|
|
|
|
with open(entry_path, "w", 'utf-8') as f:
|
|
|
|
|
f.writelines(content)
|
|
|
|
|
|
|
|
|
|
def regular_replacements():
|
|
|
|
@ -262,7 +265,7 @@ def regular_replacements():
|
|
|
|
|
|
|
|
|
|
for entry_path in entry_paths:
|
|
|
|
|
# read it line by line
|
|
|
|
|
with open(entry_path) as f:
|
|
|
|
|
with open(entry_path, 'r', 'utf-8') as f:
|
|
|
|
|
content = f.read()
|
|
|
|
|
|
|
|
|
|
# now the replacements
|
|
|
|
@ -271,7 +274,7 @@ def regular_replacements():
|
|
|
|
|
content = content.replace('multi player', 'MP')
|
|
|
|
|
|
|
|
|
|
# write it line by line
|
|
|
|
|
with open(entry_path, "w") as f:
|
|
|
|
|
with open(entry_path, "w", 'utf-8') as f:
|
|
|
|
|
f.write(content)
|
|
|
|
|
|
|
|
|
|
def check_template_leftovers():
|
|
|
|
@ -290,7 +293,7 @@ def check_template_leftovers():
|
|
|
|
|
|
|
|
|
|
for entry_path in entry_paths:
|
|
|
|
|
# read it line by line
|
|
|
|
|
with open(entry_path) as f:
|
|
|
|
|
with open(entry_path, 'r', 'utf-8') as f:
|
|
|
|
|
content = f.read()
|
|
|
|
|
|
|
|
|
|
for check_string in check_strings:
|
|
|
|
@ -361,7 +364,7 @@ def generate_statistics():
|
|
|
|
|
|
|
|
|
|
for entry_path in entry_paths:
|
|
|
|
|
# read it line by line
|
|
|
|
|
with open(entry_path) as f:
|
|
|
|
|
with open(entry_path, mode='r', encoding='utf-8') as f:
|
|
|
|
|
content = f.read()
|
|
|
|
|
|
|
|
|
|
info = parse_entry(content)
|
|
|
|
@ -437,7 +440,7 @@ def generate_statistics():
|
|
|
|
|
unique_licenses = ['- {} ({:.1f}%)\n'.format(x[0], x[1]*100) for x in unique_licenses]
|
|
|
|
|
statistics += '##### Licenses frequency\n\n' + ''.join(unique_licenses) + '\n'
|
|
|
|
|
|
|
|
|
|
with open(statistics_path, 'w') as f:
|
|
|
|
|
with open(statistics_path, mode='w', encoding='utf-8') as f:
|
|
|
|
|
f.write(statistics)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|