imports from osgameclones

This commit is contained in:
Trilarion
2019-08-21 10:17:40 +02:00
parent afaa1bba84
commit 42dee8c7e8
71 changed files with 1527 additions and 295 deletions

View File

@ -61,6 +61,7 @@
"https://git.savannah.gnu.org/git/rpge.git",
"https://git.savannah.nongnu.org/git/lordsawar.git",
"https://git.tukaani.org/xz.git",
"https://git.tuxfamily.org/baller/baller.git",
"https://git.tuxfamily.org/fanwor/fanwor.git",
"https://github.com/0ad/0ad.git",
"https://github.com/AdamAtomic/flixel.git",
@ -75,12 +76,14 @@
"https://github.com/BZFlag-Dev/bzflag.git",
"https://github.com/BackupTheBerlios/netpanzer-svn.git",
"https://github.com/BlindMindStudios/StarRuler2-Source.git",
"https://github.com/Blzut3/CatacombSDL.git",
"https://github.com/CamHenlin/Roguish.git",
"https://github.com/ChaosForge/doomrl.git",
"https://github.com/Circular-Studios/Dash.git",
"https://github.com/Cirrus-Minor/witchblast.git",
"https://github.com/CleverRaven/Cataclysm-DDA.git",
"https://github.com/CorsixTH/CorsixTH.git",
"https://github.com/Deceth/Battle-City.git",
"https://github.com/DeltaEngine/DeltaEngine.git",
"https://github.com/EMC23/JiGS-PHP-RPG-engine.git",
"https://github.com/EasyRPG/Player.git",
@ -107,6 +110,7 @@
"https://github.com/LibreGamesArchive/silvertree.git",
"https://github.com/LionsPhil/mewl.git",
"https://github.com/Lisergishnu/TetraVex.git",
"https://github.com/LongSteve/aquastax.git",
"https://github.com/MattMatt0240/DemiGod.git",
"https://github.com/MegaGlest/megaglest-source.git",
"https://github.com/MegaMek/megamek.git",
@ -114,6 +118,7 @@
"https://github.com/Meridian59/Meridian59.git",
"https://github.com/MonoGame/MonoGame.git",
"https://github.com/MovingBlocks/Terasology.git",
"https://github.com/Nebuleon/ativayeban.git",
"https://github.com/NetHack/NetHack.git",
"https://github.com/Neverball/neverball.git",
"https://github.com/Nop90-Switch/Meritous-Switch.git",
@ -142,16 +147,20 @@
"https://github.com/Scorched-Moon/client.git",
"https://github.com/Scorched-Moon/server.git",
"https://github.com/SimHacker/micropolis.git",
"https://github.com/SimonAlling/kurve.git",
"https://github.com/SpaceTraderGame/SpaceTrader-Windows.git",
"https://github.com/SupSuper/OpenXcom.git",
"https://github.com/TASVideos/desmume.git",
"https://github.com/TVTower/TVTower.git",
"https://github.com/TheAssemblyArmada/Chronoshift.git",
"https://github.com/TimPietrusky/asdf.git",
"https://github.com/TobiasBielefeld/Simple-Solitaire.git",
"https://github.com/Trilarion/D-Fend-Reloaded.git",
"https://github.com/Trilarion/gltron.git",
"https://github.com/Trilarion/mpango.git",
"https://github.com/Trilarion/scorched3d.git",
"https://github.com/Trilarion/spacetraderjava.git",
"https://github.com/TurningWheel/Barony.git",
"https://github.com/Tuxemon/Tuxemon.git",
"https://github.com/UltraStar-Deluxe/USDX.git",
"https://github.com/UltraStar-Deluxe/legacy-sourceforge-svn-mirror.git",
@ -161,6 +170,7 @@
"https://github.com/ValHaris/asc-hq.git",
"https://github.com/ValyriaTear/ValyriaTear.git",
"https://github.com/Vanilla-NetHack/NetHack.git",
"https://github.com/VenKamikaze/BitRiot.git",
"https://github.com/VilleKrumlinde/zgameeditor.git",
"https://github.com/Wargus/wargus.git",
"https://github.com/Warzone2100/warzone2100.git",
@ -183,12 +193,15 @@
"https://github.com/arescentral/antares.git",
"https://github.com/arx/ArxLibertatis.git",
"https://github.com/atrinik/atrinik.git",
"https://github.com/bibendovsky/bstone.git",
"https://github.com/blakeohare/pyweek-sentientstorage.git",
"https://github.com/blockattack/blockattack-game.git",
"https://github.com/boostorg/boost.git",
"https://github.com/bote-team/bote.git",
"https://github.com/brandon-rhodes/python-adventure.git",
"https://github.com/bridgecommand/bc.git",
"https://github.com/bsutton/BattlefieldJava.git",
"https://github.com/budnix/ball-and-wall.git",
"https://github.com/calref/cboe.git",
"https://github.com/candybox2/candybox2.github.io.git",
"https://github.com/castle-engine/castle-engine.git",
@ -207,10 +220,12 @@
"https://github.com/cxong/cdogs-sdl.git",
"https://github.com/darklegion/tremulous.git",
"https://github.com/delight-im/OpenSoccer.git",
"https://github.com/djyt/cannonball.git",
"https://github.com/dmecke/OpenSoccerStar.git",
"https://github.com/doxygen/doxygen.git",
"https://github.com/dreamchess/dreamchess.git",
"https://github.com/dsallen7/ransack-python.git",
"https://github.com/dulsi/btbuilder.git",
"https://github.com/dungeons-of-moria/umoria.git",
"https://github.com/ec429/harris.git",
"https://github.com/egoboo/egoboo.git",
@ -218,6 +233,7 @@
"https://github.com/enigma-dev/enigma-dev.git",
"https://github.com/exult/exult.git",
"https://github.com/fabianschuiki/OpenSkyscraper.git",
"https://github.com/fabiensanglard/chocolate_duke3D.git",
"https://github.com/fariazz/World-of-Heroes.git",
"https://github.com/farmboy0/slashem.git",
"https://github.com/fastrgv/AdaVenture.git",
@ -249,6 +265,7 @@
"https://github.com/iamCode/Dawn.git",
"https://github.com/ihofmann/open-websoccer.git",
"https://github.com/infidel-/cult.git",
"https://github.com/institution/cc94.git",
"https://github.com/ivansafrin/Polycode.git",
"https://github.com/jMonkeyEngine/jmonkeyengine.git",
"https://github.com/ja2-stracciatella/ja2-stracciatella.git",
@ -278,15 +295,20 @@
"https://github.com/lua/lua.git",
"https://github.com/madler/zlib.git",
"https://github.com/magarena/magarena.git",
"https://github.com/maikmerten/c64-nuclearreaction.git",
"https://github.com/maikmerten/chainreaction.git",
"https://github.com/mana/manaserv.git",
"https://github.com/marcusmoller/pyorpg-client.git",
"https://github.com/marcusmoller/pyorpg-server.git",
"https://github.com/marksteelz3/Atari-VR---Breakout.git",
"https://github.com/matthewgrimes/hexgame.git",
"https://github.com/matthewgrimes/itbs-code.git",
"https://github.com/mgerhardy/caveexpress.git",
"https://github.com/mgfreshour/hexwar.git",
"https://github.com/minetest/minetest.git",
"https://github.com/mitallast/diablo-js.git",
"https://github.com/mkalus/janag.git",
"https://github.com/mordrax/cotwelm.git",
"https://github.com/mordrax/cotwmtor.git",
"https://github.com/mozilla/BrowserQuest.git",
"https://github.com/naev/naev.git",
@ -305,6 +327,7 @@
"https://github.com/ospaceteam/outerspace.git",
"https://github.com/ozkriff/zoc.git",
"https://github.com/panda3d/panda3d.git",
"https://github.com/paulsapps/alive.git",
"https://github.com/pioneerspacesim/pioneer.git",
"https://github.com/pjotrligthart/openmoo2-hg-mirror.git",
"https://github.com/pokerth/pokerth.git",
@ -318,12 +341,16 @@
"https://github.com/red-eclipse/base.git",
"https://github.com/richardjs/Maelstrom.git",
"https://github.com/riksweeney/edgar.git",
"https://github.com/sabetts/bratwurst.git",
"https://github.com/sago007/annchienta.git",
"https://github.com/samcv/brainworkshop.git",
"https://github.com/scottschiller/ArmorAlley.git",
"https://github.com/scummvm/scummvm.git",
"https://github.com/silverweed/lifish.git",
"https://github.com/singularity/singularity.git",
"https://github.com/snauts/game-lv.git",
"https://github.com/spring/spring.git",
"https://github.com/stephank/arashi-js.git",
"https://github.com/stepmania/stepmania.git",
"https://github.com/stuntrally/stuntrally.git",
"https://github.com/subchannel13/Stareater.git",
@ -366,6 +393,9 @@
"https://github.com/xoreos/xoreos.git",
"https://github.com/zaki/irrlicht.git",
"https://github.com/zenorogue/hyperrogue.git",
"https://github.com/zombieman1041/BlakedAwesomenaughts.git",
"https://gitlab.com/KilgoreTroutMaskReplicant/1oom.git",
"https://gitlab.com/drummyfish/Bombman.git",
"https://gitlab.com/evol/evol-all.git",
"https://gitlab.com/freedroid/freedroid-src.git",
"https://gitlab.com/manaplus/manaplus.git",
@ -521,6 +551,8 @@
"http://svn.uktrainsim.com/svn/openrails/trunk",
"https://svn.code.sf.net/p/armagetronad/code/",
"https://svn.code.sf.net/p/blobby/code/",
"https://svn.code.sf.net/p/bombic/code/",
"https://svn.code.sf.net/p/bombic2/code/",
"https://svn.code.sf.net/p/crossfire/code/",
"https://svn.code.sf.net/p/daimonin/code/",
"https://svn.code.sf.net/p/etw/code/",
@ -555,6 +587,7 @@
"https://bitbucket.org/thesheep/fujo/src"
],
"bzr": [
"https://code.launchpad.net/4dtris",
"https://code.launchpad.net/heroesofwesnoth",
"https://code.launchpad.net/openhomm"
]

View File

@ -0,0 +1,17 @@
"""
Imports game details from libregamewiki by scraping the website, starting from https://libregamewiki.org/Category:Games
Also parse rejected games (https://libregamewiki.org/Libregamewiki:Rejected_games_list) and maybe https://libregamewiki.org/Libregamewiki:Suggested_games
"""
import requests
import re
if __name__ == "__main__":
regex_games = re.compile(r"<li><a href=\"\/(.+?)\".*?>(.+?)<\/a><\/li>") # url part, name
# read base url
base_url = 'https://libregamewiki.org/Category:Games'
text = requests.get(base_url).text
print(text)

View File

@ -0,0 +1,5 @@
"""
Once data from libregamewiki is imported, synchronize with our database, i.e. identify the entries both have in common,
estimate the differences in the entries both have in common, suggest to add the entries they have not in common to each
other.
"""

View File

@ -44,6 +44,9 @@ osgc_name_aliases = {}
# conversion between licenses
osgc_licenses_map = {'GPL2': 'GPL-2.0', 'GPL3': 'GPL-3.0', 'AGPL3': 'AGPL-3.0', 'LGPL3': 'LGPL-3.0', 'LGPL2': 'LGPL-2.1', 'MPL': 'MPL-2.0', 'Apache': 'Apache-2.0', 'Artistic': 'Artistic License'}
# ignore osgc entries (for various reasons like unclear license etc.)
osgc_ignored_entries = ["A Mouse's Vengeance", 'achtungkurve.com', 'AdaDoom3', 'Agendaroids', 'Alien 8', 'Ard-Reil', 'Balloon Fight', 'bladerunner (Engine within SCUMMVM)', 'Block Shooter', 'Bomb Mania Reloaded', 'boulder-dash', 'Cannon Fodder']
def similarity(a, b):
return SequenceMatcher(None, str.casefold(a), str.casefold(b)).ratio()
@ -65,7 +68,7 @@ def unique_field_contents(entries, field):
if __name__ == "__main__":
similarity_threshold = 0.8
maximal_newly_created_entries = 20
maximal_newly_created_entries = 40
# paths
root_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))
@ -88,6 +91,9 @@ if __name__ == "__main__":
osgc_entries.extend(_)
print('{} entries in osgameclones'.format(len(osgc_entries)))
# eliminate the ignored entries
osgc_entries = [x for x in osgc_entries if x['name'] not in osgc_ignored_entries]
# fix names and licenses (so they are not longer detected as deviations downstreams)
for index, entry in enumerate(osgc_entries):
name = entry['name']
@ -196,7 +202,7 @@ if __name__ == "__main__":
repos = osgc_entry['repo']
if type(repos) == str:
repos = [repos]
our_repos = our_entry['code repository']
our_repos = our_entry.get('code repository', [])
for repo in repos:
if repo.startswith('https://sourceforge.net/projects/'):
continue
@ -272,7 +278,7 @@ if __name__ == "__main__":
if not is_included:
# a new entry, that we have never seen, maybe we should make an entry of our own
continue
# continue
if newly_created_entries >= maximal_newly_created_entries:
continue
@ -282,6 +288,9 @@ if __name__ == "__main__":
if status == 'unplayable':
# for now not the unplayable ones
continue
if 'license' not in osgc_entry or 'As-is' in osgc_entry['license']:
# for now not the ones without license or with as-is license
continue
# determine file name
print('create new entry for {}'.format(osgc_name))
@ -294,7 +303,7 @@ if __name__ == "__main__":
entry = '# {}\n\n'.format(osgc_name)
# add description
description = '{} of {}'.format(game_type.capitalize(), ', '.join(osgc_entry['originals']))
description = '{} of {}.'.format(game_type.capitalize(), ', '.join(osgc_entry['originals']))
entry += '_{}_\n\n'.format(description)
# home
@ -314,11 +323,14 @@ if __name__ == "__main__":
keywords.append(game_type)
if 'originals' in osgc_entry:
originals = osgc_entry['originals']
for original in originals:
keywords.append('inspired by {}'.format(original))
if type(originals) == str:
originals = [originals]
keywords.append('inspired by {}'.format(' + '.join(original)))
if 'multiplayer' in osgc_entry:
multiplayer = osgc_entry['multiplayer']
keywords.extend(multiplayer)
if type(multiplayer) == str:
multiplayer = [multiplayer]
keywords.extend('multiplayer {}'.format(' + '.join(multiplayer)))
if 'content' in osgc_entry:
content = osgc_entry['content']
keywords.append('{} content'.format(content))
@ -333,25 +345,30 @@ if __name__ == "__main__":
entry += '- Code repository: {}\n'.format(repo)
# code language (mandatory on our side)
lang = osgc_entry.get('lang', None)
entry += '- Code language: {}\n'.format(lang)
lang = osgc_entry.get('lang', [])
if type(lang) == str:
lang = [lang]
entry += '- Code language: {}\n'.format(', '.join(lang))
# code license
entry += '- Code license: {}\n'.format(', '.join(osgc_entry['license']))
# code dependencies (if existing)
if 'framework' in osgc_entry:
entry += '- Code dependencies: {}\n'.format(', '.join(osgc_entry['framework']))
frameworks = osgc_entry['framework']
if type(frameworks) == str:
frameworks = [frameworks]
entry += '- Code dependencies: {}\n'.format(', '.join(frameworks))
# write info (if existing)
if 'info' in osgc_entry:
entry += '\n{}\n'.format(osgc_entry['info'])
# write ## Building
entry += '\n## Building:\n'
entry += '\n## Building\n'
# finally write to file
# write_text(target_file, entry)
write_text(target_file, entry)
newly_created_entries += 1

View File

@ -8,7 +8,7 @@ from utils.utils import *
essential_fields = ('Home', 'State', 'Keywords', 'Code repository', 'Code language', 'Code license')
valid_fields = ('Home', 'Media', 'State', 'Play', 'Download', 'Platform', 'Keywords', 'Code repository', 'Code language',
'Code license', 'Code dependencies', 'Assets license', 'Build system', 'Build instructions')
valid_platforms = ('Windows', 'Linux', 'macOS', 'Android', 'Browser')
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', 'remake')
regex_sanitize_name = re.compile(r"[^A-Za-z 0-9-]+")
regex_sanitize_name_space_eater = re.compile(r" +")
@ -143,7 +143,7 @@ def parse_entry(content):
for field in ['home', 'download', 'play', 'code repository']:
if field in info:
for url in info[field]:
if not (url.startswith('http://') or url.startswith('https://') or url.startswith('git://')):
if not (url.startswith('http://') or url.startswith('https://') or url.startswith('git://') or url.startswith('svn://')):
raise RuntimeError('URL "{}" in entry "{}" does not start with http'.format(url, info['name']))
if ' ' in url:
raise RuntimeError('URL "{}" in entry "{}" contains a space'.format(url, info['name']))