diff --git a/games/maintenance.py b/games/maintenance.py index a1aa19cb..a4197646 100644 --- a/games/maintenance.py +++ b/games/maintenance.py @@ -4,14 +4,10 @@ This script runs with Python 3, it could also with Python 2 with some minor tweaks probably, but that's not important. - TODO remove "?source=navbar" from the end of links (sourceforge specific) 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 in readme put contents to the top, put all games folder into another folder and this script as well as the template too - TODO change Wikipedia to Media - TODO single player to SP, multi player to MP for keywords 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) @@ -220,6 +216,66 @@ def check_validity_external_links(): print("{} links checked".format(number_checked_links)) +def fix_notation(): + """ + Changes notation, quite special. Only run when needed. + """ + regex = re.compile(r"- Wikipedia:(.*)") + + # 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.readlines() + + # apply regex on every line + matched_lines = [regex.findall(line) for line in content] + + # loop over all the lines + for line, match in enumerate(matched_lines): + if match: + match = match[0] + + # patch content + content[line] = "- Media:{}\n".format(match) + + # write it line by line + with open(entry_path, "w") as f: + f.writelines(content) + +def regular_replacements(): + """ + Replacing some stuff by shortcuts. Can be run regularly + """ + + # 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() + + # now the replacements + content = content.replace('?source=navbar', '') # sourceforge specific + content = content.replace('single player', 'SP') + content = content.replace('multi player', 'MP') + + # write it line by line + with open(entry_path, "w") as f: + f.write(content) if __name__ == "__main__": @@ -228,11 +284,16 @@ if __name__ == "__main__": readme_path = os.path.join(games_path, os.pardir, 'README.md') # recount and write to readme - update_readme() + #update_readme() # generate list in toc files - update_category_tocs() + #update_category_tocs() # check external links (only rarely) # check_validity_external_links() + # special, only run when needed + # fix_notation() + + # regular replacements + regular_replacements() \ No newline at end of file diff --git a/games/rpg/allacrost.md b/games/rpg/allacrost.md index 9cda9334..809f4785 100644 --- a/games/rpg/allacrost.md +++ b/games/rpg/allacrost.md @@ -1,11 +1,11 @@ # Hero of Allacrost -_Hero of Allacrost is a single player 2D role-playing game inspired by classic console RPGs._ +_Hero of Allacrost is a 2D role-playing game inspired by classic console RPGs._ - Home: http://allacrost.org - Download: https://bitbucket.org/allacrost/allacrost/downloads/ - State: stable -- Keywords: single player, 2D +- Keywords: SP, 2D - Code: https://bitbucket.org/allacrost/allacrost/src (hg) - Language(s): C++, Lua - License: GPL-2.0 diff --git a/games/rpg/arx_libertatis.md b/games/rpg/arx_libertatis.md index 95781ac5..091fa007 100644 --- a/games/rpg/arx_libertatis.md +++ b/games/rpg/arx_libertatis.md @@ -6,7 +6,7 @@ _Arx Libertatis is a cross-platform, open source port of Arx Fatalis, a 2002 fir - Wikipedia: https://en.wikipedia.org/wiki/Arx_Fatalis#Development - Download: http://wiki.arx-libertatis.org/Download - State: mature -- Keywords: single player +- Keywords: SP - Code: https://github.com/arx/ArxLibertatis - Language(s): C++ - License: GPL-3.0 diff --git a/games/rpg/blades_of_exile.md b/games/rpg/blades_of_exile.md index 48d5261a..75934963 100644 --- a/games/rpg/blades_of_exile.md +++ b/games/rpg/blades_of_exile.md @@ -5,8 +5,8 @@ _{One line description}_ - Home: http://www.spiderwebsoftware.com/blades/opensource.html - Wikipedia: - Download: {URL} -- State: beta, mature (inactive since) -- Keywords: single player, multi player, RTS, TBS (if none, remove the line) +- State: mature +- Keywords: SP, MP, RTS, TBS - Code: https://github.com/calref/cboe - Language(s): C++ - License: GPL-2.0 diff --git a/games/rpg/catch_challenger.md b/games/rpg/catch_challenger.md index f86187c4..f300bd74 100644 --- a/games/rpg/catch_challenger.md +++ b/games/rpg/catch_challenger.md @@ -1,6 +1,6 @@ # Catch Challenger -_A independent MMORPG, Lan game and a single player game._ +_A independent MMORPG, Lan game and a SP game._ - Home: https://catchchallenger.first-world.info/ - Download: https://catchchallenger.first-world.info/download.html diff --git a/games/rpg/dawn.md b/games/rpg/dawn.md index 5fa77d20..7ac7e879 100644 --- a/games/rpg/dawn.md +++ b/games/rpg/dawn.md @@ -4,7 +4,7 @@ _2D RPG set in a fantasy world._ - Home: https://github.com/iamCode/Dawn/wiki - State: beta, inactive since 2011 -- Keywords: single player +- Keywords: SP - Code: https://github.com/iamCode/Dawn - Language(s): C++ - License: GPL-3.0 diff --git a/games/rpg/dnt.md b/games/rpg/dnt.md index 215c4d9f..47a6bb99 100644 --- a/games/rpg/dnt.md +++ b/games/rpg/dnt.md @@ -1,11 +1,11 @@ # DNT -_3D single player RPG in a satirical post-apocalyptical world._ +_3D RPG in a satirical post-apocalyptical world._ - Home: http://dnt.dnteam.org/cgi-bin/about.py https://sourceforge.net/projects/dnt/ - Download: http://dnt.dnteam.org/cgi-bin/downloads.py - State: beta, inactive since 2016 -- Keywords: single player +- Keywords: SP - Code: https://sourceforge.net/p/dnt/code/ci/master/tree/ (git) - Language(s): C++ - License: GPL-3.0 diff --git a/games/rpg/freedroid.md b/games/rpg/freedroid.md index 5e101b75..5973200f 100644 --- a/games/rpg/freedroid.md +++ b/games/rpg/freedroid.md @@ -6,7 +6,7 @@ _FreedroidRPG is an open source role playing game._ - Wikipedia: https://de.wikipedia.org/wiki/FreedroidRPG (German) - Download: http://www.freedroid.org/download/ - State: mature -- Keywords: single player, isometric +- Keywords: SP, isometric - Code: https://gitlab.com/freedroid/freedroid-src - Language(s): C - License: GPL-2.0 diff --git a/games/rpg/stendhal.md b/games/rpg/stendhal.md index 5dc937d1..03c4d936 100644 --- a/games/rpg/stendhal.md +++ b/games/rpg/stendhal.md @@ -5,7 +5,7 @@ _Multiplayer online adventure game with an old school feel._ - Home: https://stendhalgame.org/ - Download: see home - State: mature -- Keywords: multi player, server +- Keywords: MP, server - Code: https://sourceforge.net/p/arianne/stendhal/ci/master/tree/ - Language(s): Java - License: GPL-2.0 diff --git a/games/strategy/freerails.md b/games/strategy/freerails.md index fa83c3ea..6f90db70 100644 --- a/games/strategy/freerails.md +++ b/games/strategy/freerails.md @@ -1,6 +1,6 @@ # FreeRails -_Real time multi player strategy game where players compete to build the most powerful railroad empire._ +_Real time MP strategy game where players compete to build the most powerful railroad empire._ - Home: http://freerails.sourceforge.net/ - Download: https://sourceforge.net/projects/freerails/files/jfreerails/ diff --git a/games/strategy/gigalomania.md b/games/strategy/gigalomania.md index 4dfdd1f6..7ad585b7 100644 --- a/games/strategy/gigalomania.md +++ b/games/strategy/gigalomania.md @@ -4,7 +4,7 @@ _A 2D real time strategy Mega-Lo-Mania-like god game._ - Home: http://gigalomania.sourceforge.net/ - State: beta, mature (inactive since) -- Keywords: single player, multi player, RTS, TBS (if none, remove the line) +- Keywords: SP, MP, RTS, TBS (if none, remove the line) - Code: https://sourceforge.net/p/gigalomania/code/ci/master/tree/ - Language(s): C++ - License: GPL-2.0 diff --git a/games/strategy/pax_britannica.md b/games/strategy/pax_britannica.md index cb27b876..116b149a 100644 --- a/games/strategy/pax_britannica.md +++ b/games/strategy/pax_britannica.md @@ -4,7 +4,7 @@ _One-button real-time strategy game._ - Home: http://paxbritannica.henk.ca/ - State: mature -- Keywords: single player, multi player, RTS, TBS (if none, remove the line) +- Keywords: SP, MP, RTS, TBS (if none, remove the line) - Code: https://github.com/henkboom/pax-britannica - Language(s): Lua, C - License: MIT