[game-data-packager] 01/01: z_code: compute z_file only once in __init__

Alexandre Detiste detiste-guest at moszumanska.debian.org
Mon Jan 11 13:56:29 UTC 2016


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 df86e7c38899e5d7ee0121368cc4ba8da442838d
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Mon Jan 11 14:55:49 2016 +0100

    z_code: compute z_file only once in __init__
---
 game_data_packager/games/z_code.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/game_data_packager/games/z_code.py b/game_data_packager/games/z_code.py
index fb6ac0a..0016e2a 100644
--- a/game_data_packager/games/z_code.py
+++ b/game_data_packager/games/z_code.py
@@ -33,12 +33,13 @@ logger = logging.getLogger('game-data-packager.games.z_code')
 class ZCodeGameData(GameData):
     def __init__(self, shortname, data):
         super(ZCodeGameData, self).__init__(shortname, data)
-        one_z_file = False
         for package in self.packages.values():
+            package.z_file = None
             for install in package.install:
                 if re.match('^.z[12345678]$', os.path.splitext(install)[1]):
-                    one_z_file = not one_z_file
-        assert one_z_file
+                    assert package.z_file is None
+                    package.z_file = install
+        assert package.z_file
 
         if self.engine is None:
             self.engine = 'gargoyle-free | frotz'
@@ -75,9 +76,7 @@ class ZCodeTask(PackagingTask):
                         entry['Terminal'] = 'true'
                         break
             entry['TryExec'] = engine
-            for wanted in package.install_files:
-                if re.match('^.z[12345678]$', os.path.splitext(wanted.name)[1]):
-                    arg = '/' + install_to + '/' + wanted.name
+            arg = '/' + install_to + '/' + package.z_file
             entry['Exec'] = engine + ' ' + arg
 
             pixdir = os.path.join(destdir, 'usr/share/pixmaps')

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