imports from osgameclones, added backlog and rejected lists, started libregamewiki synchronization

This commit is contained in:
Trilarion
2019-08-26 15:39:29 +02:00
parent acb0763f59
commit 135d5b3968
67 changed files with 1468 additions and 188 deletions

View File

@ -731,6 +731,19 @@ def export_git_code_repositories_json():
text = json.dumps(urls, indent=1)
write_text(json_path, text)
def sort_text_file(file, name):
"""
Reads a text file, splits in lines, removes duplicates, sort, writes back.
"""
text = read_text(file)
text = text.split('\n')
text = sorted(list(set(text)), key=str.casefold)
print('{} contains {} items'.format(name, len(text)))
text = '\n'.join(text)
write_text(file, text)
if __name__ == "__main__":
# paths
@ -763,3 +776,7 @@ if __name__ == "__main__":
# check external links (only rarely)
# check_validity_external_links()
# sort backlog and rejected
sort_text_file(os.path.join(root_path, 'tools', 'backlog.txt'), 'backlog')
sort_text_file(os.path.join(root_path, 'tools', 'rejected.txt'), 'rejected games list')