[game-data-packager] 02/03: add support fot links to per-engine wikis

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sat Sep 5 07:29:01 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 f25bcdac9c64ebc15615b892f1d6dec617b37cd9
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sat Sep 5 08:44:30 2015 +0200

    add support fot links to per-engine wikis
---
 data/maniacmansion.yaml                    |  2 ++
 game_data_packager/__init__.py             | 14 +++++++++++++-
 game_data_packager/games/scummvm_common.py |  2 ++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/data/maniacmansion.yaml b/data/maniacmansion.yaml
index 8385c54..b9887fc 100644
--- a/data/maniacmansion.yaml
+++ b/data/maniacmansion.yaml
@@ -7,6 +7,8 @@ try_repack_from:
 
 plugin: scummvm_common
 gameid: maniac
+wiki: Maniac_Mansion
+
 packages:
   maniacmansion-en-data:
     debian:
diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index 249d9ab..f210483 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -511,6 +511,11 @@ class GameData(object):
         # The formal name of the game, e.g. Quake III Arena
         self.longname = shortname.title()
 
+        # Engine's wiki base URL, provided by engine plugin
+        self.wikibase = ''
+        # Game page on engine's wiki
+        self.wiki = None
+
         # The franchise this game belongs to.
         # this is used to loosely ties various .yaml files
         self.franchise = None
@@ -570,7 +575,7 @@ class GameData(object):
         self.argument_parser = None
 
         for k in ('longname', 'copyright', 'compress_deb', 'help_text', 
-                  'engine', 'genre', 'missing_langs', 'franchise',
+                  'engine', 'genre', 'missing_langs', 'franchise', 'wiki',
                   'steam', 'gog', 'dotemu', 'origin', 'url_misc'):
             if k in self.data:
                 setattr(self, k, self.data[k])
@@ -791,6 +796,7 @@ class GameData(object):
                    'vox0000.lab_unpatched',
                    ), (self.shortname, wanted.name)
 
+    def edit_help_text(self):
         if len(self.packages) > 1:
             prepend = '\npackages possible for this game:\n'
             help = []
@@ -848,6 +854,10 @@ class GameData(object):
             self.help_text += '\nThis game can be bought online here:\n  '
             self.help_text += '\n  '.join(www)
 
+        if self.wiki:
+            self.help_text += '\nExternal links:\n  '
+            self.help_text += (self.wikibase + self.wiki)
+
     def __enter__(self):
         return self
 
@@ -2363,6 +2373,8 @@ class GameData(object):
 
         longname = ascii_safe(self.longname)
 
+        self.edit_help_text()
+
         parser = parsers.add_parser(self.shortname,
                 help=longname, aliases=aliases,
                 description='Package data files for %s.' % longname,
diff --git a/game_data_packager/games/scummvm_common.py b/game_data_packager/games/scummvm_common.py
index d51c1d2..b71a5d7 100644
--- a/game_data_packager/games/scummvm_common.py
+++ b/game_data_packager/games/scummvm_common.py
@@ -35,6 +35,8 @@ class ScummvmGameData(GameData):
         super(ScummvmGameData, self).__init__(shortname, data,
                 workdir=workdir)
 
+        self.wikibase = 'http://wiki.scummvm.org/index.php/'
+
         if 'gameid' in self.data:
             self.gameid = self.data['gameid']
             assert self.gameid != shortname, 'extraneous gameid for ' + shortname

-- 
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