[game-data-packager] 01/01: reinstate speed-up start trick also in production

Alexandre Detiste detiste-guest at moszumanska.debian.org
Tue Oct 20 10:37:58 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 c4446f39264f4e6105bbae1fac2aa238cf64a904
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Tue Oct 20 12:36:14 2015 +0200

    reinstate speed-up start trick also in production
---
 game_data_packager/__init__.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/game_data_packager/__init__.py b/game_data_packager/__init__.py
index 504416d..2b42d9f 100644
--- a/game_data_packager/__init__.py
+++ b/game_data_packager/__init__.py
@@ -1057,14 +1057,21 @@ def run_command_line():
     dumb_parser.add_argument('paths', type=str, nargs='*')
     dumb_parser.add_argument('-h', '--help', action='store_true', dest='h')
     g = dumb_parser.parse_args().game
+    zip = os.path.join(DATADIR, 'vfs.zip')
     if g is None:
         games = load_games()
     elif '-h' in sys.argv or '--help' in sys.argv:
         games = load_games()
     elif os.path.isfile(os.path.join(DATADIR, '%s.json' % g)):
         games = load_games(game=g)
-    else:
+    elif not os.path.isfile(zip):
         games = load_games()
+    else:
+        with zipfile.ZipFile(zip, 'r') as zf:
+            if '%s.json' % g in zf.namelist():
+                games = load_games(game=g)
+            else:
+                games = load_games()
 
     parser = argparse.ArgumentParser(prog='game-data-packager',
             description='Package game files.', parents=(base_parser,),

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