additions from backlog
This commit is contained in:
@ -99,6 +99,7 @@
|
||||
"https://github.com/AndO3131/lgeneral.git",
|
||||
"https://github.com/Andrettin/Wyrmgus.git",
|
||||
"https://github.com/Anthonymcqueen21/Pygame---Alien-Invasion.git",
|
||||
"https://github.com/Anuken/Mindustry.git",
|
||||
"https://github.com/Arantis/Meridian59_112.git",
|
||||
"https://github.com/Argentum-Online/Argentum-Online.git",
|
||||
"https://github.com/ArmageddonGames/ZeldaClassic.git",
|
||||
@ -352,6 +353,7 @@
|
||||
"https://github.com/antionio/game-off-2013.git",
|
||||
"https://github.com/anttisalonen/freekick3.git",
|
||||
"https://github.com/anttisalonen/kingdoms.git",
|
||||
"https://github.com/anura-engine/anura.git",
|
||||
"https://github.com/aperture-software/colditz-escape.git",
|
||||
"https://github.com/apsillers/Taggem.git",
|
||||
"https://github.com/apsillers/lords-of-the-fey.git",
|
||||
@ -366,6 +368,8 @@
|
||||
"https://github.com/basicallydan/skifree.js.git",
|
||||
"https://github.com/benjaminfoo/OpenTriad.git",
|
||||
"https://github.com/bibendovsky/bstone.git",
|
||||
"https://github.com/bitcraft/PyTMX.git",
|
||||
"https://github.com/bitcraft/pyscroll.git",
|
||||
"https://github.com/bladecoder/bladecoder-adventure-engine.git",
|
||||
"https://github.com/blakeohare/pyweek-sentientstorage.git",
|
||||
"https://github.com/blockattack/blockattack-game.git",
|
||||
@ -401,6 +405,8 @@
|
||||
"https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source.git",
|
||||
"https://github.com/craftworkgames/infiniminer.git",
|
||||
"https://github.com/crawl/crawl.git",
|
||||
"https://github.com/crosire/reshade.git",
|
||||
"https://github.com/crossuo/crossuo.git",
|
||||
"https://github.com/cthielen/Epiar.git",
|
||||
"https://github.com/cubei/FlappyCow.git",
|
||||
"https://github.com/cubosphere/cubosphere-code.git",
|
||||
@ -461,6 +467,7 @@
|
||||
"https://github.com/fasterthanlime/isaac-paper.git",
|
||||
"https://github.com/fastrgv/AdaVenture.git",
|
||||
"https://github.com/fifengine/fifengine.git",
|
||||
"https://github.com/flixel-gdx/flixel-gdx.git",
|
||||
"https://github.com/fofix/fofix.git",
|
||||
"https://github.com/fogleman/Craft.git",
|
||||
"https://github.com/fph/bastet.git",
|
||||
@ -862,6 +869,7 @@
|
||||
"https://gitlab.com/osgames/dark-oberon.git",
|
||||
"https://gitlab.com/osgames/darkcity.git",
|
||||
"https://gitlab.com/osgames/darkdestiny.git",
|
||||
"https://gitlab.com/osgames/deathchase3d.git",
|
||||
"https://gitlab.com/osgames/deity.git",
|
||||
"https://gitlab.com/osgames/deliantra.git",
|
||||
"https://gitlab.com/osgames/devana.git",
|
||||
@ -948,6 +956,7 @@
|
||||
"https://gitlab.com/osgames/slaygame.git",
|
||||
"https://gitlab.com/osgames/snowstorm.git",
|
||||
"https://gitlab.com/osgames/softpixelengine.git",
|
||||
"https://gitlab.com/osgames/solarwolf.git",
|
||||
"https://gitlab.com/osgames/sopwith3.git",
|
||||
"https://gitlab.com/osgames/spaceopera.git",
|
||||
"https://gitlab.com/osgames/spicetrade.git",
|
||||
@ -1008,6 +1017,7 @@
|
||||
"https://svn.code.sf.net/p/lgames/code/",
|
||||
"https://svn.code.sf.net/p/pio/code/",
|
||||
"https://svn.code.sf.net/p/planeshift/code/",
|
||||
"https://svn.code.sf.net/p/plib/code/",
|
||||
"https://svn.code.sf.net/p/privateer/code/",
|
||||
"https://svn.code.sf.net/p/quakespasm/code/",
|
||||
"https://svn.code.sf.net/p/spacezero/code/",
|
||||
|
@ -36,10 +36,12 @@ http://openapoc.pmprog.co.uk/
|
||||
http://pathfinder.wikia.com/wiki/Pathfinder_Roleplaying_Game
|
||||
http://phaser.io/
|
||||
http://playir.com/
|
||||
http://plib.sourceforge.net/
|
||||
http://psyco.sourceforge.net/
|
||||
http://pyglet.org/
|
||||
http://pyopengl.sourceforge.net/
|
||||
https://appimage.github.io/categories/Game
|
||||
https://github.com/gnFur/Monofoxe
|
||||
https://github.com/moonwards1/Moonwards-Virtual-Moon
|
||||
http://pypy.org/
|
||||
http://rcbasic.com/
|
||||
http://retrospec.sgn.net
|
||||
http://sam.zoy.org/monsterz/
|
||||
@ -157,13 +159,10 @@ https://freegamer.blogspot.com (maybe there is something interesting)
|
||||
https://futurepinball.com/
|
||||
https://gamejolt.com/ (search there)
|
||||
https://gdevelop-app.com/
|
||||
https://github.com/anura-engine/anura
|
||||
https://github.com/amerkoleci/Vortice.Windows
|
||||
https://github.com/ao-libre/ao-cliente
|
||||
https://github.com/atphalix/nexuiz
|
||||
https://github.com/azhirnov/FrameGraph
|
||||
https://github.com/bitcraft/pyscroll
|
||||
https://github.com/bitcraft/PyTMX
|
||||
https://github.com/born2snipe/flixel-gdx
|
||||
https://github.com/bsmr-games (also contains copies)
|
||||
https://github.com/CatacombGames/
|
||||
https://github.com/Chluverman/android-gltron
|
||||
@ -176,8 +175,6 @@ https://github.com/collections/tools-for-open-source (maybe we can apply some)
|
||||
https://github.com/collections/web-games (only OS)
|
||||
https://github.com/Cortrah/SpaceOperaDesign, https://github.com/Cortrah/SpaceOperaRuby/blob/master/design/turnstyles.md
|
||||
https://github.com/cping/LGame
|
||||
https://github.com/crosire/reshade
|
||||
https://github.com/crossuo/crossuo
|
||||
https://github.com/DaanVanYperen/artemis-odb-contrib
|
||||
https://github.com/DeflatedPickle/FAOSDance
|
||||
https://github.com/Donerkebap13/DonerComponents
|
||||
@ -190,9 +187,11 @@ https://github.com/fallahn/xygine
|
||||
https://github.com/fegennari/3DWorld
|
||||
https://github.com/flathub (all repositories which are games there)
|
||||
https://github.com/FUSEEProjectTeam/Fusee
|
||||
https://github.com/fynnfluegge/oreon-engine
|
||||
https://github.com/gamearians
|
||||
https://github.com/GamedevFramework/gf
|
||||
https://github.com/grantjenks/free-python-games (check all)
|
||||
https://github.com/Hotride/OrionUO
|
||||
https://github.com/hparcells/cards-against-humanity
|
||||
https://github.com/i42output/neoGFX
|
||||
https://github.com/id-Software
|
||||
@ -200,6 +199,7 @@ https://github.com/JohanLi/uncharted-waters-2
|
||||
https://github.com/junkdog/artemis-odb
|
||||
https://github.com/LgLinus/StrategyGame
|
||||
https://github.com/libretro/libretro-prboom
|
||||
https://github.com/ligurio/awesome-ttygames
|
||||
https://github.com/MarcoLizza/tofu-engine
|
||||
https://github.com/mewo2/terrain
|
||||
https://github.com/morganbengtsson/mos
|
||||
@ -216,6 +216,7 @@ https://github.com/pld-linux
|
||||
https://github.com/pld-linux/nexuiz/blob/master/nexuiz.spec
|
||||
https://github.com/psuong/ig-developer-console
|
||||
https://github.com/qiciengine/qiciengine
|
||||
https://github.com/Renanse/Ardor3D
|
||||
https://github.com/rizwan3d/MotoGameEngine
|
||||
https://github.com/rlguy/FantasyMapGenerator
|
||||
https://github.com/RoxasShadow/Sottaceto
|
||||
@ -234,6 +235,7 @@ https://github.com/Tinob/Ishiiruka (https://github.com/shiiion/Ishiiruka, https:
|
||||
https://github.com/TomBebb/awe
|
||||
https://github.com/Wargus/stratagus
|
||||
https://github.com/wesnoth/haldric
|
||||
https://github.com/Zal0/ZGB
|
||||
https://gitlab.com/LibreGames
|
||||
https://gitlab.com/nyov/nyovs-nexuiz
|
||||
https://gitlab.com/vgstation/vgstation-old (and vgstation in general)
|
||||
@ -381,6 +383,7 @@ https://www.reddit.com/r/opensourcegames/comments/celw6c/top_3_open_source_pinba
|
||||
https://www.renpy.org/ (also all projects linked there)
|
||||
https://www.scirra.com/construct2
|
||||
https://www.tapatalk.com/groups/imperilist/
|
||||
https://www.tuxfamily.org/ (if there are games)
|
||||
https://www.wurfelengine.net/
|
||||
https://wxpython.org/
|
||||
https://zope.readthedocs.io/en/latest/
|
@ -5,11 +5,14 @@ Also parse rejected games (https://libregamewiki.org/Libregamewiki:Rejected_game
|
||||
|
||||
Unique left column names in the game info boxes:
|
||||
['Code license', 'Code licenses', 'Developer', 'Developers', 'Engine', 'Engines', 'Genre', 'Genres', 'Libraries', 'Library', 'Media license', 'Media licenses', 'P. language', 'P. languages', 'Platforms']
|
||||
|
||||
TODO there are games on LGW which are not part of the Games category but part of XXX-Games sub-categories
|
||||
"""
|
||||
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
import re
|
||||
from bs4 import BeautifulSoup
|
||||
from utils import constants, utils, osg
|
||||
|
||||
@ -210,6 +213,39 @@ def lower_case_content(entries, field):
|
||||
entries[index] = entry
|
||||
return entries
|
||||
|
||||
|
||||
def remove_parenthized_content(entries, fields):
|
||||
if not isinstance(fields, tuple):
|
||||
fields = (fields, )
|
||||
for index, entry in enumerate(entries):
|
||||
for field in fields:
|
||||
if field in entry:
|
||||
content = entry[field]
|
||||
if not isinstance(content, list):
|
||||
content = [content]
|
||||
content = [re.sub(r'\([^)]*\)', '', c) for c in content] # remove parentheses content
|
||||
content = [x.strip() for x in content]
|
||||
content = list(set(content))
|
||||
entry[field] = content
|
||||
entries[index] = entry
|
||||
return entries
|
||||
|
||||
|
||||
def ignore_nonnumbers(entries, fields):
|
||||
if not isinstance(fields, tuple):
|
||||
fields = (fields, )
|
||||
for index, entry in enumerate(entries):
|
||||
for field in fields:
|
||||
if field in entry:
|
||||
content = entry[field]
|
||||
if not isinstance(content, list):
|
||||
content = [content]
|
||||
content = [x for x in content if x.isdigit()]
|
||||
entry[field] = content
|
||||
entries[index] = entry
|
||||
return entries
|
||||
|
||||
|
||||
def clean_lgw_content():
|
||||
|
||||
# paths
|
||||
@ -257,6 +293,7 @@ def clean_lgw_content():
|
||||
print('mandatory lgw fields: {}'.format(sorted(list(mandatory_fields))))
|
||||
|
||||
# content replacements
|
||||
entries = remove_parenthized_content(entries, ('assets license', 'code language', 'code license', 'engine', 'genre', 'last active', 'library'))
|
||||
entries = remove_prefix_suffix(entries, ('code license', 'assets license'), ('"', 'GNU', ), ('"', '[3]', '[2]', '[1]', 'only'))
|
||||
entries = replace_content(entries, ('code license', 'assets license'), 'GPL', ('General Public License', ))
|
||||
entries = replace_content(entries, ('code license', 'assets license'), 'GPLv2', ('GPL v2', 'GPL version 2.0', 'GPL 2.0'))
|
||||
@ -267,6 +304,8 @@ def clean_lgw_content():
|
||||
entries = replace_content(entries, ('code license', 'assets license'), 'zlib', ('zlib/libpng license', ))
|
||||
entries = replace_content(entries, ('code license', 'assets license'), 'BSD', ('Original BSD License', ))
|
||||
entries = replace_content(entries, ('code license', 'assets license'), 'CC-BY-SA-3.0', ('Creative Commons Attribution-ShareAlike 3.0 Unported License', 'CC-BY-SA 3.0', 'CC BY-SA 3.0'))
|
||||
entries = replace_content(entries, ('code license', 'assets license'), 'CC-BY-SA', ('CC BY-SA',))
|
||||
entries = replace_content(entries, ('code license', 'assets license'), 'MIT', ('MIT License',))
|
||||
entries = replace_content(entries, 'platform', 'macOS', ('Mac', ))
|
||||
entries = remove_prefix_suffix(entries, 'code language', (), ('[3]', '[2]', '[1]'))
|
||||
entries = ignore_content(entries, 'code language', ('HTML5', 'HTML', 'English', 'XML', 'WML'))
|
||||
@ -282,6 +321,9 @@ def clean_lgw_content():
|
||||
entries = replace_content(entries, 'library', 'pygame', ('Pygame', ))
|
||||
entries = replace_content(entries, 'library', 'Qt', ('QT', ))
|
||||
entries = ignore_content(entries, 'library', ('C++', 'Lua', 'Mozilla Firefox'))
|
||||
entries = ignore_nonnumbers(entries, 'last active')
|
||||
entries = ignore_content(entries, 'last active', ('2019', ))
|
||||
entries = ignore_content(entries, 'platform', ('DOS', ))
|
||||
|
||||
# list for every unique field
|
||||
# fields = sorted(list(unique_fields))
|
||||
|
@ -19,34 +19,20 @@ linux-packages - > free text (info)
|
||||
name -> name
|
||||
platform -> platform
|
||||
|
||||
TODO also ignore our rejected entries
|
||||
"""
|
||||
|
||||
import json
|
||||
from utils.osg import *
|
||||
|
||||
|
||||
def get_unique_field_content(field, entries):
|
||||
"""
|
||||
|
||||
"""
|
||||
unique_content = {}
|
||||
for entry in entries:
|
||||
for element in entry.get(field, []):
|
||||
unique_content[element] = unique_content.get(element, 0) + 1
|
||||
unique_content = list(unique_content.items())
|
||||
unique_content.sort(key=lambda x: -x[1])
|
||||
unique_content = ['{}({})'.format(k, v) for k, v in unique_content]
|
||||
return unique_content
|
||||
|
||||
import os
|
||||
from utils import constants, utils, osg
|
||||
|
||||
|
||||
name_replacements = {'Eat the Whistle': 'Eat The Whistle', 'Scorched 3D': 'Scorched3D', 'Silver Tree': 'SilverTree', 'Blob Wars Episode 1 : Metal Blob Solid': 'Blobwars: Metal Blob Solid', 'Adventure': 'Colossal Cave Adventure',
|
||||
'Fall Of Imiryn': 'Fall of Imiryn', 'Liquid War 6': 'Liquid War', 'Gusanos': 'GUSANOS', 'Corewars': 'Core War', 'FLARE': 'Flare', 'Vitetris': 'vitetris', 'Powder Toy': 'The Powder Toy', 'Asylum': 'SDL Asylum',
|
||||
'Atanks': 'Atomic Tanks'}
|
||||
'Atanks': 'Atomic Tanks', 'HeXon': 'heXon', 'Unnethack': 'UnNetHack', 'Nova Pinball': 'NOVA PINBALL', 'Jump n Bump': "Jump'n'Bump"}
|
||||
ignored_names = ['Hetris', '8 Kingdoms', 'Antigravitaattori', 'Arena of Honour', 'Arkhart', 'Ascent of Justice', 'Balazar III', 'Balder3D', 'Barbie Seahorse Adventures', 'Barrage', 'Gnome Batalla Naval', 'User:AVRS/sandbox']
|
||||
|
||||
|
||||
|
||||
def list_compare(a, b, k):
|
||||
"""
|
||||
|
||||
@ -64,24 +50,20 @@ if __name__ == "__main__":
|
||||
maximal_newly_created_entries = 40
|
||||
|
||||
# paths
|
||||
root_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))
|
||||
import_path = os.path.join(constants.root_path, 'tools', 'lgw-import')
|
||||
lgw_entries_file = os.path.join(import_path, '_lgw.cleaned.json')
|
||||
|
||||
# import lgw import
|
||||
json_path = os.path.join(root_path, os.pardir, 'lgw_import.json')
|
||||
text = read_text(json_path)
|
||||
text = utils.read_text(lgw_entries_file)
|
||||
lgw_entries = json.loads(text)
|
||||
|
||||
# perform replacements and disregarding
|
||||
# perform name replacements
|
||||
lgw_entries = [x for x in lgw_entries if x['name'] not in ignored_names]
|
||||
for index, lgw_entry in enumerate(lgw_entries):
|
||||
if lgw_entry['name'] in name_replacements:
|
||||
lgw_entry['name'] = name_replacements[lgw_entry['name']]
|
||||
if 'code language' in lgw_entry:
|
||||
languages = lgw_entry['code language']
|
||||
languages = ['Python' if x.startswith('Python') else x for x in languages]
|
||||
languages = ['PHP' if x.startswith('PHP') else x for x in languages]
|
||||
languages = ['Lua' if x.lower().startswith('lua') else x for x in languages]
|
||||
languages = ['JavaScript' if x.lower().startswith('javascript') else x for x in languages]
|
||||
h = []
|
||||
for l in languages:
|
||||
for g in ('/', 'and'):
|
||||
@ -91,71 +73,13 @@ if __name__ == "__main__":
|
||||
if type(l) == str:
|
||||
l = [l]
|
||||
h.extend(l)
|
||||
languages = ['C++' if x.startswith('C++') else x for x in h]
|
||||
languages = ['C' if x.startswith('C ') or x.startswith('C[') else x for x in languages]
|
||||
languages = [x for x in languages if x not in ignored_languages]
|
||||
languages = h
|
||||
if languages:
|
||||
lgw_entry['code language'] = languages
|
||||
else:
|
||||
del lgw_entry['code language']
|
||||
if 'categories' in lgw_entry:
|
||||
categories = lgw_entry['categories']
|
||||
categories = [x for x in categories if not x.startswith('Game')]
|
||||
categories = [x for x in categories if not x.startswith('Article')]
|
||||
categories = [x for x in categories if not x.startswith('Page')]
|
||||
categories = [x for x in categories if x not in ignored_categories]
|
||||
categories = [x.lower() if len(x) > 2 else x for x in categories]
|
||||
if categories:
|
||||
lgw_entry['categories'] = categories
|
||||
else:
|
||||
del lgw_entry['categories']
|
||||
if 'genre' in lgw_entry:
|
||||
genres = lgw_entry['genre']
|
||||
genres = [x for x in genres if len(x) > 0]
|
||||
genres = [x.lower() for x in genres]
|
||||
genres = [x[:-5] if x.endswith(' game') else x for x in genres]
|
||||
genres = [x[:-5] if x.endswith(' games') else x for x in genres]
|
||||
genres = [genre_replacements[x] if x in genre_replacements else x for x in genres]
|
||||
for h in ('platform',):
|
||||
genres = [h if x.startswith(h) else x for x in genres]
|
||||
if genres:
|
||||
lgw_entry['genre'] = genres
|
||||
else:
|
||||
del lgw_entry['genre']
|
||||
if 'library' in lgw_entry:
|
||||
libraries = lgw_entry['library']
|
||||
libraries = [library_replacements[x] if x in library_replacements else x for x in libraries]
|
||||
lgw_entry['library'] = libraries
|
||||
if 'code license' in lgw_entry:
|
||||
licenses = lgw_entry['code license']
|
||||
licenses = [x.strip() for x in licenses] # strip
|
||||
licenses = [x[1:] if x.startswith('"') else x for x in licenses] # cut " at the beginning
|
||||
licenses = [x[:-1] if x.endswith('"') else x for x in licenses] # cut " at the end
|
||||
licenses = [x[4:] if x.startswith('GNU ') else x for x in licenses]
|
||||
licenses = [x[:-3] if x.endswith('[1]') or x.endswith('[2]') else x for x in licenses]
|
||||
licenses = [x[:-8] if x.lower().endswith(' license') else x for x in licenses]
|
||||
licenses = [x.strip() for x in licenses] # strip
|
||||
#licenses = ['GPL-2.0' if x.startswith('GPLv2') or x.startswith('GPL v2') or x.startswith('GPL 2') else x for x in licenses]
|
||||
#licenses = ['GPL-3.0' if x.startswith('GPLv3') or x.startswith('GPL v3') or x.startswith('GPL 3') or x.startswith('GPL v.3') else x for x in licenses]
|
||||
licenses = ['Public domain' if x.lower().startswith('public domain') else x for x in licenses]
|
||||
lgw_entry['code license'] = licenses
|
||||
if 'assets license' in lgw_entry:
|
||||
licenses = lgw_entry['assets license']
|
||||
licenses = [x.strip() for x in licenses] # strip
|
||||
licenses = [x[1:] if x.startswith('"') else x for x in licenses] # cut " at the beginning
|
||||
licenses = [x[:-1] if x.endswith('"') else x for x in licenses] # cut " at the end
|
||||
licenses = [x[4:] if x.startswith('GNU ') else x for x in licenses]
|
||||
licenses = [x[:-3] if x.endswith('[1]') or x.endswith('[2]') else x for x in licenses]
|
||||
licenses = [x[:-8] if x.lower().endswith(' license') else x for x in licenses]
|
||||
licenses = [x.strip() for x in licenses] # strip
|
||||
licenses = ['GPL-2.0' if x.startswith('GPLv2') or x.startswith('GPL v2') or x.startswith('GPL 2') else x for x in licenses]
|
||||
licenses = ['GPL-3.0' if x.startswith('GPLv3') or x.startswith('GPL v3') or x.startswith('GPL 3') or x.startswith('GPL v.3') else x for x in licenses]
|
||||
licenses = ['Public domain' if x.lower().startswith('public domain') else x for x in licenses]
|
||||
lgw_entry['assets license'] = licenses
|
||||
|
||||
lgw_entries[index] = lgw_entry
|
||||
|
||||
|
||||
# check for unique field names
|
||||
unique_fields = set()
|
||||
for lgw_entry in lgw_entries:
|
||||
@ -163,23 +87,14 @@ if __name__ == "__main__":
|
||||
print('unique lgw fields: {}'.format(sorted(list(unique_fields))))
|
||||
|
||||
# which fields are mandatory
|
||||
mandatory_fields = unique_fields.copy()
|
||||
for lgw_entry in lgw_entries:
|
||||
remove_fields = [field for field in unique_fields if field not in lgw_entry]
|
||||
unique_fields -= set(remove_fields)
|
||||
print('mandatory lgw fields: {}'.format(sorted(list(unique_fields))))
|
||||
|
||||
# unique contents
|
||||
print('{}: {}'.format('platform', get_unique_field_content('platform', lgw_entries)))
|
||||
print('{}: {}'.format('code language', get_unique_field_content('code language', lgw_entries)))
|
||||
print('{}: {}'.format('categories', get_unique_field_content('categories', lgw_entries)))
|
||||
print('{}: {}'.format('genre', get_unique_field_content('genre', lgw_entries)))
|
||||
print('{}: {}'.format('library', get_unique_field_content('library', lgw_entries)))
|
||||
print('{}: {}'.format('code license', get_unique_field_content('code license', lgw_entries)))
|
||||
print('{}: {}'.format('assets license', get_unique_field_content('assets license', lgw_entries)))
|
||||
print('{}: {}'.format('engine', get_unique_field_content('engine', lgw_entries)))
|
||||
remove_fields = [field for field in mandatory_fields if field not in lgw_entry]
|
||||
mandatory_fields -= set(remove_fields)
|
||||
print('mandatory lgw fields: {}'.format(sorted(list(mandatory_fields ))))
|
||||
|
||||
# read our database
|
||||
our_entries = assemble_infos(c.entries_path)
|
||||
our_entries = osg.assemble_infos()
|
||||
print('{} entries with us'.format(len(our_entries)))
|
||||
|
||||
# just the names
|
||||
@ -194,7 +109,7 @@ if __name__ == "__main__":
|
||||
#print('similar names')
|
||||
#for lgw_name in lgw_names:
|
||||
# for our_name in our_names:
|
||||
# if game_name_similarity(lgw_name, our_name) > similarity_threshold:
|
||||
# if osg.game_name_similarity(lgw_name, our_name) > similarity_threshold:
|
||||
# print('{} - {}'.format(lgw_name, our_name))
|
||||
|
||||
newly_created_entries = 0
|
||||
@ -234,11 +149,11 @@ if __name__ == "__main__":
|
||||
|
||||
# determine file name
|
||||
print('create new entry for {}'.format(lgw_name))
|
||||
file_name = canonical_game_name(lgw_name) + '.md'
|
||||
target_file = os.path.join(entries_path, file_name)
|
||||
file_name = osg.canonical_game_name(lgw_name) + '.md'
|
||||
target_file = os.path.join(constants.entries_path, file_name)
|
||||
if os.path.isfile(target_file):
|
||||
print('warning: file {} already existing, save under slightly different name'.format(file_name))
|
||||
target_file = os.path.join(entries_path, file_name[:-3] + '-duplicate.md')
|
||||
target_file = os.path.join(constants.entries_path, file_name[:-3] + '-duplicate.md')
|
||||
if os.path.isfile(target_file):
|
||||
continue # just for safety reasons
|
||||
|
||||
@ -300,5 +215,5 @@ if __name__ == "__main__":
|
||||
entry += '\n## Building\n'
|
||||
|
||||
# finally write to file
|
||||
write_text(target_file, entry)
|
||||
# utils.write_text(target_file, entry)
|
||||
newly_created_entries += 1
|
@ -32,10 +32,13 @@ info -> after fields
|
||||
updated not used
|
||||
images not used
|
||||
video: not used
|
||||
|
||||
TODO also ignore our rejected entries
|
||||
"""
|
||||
|
||||
import ruamel_yaml as yaml
|
||||
from utils.osg import *
|
||||
import os
|
||||
from utils import constants, utils, osg
|
||||
|
||||
# should change on osgameclones
|
||||
osgc_name_aliases = {'4DTris': '4D-TRIS', 'fheroes2': 'Free Heroes 2', 'DrCreep': 'The Castles of Dr. Creep', 'Duke3d_win32': 'Duke3d_w32', 'erampage (EDuke32 fork)': 'erampage', 'GNOME Atomix': 'Atomix', 'Head over Heels 2': 'Head over Heels',
|
||||
@ -64,10 +67,10 @@ def unique_field_contents(entries, field):
|
||||
for entry in entries:
|
||||
if field in entry:
|
||||
field_content = entry[field]
|
||||
if type(field_content) is str:
|
||||
unique_content.add(field_content)
|
||||
else:
|
||||
if type(field_content) is list:
|
||||
unique_content.update(field_content)
|
||||
else:
|
||||
unique_content.add(field_content)
|
||||
unique_content = sorted(list(unique_content), key=str.casefold)
|
||||
return unique_content
|
||||
|
||||
@ -98,7 +101,26 @@ if __name__ == "__main__":
|
||||
osgc_entries.extend(_)
|
||||
print('{} entries in osgameclones'.format(len(osgc_entries)))
|
||||
|
||||
print('osgc-languages: {}'.format(unique_field_contents(osgc_entries, 'lang')))
|
||||
# which fields do they have
|
||||
osgc_fields = set()
|
||||
for osgc_entry in osgc_entries:
|
||||
osgc_fields.update(osgc_entry.keys())
|
||||
print('unique osgc-fields: {}'.format(osgc_fields))
|
||||
|
||||
for field in osgc_fields:
|
||||
if field in ('video', 'feed', 'url', 'repo', 'info', 'updated', 'images', 'name', 'originals'):
|
||||
continue
|
||||
content = [entry[field] for entry in osgc_entries if field in entry]
|
||||
# flatten
|
||||
flat_content = []
|
||||
for c in content:
|
||||
if isinstance(c, list):
|
||||
flat_content.extend(c)
|
||||
else:
|
||||
flat_content.append(c)
|
||||
statistics = utils.unique_elements_and_occurrences(flat_content)
|
||||
statistics.sort(key=str.casefold)
|
||||
print('\n{}: {}'.format(field, ', '.join(statistics)))
|
||||
|
||||
# eliminate the ignored entries
|
||||
osgc_entries = [x for x in osgc_entries if x['name'] not in osgc_ignored_entries]
|
||||
@ -146,7 +168,7 @@ if __name__ == "__main__":
|
||||
print('osgc-content: {}'.format(unique_field_contents(osgc_entries, 'content')))
|
||||
|
||||
# read our database
|
||||
our_entries = assemble_infos(c.entries_path)
|
||||
our_entries = osg.assemble_infos()
|
||||
print('{} entries with us'.format(len(our_entries)))
|
||||
|
||||
# just the names
|
||||
@ -160,7 +182,7 @@ if __name__ == "__main__":
|
||||
# find similar names among the rest
|
||||
for osgc_name in osgc_names:
|
||||
for our_name in our_names:
|
||||
if game_name_similarity(osgc_name, our_name) > similarity_threshold:
|
||||
if osg.game_name_similarity(osgc_name, our_name) > similarity_threshold:
|
||||
print('{} - {}'.format(osgc_name, our_name))
|
||||
|
||||
newly_created_entries = 0
|
||||
@ -231,9 +253,9 @@ if __name__ == "__main__":
|
||||
urls = osgc_entry['url']
|
||||
if type(urls) == str:
|
||||
urls = [urls]
|
||||
urls = [strip_url(url) for url in urls]
|
||||
urls = [utils.strip_url(url) for url in urls]
|
||||
our_urls = our_entry['home']
|
||||
our_urls = [strip_url(url) for url in our_urls]
|
||||
our_urls = [utils.strip_url(url) for url in our_urls]
|
||||
for url in urls:
|
||||
if url not in our_urls:
|
||||
p += ' home url {} missing\n'.format(url)
|
||||
@ -311,11 +333,11 @@ if __name__ == "__main__":
|
||||
|
||||
# determine file name
|
||||
print('create new entry for {}'.format(osgc_name))
|
||||
file_name = canonical_game_name(osgc_name) + '.md'
|
||||
target_file = os.path.join(entries_path, file_name)
|
||||
file_name = osg.canonical_game_name(osgc_name) + '.md'
|
||||
target_file = os.path.join(constants.entries_path, file_name)
|
||||
if os.path.isfile(target_file):
|
||||
print('warning: file {} already existing, save under slightly different name'.format(file_name))
|
||||
target_file = os.path.join(entries_path, file_name[:-3] + '-duplicate.md')
|
||||
target_file = os.path.join(constants.entries_path, file_name[:-3] + '-duplicate.md')
|
||||
if os.path.isfile(target_file):
|
||||
continue # just for safety reasons
|
||||
|
||||
@ -393,7 +415,7 @@ if __name__ == "__main__":
|
||||
entry += '\n## Building\n'
|
||||
|
||||
# finally write to file
|
||||
# write_text(target_file, entry)
|
||||
# utils.write_text(target_file, entry)
|
||||
newly_created_entries += 1
|
||||
|
||||
|
||||
|
@ -57,6 +57,7 @@ MultiGame (https://github.com/whendricso/MultiGame): Commercial
|
||||
New RAW (http://sourceforge.net/projects/newraw/, http://svn.code.sf.net/p/newraw/code/): Early development, requires original content, abandoned
|
||||
Open General (http://www.open-general.com/, https://sourceforge.net/projects/opengeneral/, https://svn.code.sf.net/p/opengeneral/code/): Proprietary license (see credits.txt)
|
||||
OpenDeathValley (https://github.com/OpenDeathValley/OpenDeathValley.git): No instructions, no releases, no website, not much code
|
||||
OpenMB (https://github.com/cookgreen/OpenMB): Very early development stage, maybe later
|
||||
OpenOutcast (https://sourceforge.net/projects/ocmod/): Very early development, no release, short svn history, abandoned
|
||||
OpenPop (http://openpopulous.sourceforge.net/, https://sourceforge.net/projects/openpopulous/, https://svn.code.sf.net/p/openpopulous/code/): Very early development
|
||||
openStrato (https://github.com/gerdl/openStrato.git): Not much code, no release or demo site, short code history, abandoned
|
||||
|
@ -301,7 +301,10 @@ def unique_elements_and_occurrences(elements):
|
||||
"""
|
||||
unique_elements = {}
|
||||
for element in elements:
|
||||
unique_elements[element] = unique_elements.get(element, 0) + 1
|
||||
try:
|
||||
unique_elements[element] = unique_elements.get(element, 0) + 1
|
||||
except Exception as e:
|
||||
print(e)
|
||||
unique_elements = list(unique_elements.items())
|
||||
unique_elements.sort(key=lambda x: -x[1])
|
||||
unique_elements = ['{}({})'.format(k, v) for k, v in unique_elements]
|
||||
|
Reference in New Issue
Block a user