Skip to content

Commit

Permalink
os path to pathlib path and checked external links
Browse files Browse the repository at this point in the history
  • Loading branch information
Trilarion committed Mar 3, 2024
1 parent 480b7ad commit 2af162f
Show file tree
Hide file tree
Showing 101 changed files with 554 additions and 539 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ on Wikipedia, diverse [Awesome Gaming lists](https://github.com/sindresorhus/awe
[comment]: # (start of autogenerated content, do not edit)
**[Games](entries/tocs/_games.md#Games)** (1689) - **[Tools](entries/tocs/_tools.md#Tools)** (51) - **[Frameworks](entries/tocs/_frameworks.md#Frameworks)** (98) - **[Libraries](entries/tocs/_libraries.md#Libraries)** (16)

By category: **[Action](entries/tocs/_action.md#action)** (329), **[Adventure](entries/tocs/_adventure.md#adventure)** (65), **[Arcade](entries/tocs/_arcade.md#arcade)** (195), **[Board](entries/tocs/_board.md#board)** (26), **[Cards](entries/tocs/_cards.md#cards)** (25), **[Educational](entries/tocs/_educational.md#educational)** (14), **[Framework](entries/tocs/_framework.md#framework)** (98), **[Game engine](entries/tocs/_game-engine.md#game-engine)** (179), **[Library](entries/tocs/_library.md#library)** (16), **[Music](entries/tocs/_music.md#music)** (16), **[Platform](entries/tocs/_platform.md#platform)** (77), **[Puzzle](entries/tocs/_puzzle.md#puzzle)** (187), **[Remake](entries/tocs/_remake.md#remake)** (681), **[Role playing](entries/tocs/_role-playing.md#role-playing)** (239), **[Simulation](entries/tocs/_simulation.md#simulation)** (140), **[Sports](entries/tocs/_sports.md#sports)** (27), **[Strategy](entries/tocs/_strategy.md#strategy)** (325), **[Tool](entries/tocs/_tool.md#tool)** (51), **[Visual novel](entries/tocs/_visual-novel.md#visual-novel)** (9)
By category: **[Action](entries/tocs/_action.md#action)** (331), **[Adventure](entries/tocs/_adventure.md#adventure)** (65), **[Arcade](entries/tocs/_arcade.md#arcade)** (195), **[Board](entries/tocs/_board.md#board)** (26), **[Cards](entries/tocs/_cards.md#cards)** (25), **[Educational](entries/tocs/_educational.md#educational)** (14), **[Framework](entries/tocs/_framework.md#framework)** (98), **[Game engine](entries/tocs/_game-engine.md#game-engine)** (179), **[Library](entries/tocs/_library.md#library)** (16), **[Music](entries/tocs/_music.md#music)** (16), **[Platform](entries/tocs/_platform.md#platform)** (77), **[Puzzle](entries/tocs/_puzzle.md#puzzle)** (187), **[Remake](entries/tocs/_remake.md#remake)** (680), **[Role playing](entries/tocs/_role-playing.md#role-playing)** (239), **[Simulation](entries/tocs/_simulation.md#simulation)** (140), **[Sports](entries/tocs/_sports.md#sports)** (27), **[Strategy](entries/tocs/_strategy.md#strategy)** (325), **[Tool](entries/tocs/_tool.md#tool)** (51), **[Visual novel](entries/tocs/_visual-novel.md#visual-novel)** (9)

By platform: **[Windows](entries/tocs/_windows.md#windows)** (604), **[Linux](entries/tocs/_linux.md#linux)** (558), **[macOS](entries/tocs/_macos.md#macos)** (324), **[Android](entries/tocs/_android.md#android)** (164), **[iOS](entries/tocs/_ios.md#ios)** (23), **[Web](entries/tocs/_web.md#web)** (179)
By platform: **[Windows](entries/tocs/_windows.md#windows)** (606), **[Linux](entries/tocs/_linux.md#linux)** (559), **[macOS](entries/tocs/_macos.md#macos)** (325), **[Android](entries/tocs/_android.md#android)** (164), **[iOS](entries/tocs/_ios.md#ios)** (23), **[Web](entries/tocs/_web.md#web)** (179)

[comment]: # (end of autogenerated content)

Expand Down
22 changes: 15 additions & 7 deletions code/archive_detect_submodules.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,38 @@

import json
import re
import os
import pathlib
import urllib
import os

from utils import constants as c, utils as u, archive as a

if __name__ == '__main__':

regex_submodules = re.compile(r"url = (\S*)", re.MULTILINE)

# get this folder
root_folder = os.path.realpath(os.path.dirname(__file__))
code_folder = c.root_path / 'code'

archive_folder = c.get_config('archive-folder')
base_folder = os.path.join(archive_folder, 'git')
if not archive_folder:
raise RuntimeError('No archive folder specified.')
else:
archive_folder = pathlib.Path(archive_folder)

base_folder = archive_folder / 'git'

# read archives.json
text = u.read_text(os.path.join(root_folder, 'archives.json'))
text = u.read_text(code_folder / 'archives.json')
archives = json.loads(text)

# loop over all git archives
submodules = []
for repo in archives['git']:
print('process {}'.format(repo))
git_folder = a.git_folder_name(repo)
folder = os.path.join(archive_folder, 'git', git_folder)
if not os.path.isdir(folder):
folder = archive_folder / 'git' / git_folder
if not folder.is_dir():
print('Warning: folder {} does not exist'.format(git_folder))
continue
os.chdir(folder)
Expand Down Expand Up @@ -57,4 +65,4 @@

# store them
print('found {} submodules'.format(len(submodules)))
u.write_text(os.path.join(root_folder, 'archives.git-submodules.json'), json.dumps(submodules, indent=1))
u.write_text(code_folder / 'archives.git-submodules.json', json.dumps(submodules, indent=1))
45 changes: 24 additions & 21 deletions code/archive_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# TODO Sourceforge git clone may not work all the time (restarting the script sometimes helps..)

import json
import pathlib

from utils.utils import *
from utils.archive import *
Expand Down Expand Up @@ -72,36 +73,36 @@ def run_update(type, urls, type_folder=None):
if type_folder is None:
type_folder = type
print('update {} {} archives'.format(len(urls), type))
base_folder = os.path.join(archive_folder, type_folder)
if not os.path.exists(base_folder):
os.mkdir(base_folder)
unused_base_folder = os.path.join(archive_folder, type_folder + '.unused')
if not os.path.exists(unused_base_folder):
os.mkdir(unused_base_folder)
base_folder = archive_folder / type_folder
if not base_folder.exists():
base_folder.mkdir()
unused_base_folder = archive_folder / (type_folder + '.unused')
if not unused_base_folder.exists():
unused_base_folder.mkdir()

# get derived folder names
folders = [folder_name[type](url) for url in urls]

# find those folders not used anymore
existing_folders = [x for x in os.listdir(base_folder) if os.path.isdir(os.path.join(base_folder, x))]
existing_folders = [x for x in base_folder.iterdir() if (base_folder / x).is_dir()]
unused_folders = [x for x in existing_folders if x not in folders]
print('{} unused archives, move to unused folder'.format(len(unused_folders)))
for folder in unused_folders:
origin = os.path.join(base_folder, folder)
destination = os.path.join(unused_base_folder, folder)
if not os.path.exists(destination):
origin = base_folder / folder
destination = unused_base_folder / folder
if not destination.exists():
shutil.move(origin, destination)

# new folder, need to clone
new_folders = [x for x in folders if x not in existing_folders]
print('{} new archives, will clone'.format(len(new_folders)))

# add root to folders
folders = [os.path.join(base_folder, x) for x in folders]
folders = [base_folder / x for x in folders]
os.chdir(base_folder)
for folder, url in zip(folders, urls):
if not os.path.isdir(folder):
print('clone {} into {}'.format(url, folder[len(base_folder):]))
if not folder.is_dir():
print('clone {} into {}'.format(url, folder.relative_to(base_folder)))
try:
clone[type](url, folder)
except RuntimeError as e:
Expand All @@ -110,7 +111,7 @@ def run_update(type, urls, type_folder=None):
# at the end update them all
for folder in folders:
print('update {}'.format(os.path.basename(folder)))
if not os.path.isdir(folder):
if not folder.is_dir():
print('folder not existing, wanted to update, will skip')
continue
# print('update {}'.format(folder[len(base_folder):]))
Expand All @@ -124,14 +125,14 @@ def run_info(type, urls):
print('collect info on {}'.format(type))

# get derived folder names
folders = [os.path.join(type, folder_name[type](url)) for url in urls]
folders = [type / folder_name[type](url) for url in urls]

# collect information
info = []
for folder in folders:
print(folder)
path = os.path.join(archive_folder, folder)
size = folder_size(path) if os.path.isdir(path) else -1
path = archive_folder / folder
size = folder_size(path) if path.is_dir() else -1
info.append([size, folder])
return info

Expand Down Expand Up @@ -159,17 +160,19 @@ def run_info(type, urls):
}

# get this folder
root_folder = os.path.realpath(os.path.dirname(__file__))
code_folder = c.root_path / 'code'
archive_folder = c.get_config('archive-folder')
if not archive_folder:
raise RuntimeError('No archive folder specified.')
else:
archive_folder = pathlib.Path(archive_folder)

# read archives.json
text = read_text(os.path.join(root_folder, 'archives.json'))
text = read_text(code_folder / 'archives.json')
archives = json.loads(text)

# read archives.git-submodules.json
text = read_text(os.path.join(root_folder, 'archives.git-submodules.json'))
text = read_text(code_folder / 'archives.git-submodules.json')
archives_git_submodules = json.loads(text)

# run update on submodules
Expand All @@ -189,4 +192,4 @@ def run_info(type, urls):
infos.extend(run_info(type, urls))
infos.sort(key=lambda x: x[0], reverse=True)
text = json.dumps(infos, indent=1)
write_text(os.path.join(archive_folder, 'infos.json'), text)
write_text(archive_folder / 'infos.json', text)
10 changes: 5 additions & 5 deletions code/archives.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"git": [
"git://git.blender.org/blender.git",
"http://git.pond.sub.org/empserver",
"http://hgm.nubati.net/cgi-bin/gitweb.cgi?p=fairymax.git",
"https://anongit.kde.org/ksudoku.git",
Expand All @@ -11,7 +10,6 @@
"https://bitbucket.org/czirkoszoltan/gdash.git",
"https://bitbucket.org/dalerank/caesaria.git",
"https://bitbucket.org/dividuum/infon.git",
"https://bitbucket.org/dm_999/powerslideremake.git",
"https://bitbucket.org/ecwolf/ecwolf.git",
"https://bitbucket.org/fade0ff/lemmini.git",
"https://bitbucket.org/namida42/neolemmixplayer.git",
Expand Down Expand Up @@ -492,6 +490,7 @@
"https://github.com/TalonBraveInfo/OpenHoW.git",
"https://github.com/Tape-Worm/Gorgon.git",
"https://github.com/Team--Rocket/divercity.git",
"https://github.com/TeamHypersomnia/Hypersomnia.git",
"https://github.com/Techbot/JiGS-RPG-engine.git",
"https://github.com/TerryCavanagh/vvvvvv.git",
"https://github.com/The-Powder-Toy/The-Powder-Toy.git",
Expand All @@ -510,6 +509,7 @@
"https://github.com/Try/OpenGothic.git",
"https://github.com/TurningWheel/Barony.git",
"https://github.com/Tuxemon/Tuxemon.git",
"https://github.com/UPBGE/upbge.git",
"https://github.com/UberGames/rpgxEF.git",
"https://github.com/UchuServer/Uchu.git",
"https://github.com/UltraStar-Deluxe/Play.git",
Expand Down Expand Up @@ -780,6 +780,7 @@
"https://github.com/dividuum/infon.git",
"https://github.com/djyt/cannonball.git",
"https://github.com/dkfans/keeperfx.git",
"https://github.com/dm999/powerslideremake.git",
"https://github.com/dmecke/OpenSoccerStar.git",
"https://github.com/dogballs/cattle-bity.git",
"https://github.com/dorkster/freeblocks.git",
Expand Down Expand Up @@ -954,7 +955,6 @@
"https://github.com/jasonrohrer/OneLife.git",
"https://github.com/jasonrohrer/SleepIsDeath.git",
"https://github.com/jazztickets/choria.git",
"https://github.com/jazztickets/emptyclip.git",
"https://github.com/jazztickets/irrlamb.git",
"https://github.com/jazzyjester/Mario-Game.git",
"https://github.com/jcarolus/android-chess.git",
Expand Down Expand Up @@ -1319,7 +1319,6 @@
"https://github.com/svkaiser/PowerslaveEX.git",
"https://github.com/svkaiser/TurokEX.git",
"https://github.com/svkaiser/strife-ve.git",
"https://github.com/svn2github/numptyphysics.git",
"https://github.com/synkarius/micemen.git",
"https://github.com/taisei-project/taisei.git",
"https://github.com/tales/sourceoftales.git",
Expand All @@ -1342,7 +1341,6 @@
"https://github.com/thijsvanommen/scrap.git",
"https://github.com/thousandparsec/tpclient-pywx.git",
"https://github.com/thousandparsec/tpserver-cpp.git",
"https://github.com/thp/numptyphysics.git",
"https://github.com/thrimbor/Hurrican.git",
"https://github.com/thunder-engine/thunder.git",
"https://github.com/tomsoftware/Lemmings.ts.git",
Expand Down Expand Up @@ -1470,6 +1468,7 @@
"https://gitlab.com/drummyfish/anarch.git",
"https://gitlab.com/dulsi/alchemyquest.git",
"https://gitlab.com/dulsi/mojotron.git",
"https://gitlab.com/empty-clip/code.git",
"https://gitlab.com/esr/vms-empire.git",
"https://gitlab.com/fgerbig/SpacePeng.git",
"https://gitlab.com/freedroid/freedroid-src.git",
Expand Down Expand Up @@ -1700,6 +1699,7 @@
"https://gitlab.com/stone-kingdoms/stone-kingdoms.git",
"https://gitlab.com/tcrass/minos.git",
"https://gitlab.com/team-potato/titan_tactics.git",
"https://gitlab.com/thp/numptyphysics.git",
"https://gitlab.com/veloren/veloren.git",
"https://gitlab.com/voadi/voadi.git",
"https://gitlab.com/voxelands/voxelands.git",
Expand Down
8 changes: 8 additions & 0 deletions code/backlog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,20 @@ https://github.com/carlbirch/BirchEngine
https://github.com/CatDogEngine/CatDogEngine
https://github.com/cfoust/sour
https://github.com/channingbreeze/games
https://github.com/CharlesPikachu/Games
https://github.com/choubari/3D-Tanks-Game-Unity
https://github.com/chvin/react-tetris
https://github.com/ClarkThyLord/Voxel-Core
https://github.com/Clownacy/clownmdemu
https://github.com/codenamecpp/carnage3d#other-gta-12-re-implementations
https://github.com/collections/game-engines
https://github.com/Crazy-Marvin/EllaTheGame
https://github.com/cykod/AlienInvasion
https://github.com/DaoCloud/dao-2048
https://github.com/DavidSM64/Diddy-Kong-Racing
https://github.com/deathkiller/jazz2-native
https://github.com/delmarle/RPG-Core
https://github.com/dmcinnes/HTML5-Asteroids
https://github.com/doldecomp/melee
https://github.com/domeengine/dome
https://github.com/dtrajko/MoravaEngine
Expand Down Expand Up @@ -111,6 +114,7 @@ https://github.com/jhasse/jngl # game library ? (complete engine?)
https://github.com/JimmieKJ/unrealTournament
https://github.com/JoeyDeVries/Cell
https://github.com/juliangarnier/3D-Hartwig-chess-set
https://github.com/justinmeister/Mario-Level-1
https://github.com/Kaetram/Kaetram-Open
https://github.com/Kavex/GameDev-Resources
https://github.com/kenamick/savagewheels
Expand All @@ -128,6 +132,7 @@ https://github.com/lospec/pixel-editor
https://github.com/loudsmilestudios/TetraForce
https://github.com/magwo/elevatorsaga
https://github.com/man-in-black382/PathFinder
https://github.com/mgerdes/Open-Golf
https://github.com/mgerhardy/engine
https://github.com/michaelday008/AnyRPGCore
https://github.com/michelpereira/awesome-games-of-coding
Expand All @@ -140,6 +145,8 @@ https://github.com/MrFrenik/gunslinger
https://github.com/nCine/nCine
https://github.com/ondras/rot.js
https://github.com/open-telemetry/opentelemetry-cpp
https://github.com/OpenGMK/OpenGMK
https://github.com/osslugaru/lugaru
https://github.com/OverShifted/OverEngine
https://github.com/oxygine/oxygine-framework
https://github.com/Oyun-Teknolojileri/ToolKit
Expand Down Expand Up @@ -188,6 +195,7 @@ https://github.com/tomlooman/SimpleFPSTemplate
https://github.com/TomMalbran/games
https://github.com/tommyettinger/gdx-liftoff
https://github.com/tsherif/space-shooter.c
https://github.com/TTimo/doom3.gpl
https://github.com/untoldengine/UntoldEngine
https://github.com/videogamepreservation
https://github.com/volcoma/EtherealEngine
Expand Down
Loading

0 comments on commit 2af162f

Please sign in to comment.