Skip to content

Commit

Permalink
convert comments to @.. notation
Browse files Browse the repository at this point in the history
  • Loading branch information
Trilarion committed Sep 7, 2020
1 parent 6258710 commit ec233f2
Show file tree
Hide file tree
Showing 286 changed files with 336 additions and 344 deletions.
3 changes: 3 additions & 0 deletions code/backlog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ https://github.com/cxong/cdogs-sdl
https://moaiwebsite.github.io/
http://cyxdown.free.fr/bs/
http://cyxdown.free.fr/f2b/
https://github.com/tlgkccampbell/ultraviolet
https://github.com/ianfab/Fairy-Stockfish
https://github.com/tomlooman/SimpleFPSTemplate
https://github.com/nfprojects/nfengine
http://dead-code.org/home/
http://e-adventure.e-ucm.es/login/index.php (games of eAdventure)
Expand Down
47 changes: 0 additions & 47 deletions code/maintenance_developers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
from utils import constants as c, utils, osg, osg_github


def developer_info_lookup(name):
for dev in developer_info:
if name == dev['Name']:
return dev
return None


# author names in SF that aren't the author names how we have them
SF_alias_list = {'Erik Johansson (aka feneur)': 'Erik Johansson', 'Itms': 'Nicolas Auvray',
'Wraitii': 'Lancelot de Ferrière', 'Simzer': 'Simon Laszlo', 'armin bajramovic': 'Armin Bajramovic'}
Expand Down Expand Up @@ -123,46 +116,6 @@ def test():
# store developer info
utils.write_text(os.path.join(c.root_path, 'collected_developer_info.txt'), developers)

def compare_entries_developers(entries, developers):
"""
Cross checks the game entries lists and the developers lists.
:param entries: List of game entries
:param developers: List of developers
"""

# from the entries create a dictionary with developer names
devs1 = {}
for entry in entries:
name = entry['Name']
for dev in entry.get('developer', []):
if dev in devs1:
devs1[dev].append(name)
else:
devs1[dev] = [name]
devs1_names = set(devs1.keys())

# from the developers create a dictionary with developer names
devs2 = dict(zip((dev['Name'] for dev in developers), (dev['Games'] for dev in developers)))
devs2_names = set(devs2.keys())

# devs only in entries
for dev in devs1_names - devs2_names:
print('Warning: dev "{}" only in entries ({}), not in developers'.format(dev, ','.join(devs1[dev])))
# devs only in developers
for dev in devs2_names - devs1_names:
print('Warning: dev "{}" only in developers ({}), not in entries'.format(dev, ','.join(devs2[dev])))
# for those in both, check that the games lists are equal
for dev in devs1_names.intersection(devs2_names):
games1 = set(devs1[dev])
games2 = set(devs2[dev])
delta = games1 - games2
if delta:
print('Warning: dev "{}" has games in entries ({}) that are not present in developers'.format(dev,
', '.join(
delta)))
delta = games2 - games1
if delta:
print('Warning: dev "{}" has games in developers ({}) that are not present in entries'.format(dev, delta))


class DevelopersMaintainer:
Expand Down
4 changes: 4 additions & 0 deletions code/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def get_config(key):
# only these fields can be used currently (in this order)
valid_fields = ('File', 'Title') + valid_properties + ('Note', 'Building')

url_fields = ('Home', 'Media', 'Play', 'Download', 'Code repository')

valid_url_prefixes = ('http://', 'https://', 'git://', 'svn://', 'ftp://', 'bzr://', '@see-')

valid_building_properties = ('Build system', 'Build instructions')
valid_building_fields = valid_building_properties + ('Note',)

Expand Down
30 changes: 28 additions & 2 deletions code/utils/osg.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,25 +534,51 @@ def check_and_process_entry(entry):
d[field] = value
building = d

# check valid fields TODO should also check order
# check valid fields in building TODO should also check order
for field in building.keys():
if field not in valid_building_fields:
message += 'Building field "{}" invalid\n'.format(field)
entry['Building'] = building


# check canonical file name
file = entry['File']
canonical_file_name = canonical_entry_name(entry['Title']) + '.md'
# we also allow -X with X =2..9 as possible extension (because of duplicate canonical file names)
if canonical_file_name != file and canonical_file_name != file[:-5] + '.md':
message += 'file name should be {}\n'.format(canonical_file_name)

# state must contain either beta or mature but not both
state = entry['State']
for t in state:
if t != 'beta' and t != 'mature' and not t.startswith('inactive since '):
message += 'Unknown state "{}"'.format(t)
if 'beta' in state == 'mature' in state:
message += 'State must be one of <"beta", "mature">'

# check urls
for field in url_fields:
values = entry.get(field, [])
for value in values:
if value.value.startswith('<') and value.value.endswith('>'):
value.value = value.value[1:-1]
if not any(value.startswith(x) for x in valid_url_prefixes):
message += 'URL "{}" in field "{}" does not start with a valid prefix'.format(value, field)

if message:
raise RuntimeError(message)

return entry

def extract_inactive_year(entry):
state = entry['State']
phrase = 'inactive since '
inactive_year = [x[len(phrase):] for x in state if x.startswith(phrase)]
assert len(inactive_year) <= 1
if inactive_year:
return inactive_year[0]
else:
return None


def write_entries(entries):
"""
Expand Down
20 changes: 13 additions & 7 deletions code/utils/osg_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ListingTransformer(lark.Transformer):
"""

def unquoted_value(self, x):
return x[0].value
return x[0].value.strip()

def quoted_value(self, x):
return x[0].value[1:-1].strip() # remove quotation marks and strip whitespaces
Expand All @@ -33,7 +33,7 @@ def name(self, x):
:param x:
:return:
"""
return 'Name', x[0].value
return 'Name', x[0].value.strip()

def entry(self, x):
"""
Expand All @@ -56,13 +56,13 @@ def start(self, x):
class EntryTransformer(lark.Transformer):

def unquoted_value(self, x):
return x[0].value
return x[0].value.strip()

def quoted_value(self, x):
return x[0].value[1:-1] # remove quotation marks
return x[0].value[1:-1].strip() # remove quotation marks

def comment_value(self, x):
return x[0].value[1:-1] # remove parenthesis
return x[0].value[1:-1].strip() # remove parenthesis

def value(self, x):
if len(x) == 1:
Expand All @@ -77,10 +77,10 @@ def property(self, x):
:param x:
:return:
"""
return x[0].value, x[1:]
return x[0].value.strip(), x[1:]

def title(self, x):
return 'Title', x[0].value
return 'Title', x[0].value.strip()

def note(self, x):
"""
Expand Down Expand Up @@ -109,6 +109,12 @@ def __init__(self, value, comment=None):
self.value = value
self.comment = comment

def is_empty(self):
return self.value == ''

def startswith(self, str):
return self.value.startswith(str)

def __contains__(self, item):
return item in self.value

Expand Down
2 changes: 1 addition & 1 deletion entries/2048.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Play: https://play2048.co/
- Platform: Web
- Keywords: puzzle, sliding blocks
- Code repository: https://github.com/gabrielecirulli/2048.git, https://github.com/tpcstld/2048.git (+)
- Code repository: https://github.com/gabrielecirulli/2048.git, https://github.com/tpcstld/2048.git @add
- Code language: JavaScript
- Code license: MIT
- Assets license: MIT (very few assets)
Expand Down
2 changes: 1 addition & 1 deletion entries/2moons_browsergame_engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- Download: https://github.com/jkroepke/2Moons/releases
- Platform: Web
- Keywords: simulation, framework, space, strategy
- Code repository: https://github.com/jkroepke/2Moons.git (archived), https://github.com/steemnova/steemnova.git (+)
- Code repository: https://github.com/jkroepke/2Moons.git (archived), https://github.com/steemnova/steemnova.git @add
- Code language: PHP, JavaScript
- Code license: MIT
- Developer: Jan-Otto Kröpke, Ozan Kurt, Hilarious001
Expand Down
2 changes: 1 addition & 1 deletion entries/3d_pong.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- State: beta, inactive since 2004
- Platform: Linux, macOS
- Keywords: arcade, online
- Code repository: (see home)
- Code repository: @see-home
- Code language: C
- Code license: GPL-2.0
- Developer: New Breed Software
Expand Down
2 changes: 1 addition & 1 deletion entries/3dc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: https://packages.debian.org/sid/3dchess, http://www.ibiblio.org/pub/Linux/games/strategy/3Dc-0.8.1.tar.gz
- State: mature, inactive since 2000
- Keywords: puzzle, board, chess, open content
- Code repository: (see home)
- Code repository: @see-home
- Code language: C
- Code license: GPL-2.0
- Code dependencies: libx, libxpm, xaw3dg
Expand Down
2 changes: 1 addition & 1 deletion entries/4d_maze_game.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: http://www.urticator.net/maze/
- State: mature, inactive since 2008
- Keywords: puzzle, 4D, maze navigation (educational?), open content
- Code repository: (see home)
- Code repository: @see-home
- Code language: Java
- Code license: Public domain
- Assets license: Public domain
Expand Down
2 changes: 1 addition & 1 deletion entries/54321.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: http://old.nklein.com/products/54321/
- State: mature, inactive since 2001
- Keywords: puzzle, open content
- Code repository: (see home)
- Code repository: @see-home
- Code language: C++
- Code license: Custom (a very simple copyleft see http://old.nklein.com/etc/copyright.php)
- Code dependencies: libpng, SDL, zlib
Expand Down
2 changes: 1 addition & 1 deletion entries/a7xpg.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- State: beta, inactive since 2005
- Download: https://sourceforge.net/projects/a7xpg/files/a7xpg/
- Keywords: arcade
- Code repository: (see home)
- Code repository: @see-home
- Code language: D
- Code license: 2-clause BSD
- Code dependencies: libvorbis, SDL
Expand Down
2 changes: 1 addition & 1 deletion entries/acm.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: https://packages.debian.org/sid/acm, https://web.archive.org/web/20130114223737/http://www.websimulations.com/
- State: mature, inactive since 2000
- Keywords: action, flight, open content, simulation
- Code repository: (see home)
- Code repository: @see-home
- Code language: C
- Code license: GPL-2.0
- Assets license: GPL-2.0
Expand Down
2 changes: 1 addition & 1 deletion entries/adagate.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Download: https://github.com/fastrgv/AdaGate/releases
- Platform: Windows, Linux, macOS
- Keywords: puzzle, 3D
- Code repository: (see download)
- Code repository: @see-download
- Code language: Ada
- Code license: GPL-3.0
- Code dependencies: OpenGL, SDL2
Expand Down
2 changes: 1 addition & 1 deletion entries/adanaxis.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: https://web.archive.org/web/20180818173613/http://www.mushware.com/, https://packages.qa.debian.org/a/adanaxisgpl.html
- State: mature, inactive since 2007
- Keywords: action, 4D, first-person, open content, shooter, single-player, space
- Code repository: (see home)
- Code repository: @see-home
- Code language: C++
- Code license: GPL-2.0 (non-free file in the commercial version)
- Code dependencies: GLUT
Expand Down
2 changes: 1 addition & 1 deletion entries/afternoon_stalker.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Download: http://perso.b2b2c.ca/~sarrazip/dev/afternoonstalker.html#download
- Platform: Linux
- Keywords: action, clone, remake
- Code repository: (see download)
- Code repository: @see-download
- Code language: C++
- Code license: GPL-2.0
- Code dependencies: SDL
Expand Down
2 changes: 1 addition & 1 deletion entries/airstrike.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- State: beta, inactive since 2014
- Platform: Windows, Linux
- Keywords: arcade, 2D, open content
- Code repository: (see home)
- Code repository: @see-home
- Code language: C
- Code license: GPL-2.0
- Assets license: GPL-2.0
Expand Down
2 changes: 1 addition & 1 deletion entries/aklabeth.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- State: mature, inactive since 2004
- Download: https://sourceforge.net/projects/aklabeth/files/aklabeth/
- Keywords: remake
- Code repository: (see download)
- Code repository: @see-download
- Code language: C
- Code license: GPL-2.0
- Developer: kantharos, Paul Robson
Expand Down
2 changes: 1 addition & 1 deletion entries/alien_assault_traders.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- State: beta, inactive since 2009
- Download: https://sourceforge.net/projects/aatrade/files/
- Keywords: strategy, online
- Code repository: https://github.com/tarnus/aatraders.git, https://gitlab.com/osgames/aatraders.git (+)
- Code repository: https://github.com/tarnus/aatraders.git, https://gitlab.com/osgames/aatraders.git @add
- Code language: PHP
- Code license: GPL-2.0
- Developer: Mark Dickenson, Rick Thomson
Expand Down
2 changes: 1 addition & 1 deletion entries/alive.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- State: beta
- Platform: Windows, Linux
- Keywords: action, remake
- Code repository: https://github.com/AliveTeam/alive_reversing.git, https://github.com/paulsapps/alive.git (+)
- Code repository: https://github.com/AliveTeam/alive_reversing.git, https://github.com/paulsapps/alive.git @add
- Code language: C++
- Code license: MIT
- Code dependencies: SDL2
Expand Down
2 changes: 1 addition & 1 deletion entries/amphetamine.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: https://packages.debian.org/stable/games/amphetamine, https://web.archive.org/web/20101023090423/http://homepage.hispeed.ch/loehrer/amph/amph.html
- State: beta, inactive since 2008
- Keywords: platform, open content
- Code repository: (see home)
- Code repository: @see-home
- Code language: C
- Code license: GPL-2.0
- Code dependencies: SDL
Expand Down
2 changes: 1 addition & 1 deletion entries/anagramarama.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: https://web.archive.org/web/20150412072808/http://www.coralquest.com/anagramarama/
- State: beta, inactive since 2002
- Keywords: puzzle, open content
- Code repository: (see home)
- Code repository: @see-home
- Code language: C
- Code license: GPL-2.0
- Assets license: GPL-2.0
Expand Down
2 changes: 1 addition & 1 deletion entries/antares.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: https://arescentral.org/antares
- Inspirations: Ares
- State: beta
- Download: (see home)
- Download: @see-home
- Keywords: strategy, real time, remake, shooter
- Code repository: https://github.com/arescentral/antares.git
- Code language: C++
Expand Down
2 changes: 1 addition & 1 deletion entries/apricots.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- Home: https://web.archive.org/web/20110819212117/http://www.fishies.org.uk/apricots.html
- State: beta, inactive since 2003
- Keywords: arcade, 2D, open content, side-scrolling
- Code repository: (see home)
- Code repository: @see-home
- Code language: C++
- Code license: GPL-2.0
- Code dependencies: SDL
Expand Down
2 changes: 1 addition & 1 deletion entries/argentum_online.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- State: beta, inactive since 2014
- Download: https://www.comunidadargentum.com/descargas/, https://sourceforge.net/projects/morgoao/files/
- Keywords: role playing, multiplayer online + massive
- Code repository: https://github.com/ao-libre/ao-server.git, https://github.com/ao-libre/ao-cliente.git (+), https://github.com/ao-libre/ao-worldeditor.git (+), http://morgoao.cvs.sourceforge.net/ (cvs)
- Code repository: https://github.com/ao-libre/ao-server.git, https://github.com/ao-libre/ao-cliente.git @add, https://github.com/ao-libre/ao-worldeditor.git @add, http://morgoao.cvs.sourceforge.net/ (cvs)
- Code language: Visual Basic
- Code license: GPL-2.0, AGPL-3.0

Expand Down
2 changes: 1 addition & 1 deletion entries/artillery_duel_reloaded.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- State: beta, inactive since 2012
- Download: https://code.google.com/archive/p/artillery-duel-reloaded/downloads
- Keywords: action, remake
- Code repository: (see download)
- Code repository: @see-download
- Code language: Python
- Code license: GPL-3.0

Expand Down
2 changes: 1 addition & 1 deletion entries/atomic_tanks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Download: https://sourceforge.net/projects/atanks/files/
- Platform: Windows, Linux
- Keywords: action, artillery, open content, remake
- Code repository: https://git.code.sf.net/p/atanks/atanks, https://gitlab.com/osgames/atanks.git (+)
- Code repository: https://git.code.sf.net/p/atanks/atanks, https://gitlab.com/osgames/atanks.git @add
- Code language: C++
- Code license: GPL-2.0
- Code dependencies: Allegro
Expand Down
Loading

0 comments on commit ec233f2

Please sign in to comment.