some updates (mostly by comparison with opensourcegameclones)

This commit is contained in:
Trilarion
2019-08-19 15:53:57 +02:00
parent 70552f0e0f
commit 3515ffc167
37 changed files with 136 additions and 109 deletions

View File

@ -1,7 +1,6 @@
{
"git": [
"http://git.artsoft.org/rocksndiamonds.git",
"http://git.maxr.org/maxr/maxr.git",
"http://git.pond.sub.org/empserver",
"http://repo.or.cz/openal-soft.git",
"https://anongit.freedesktop.org/git/pkg-config.git",
@ -39,7 +38,6 @@
"https://git.code.sf.net/p/monstergenerato/code",
"https://git.code.sf.net/p/nazghul/git",
"https://git.code.sf.net/p/oge/git",
"https://git.code.sf.net/p/openlierox/code",
"https://git.code.sf.net/p/openyahtzee/code",
"https://git.code.sf.net/p/pasang-emas/code",
"https://git.code.sf.net/p/rmoffice/code",
@ -52,6 +50,7 @@
"https://git.code.sf.net/p/torcs/code",
"https://git.code.sf.net/p/tuxfootball/code",
"https://git.code.sf.net/p/ysoccer/code",
"https://git.maxr.org/maxr/maxr.git",
"https://git.net-core.org/tome/t-engine4.git",
"https://git.octaforge.org/OctaForge/OctaCore.git",
"https://git.savannah.gnu.org/git/adonthell/adonthell-wastesedge.git",
@ -142,6 +141,7 @@
"https://github.com/SWY1985/CivOne.git",
"https://github.com/Scorched-Moon/client.git",
"https://github.com/Scorched-Moon/server.git",
"https://github.com/SimHacker/micropolis.git",
"https://github.com/SpaceTraderGame/SpaceTrader-Windows.git",
"https://github.com/SupSuper/OpenXcom.git",
"https://github.com/TASVideos/desmume.git",
@ -171,6 +171,7 @@
"https://github.com/aburch/simutrans.git",
"https://github.com/acmepjz/meandmyshadow.git",
"https://github.com/akarnokd/open-ig.git",
"https://github.com/albertz/openlierox.git",
"https://github.com/alemart/opensurge.git",
"https://github.com/alphaonex86/CatchChallenger.git",
"https://github.com/anael-seghezzi/Maratis-4.git",
@ -320,7 +321,6 @@
"https://github.com/sago007/annchienta.git",
"https://github.com/samcv/brainworkshop.git",
"https://github.com/scummvm/scummvm.git",
"https://github.com/simhacker/micropolis.git",
"https://github.com/singularity/singularity.git",
"https://github.com/snauts/game-lv.git",
"https://github.com/spring/spring.git",

View File

@ -65,8 +65,6 @@ def unique_field_contents(entries, field):
if __name__ == "__main__":
regex_sanitze_name = re.compile(r"[^A-Za-z 0-9]+")
# paths
similarity_threshold = 0.8
root_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))

View File

@ -10,7 +10,7 @@ valid_fields = ('Home', 'Media', 'State', 'Play', 'Download', 'Platform', 'Keywo
'Code license', 'Code dependencies', 'Assets license', 'Build system', 'Build instructions')
valid_platforms = ('Windows', 'Linux', 'macOS', 'Android', 'Browser')
recommended_keywords = ('action', 'arcade', 'adventure', 'visual novel', 'sports', 'platform', 'puzzle', 'role playing', 'simulation', 'strategy', 'card game', 'board game', 'music', 'educational', 'tool', 'game engine', 'framework', 'library')
regex_sanitze_name = re.compile(r"[^A-Za-z -0-9]+")
def entry_iterator(games_path):
"""
@ -32,6 +32,17 @@ def entry_iterator(games_path):
yield entry, entry_path, content
def derive_canonical_file_name(name):
"""
Derives a canonical file name from a game name
"""
name = regex_sanitze_name.sub('', name)
name = name.replace(' ', '_')
name = name.casefold()
name = name + '.md'
return name
def parse_entry(content):
"""
Returns a dictionary of the features of the content
@ -185,6 +196,15 @@ def assemble_infos(games_path):
# add file information
info['file'] = entry
# check canonical file name
canonical_file_name = derive_canonical_file_name(info['name'])
if canonical_file_name != entry:
print('file {} should be {}'.format(entry, canonical_file_name))
source_file = os.path.join(games_path, entry)
target_file = os.path.join(games_path, canonical_file_name)
if not os.path.isfile(target_file):
os.rename(source_file, target_file)
# add to list
infos.append(info)