[game-data-packager] 29/51: make_template: Have a GameData object

Simon McVittie smcv at debian.org
Fri Dec 29 01:23:36 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository game-data-packager.

commit 9a3b045e653d94545d74b63fb36bf7754b385685
Author: Simon McVittie <smcv at debian.org>
Date:   Wed Dec 27 17:37:57 2017 +0000

    make_template: Have a GameData object
    
    Signed-off-by: Simon McVittie <smcv at debian.org>
---
 game_data_packager/make_template.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/game_data_packager/make_template.py b/game_data_packager/make_template.py
index 6aa1645..30500a0 100644
--- a/game_data_packager/make_template.py
+++ b/game_data_packager/make_template.py
@@ -36,6 +36,7 @@ except ImportError:
     ON_DEBIAN = False
 
 from .data import (FileGroup, HashedFile)
+from .game import (GameData)
 from .gog import GOG
 from .steam import parse_acf
 from .unpack import TarUnpacker
@@ -137,8 +138,9 @@ def is_runtime(path):
             return True
     return False
 
-class Template(object):
-    def __init__(self):
+class Template:
+    def __init__(self, game):
+        self.game = game
         self.longname = None
         self.try_repack_from = []
         self.plugin = None
@@ -570,6 +572,11 @@ class Template(object):
 
     def print_yaml(self):
         print('---')
+
+        yaml.dump(self.game.to_data(expand=False),
+            default_flow_style=False,
+            stream=sys.stdout)
+
         if self.longname:
             print('longname: %s' % self.longname)
         print('copyright: © 1970 FIXME')
@@ -748,7 +755,8 @@ def main():
         do_flacsums(args.args[0],args.lower)
         return
 
-    template = Template()
+    game = GameData('__template__', dict(packages={}))
+    template = Template(game)
 
     # "./run make-template setup_<game>.exe gog_<game>.deb"
     # will merge files lists
@@ -770,6 +778,7 @@ def main():
             template.add_one_gog_sh(arg)
         else:
             template.add_archive(arg, lower=args.lower)
+
     template.print_yaml()
 
 

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