[game-data-packager] 01/01: list freeware & demos in HTML overview
Alexandre Detiste
detiste-guest at moszumanska.debian.org
Mon Jul 6 10:57:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
detiste-guest pushed a commit to branch master
in repository game-data-packager.
commit 338a426b8e0a6ecebafa367f80f4c22e34fa0ad2
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date: Mon Jul 6 12:56:48 2015 +0200
list freeware & demos in HTML overview
---
tools/babel.py | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/tools/babel.py b/tools/babel.py
index 0f86f93..d4c52c0 100755
--- a/tools/babel.py
+++ b/tools/babel.py
@@ -18,7 +18,7 @@
# Online at http://users.teledisnet.be/ade15809/babel.html
-from game_data_packager import load_games
+from game_data_packager import (load_games, GameData, FillResult)
from game_data_packager.util import ascii_safe
games = []
@@ -33,10 +33,18 @@ for name, game in load_games().items():
langs['total'] += 1
stats[lang] = stats.get(lang, 0) + 1
+ # free-as-in-beer
+ fullfree = True
+ somefree = False
for package in game.packages.values():
for m_lang in getattr(package, 'langs', []):
if m_lang not in stats:
stats[m_lang] = '*'
+ if GameData.fill_gaps(game, package=package,
+ log=False) is FillResult.IMPOSSIBLE:
+ fullfree = False
+ else:
+ somefree = True
genres[game.genre] = genres.get(game.genre, 0) + 1
stats['genre'] = game.genre
@@ -44,6 +52,8 @@ for name, game in load_games().items():
stats['longname'] = ascii_safe(game.longname, force=True)
stats['total'] = len(game.packages)
stats['missing_langs'] = game.missing_langs
+ stats['fullfree'] = fullfree or name == 'dreamweb' #XXX
+ stats['somefree'] = somefree
stats['url_steam'] = game.url_steam
stats['url_gog'] = game.url_gog
stats['url_dotemu'] = game.url_dotemu
@@ -70,7 +80,7 @@ html.write('''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "ht
)
for lang in langs_order:
html.write(' <td><b>%s</b></td>\n' % lang)
-html.write('<td>Steam</td><td>GOG.com</td><td>DotEmu</td></tr>\n')
+html.write('<td>Demo</td><td>Steam</td><td>GOG.com</td><td>DotEmu</td></tr>\n')
# BODY
last_genre = None
@@ -92,11 +102,18 @@ for game in games:
else:
html.write(' <td> </td>\n')
- for url in (game['url_steam'], game['url_gog'], game['url_dotemu']):
- if url:
- html.write(' <td align=center><a href="%s"><b>X</b></a></td>\n' % url)
+ if game['fullfree']:
+ html.write(' <td colspan=4 align=center><b>freeload</b></td>\n')
+ else:
+ if game['somefree']:
+ html.write(' <td align=center><b>X</b></td>\n')
else:
html.write(' <td> </td>\n')
+ for url in (game['url_steam'], game['url_gog'], game['url_dotemu']):
+ if url:
+ html.write(' <td align=center><a href="%s"><b>X</b></a></td>\n' % url)
+ else:
+ html.write(' <td> </td>\n')
html.write('</tr>\n')
# TOTAL
@@ -105,7 +122,7 @@ for lang in langs_order:
html.write(' <td><b>%s</b></td>\n' % langs[lang])
html.write('''
-<td colspan=3> </td>
+<td colspan=4> </td>
</tr>
</table>
<ul>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git
More information about the Pkg-games-commits
mailing list