[game-data-packager] 12/25: steam.py: turn acf_parser() in a generator

Simon McVittie smcv at debian.org
Wed Feb 11 10:41:12 UTC 2015


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 a11ae825c858c3d026e7b8b704470228fcd1ce47
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Mon Feb 9 18:35:28 2015 +0100

    steam.py: turn acf_parser() in a generator
---
 game_data_packager/steam.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/game_data_packager/steam.py b/game_data_packager/steam.py
index 780648d..19ffe43 100644
--- a/game_data_packager/steam.py
+++ b/game_data_packager/steam.py
@@ -18,7 +18,6 @@
 import glob
 
 def parse_acf(path):
-    acf = []
     for manifest in glob.glob(path + '/*.acf'):
         with open(manifest) as data:
             # the .acf files are not really JSON files
@@ -39,7 +38,4 @@ def parse_acf(path):
                        acf_struct[key] = value
             if 'name' not in acf_struct:
                 acf_struct['name'] = acf_struct['installdir']
-            acf.append(acf_struct)
-
-    acf = sorted(acf, key=lambda k: (k['name']))
-    return acf
+            yield acf_struct

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