[game-data-packager] 01/01: fix pyflakes warnings

Alexandre Detiste detiste-guest at moszumanska.debian.org
Thu Oct 1 13:47:17 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 1b823b82452d9527d8ae1385d51e9c1bfe4635af
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Thu Oct 1 15:46:37 2015 +0200

    fix pyflakes warnings
    
    game_data_packager/steam.py:206: undefined name 'args'
    game_data_packager/steam.py:206: undefined name 'args'
    game_data_packager/util.py:196: local variable 'default' is assigned to but never used
---
 game_data_packager/steam.py | 26 +++++++++++++-------------
 game_data_packager/util.py  |  2 --
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/game_data_packager/steam.py b/game_data_packager/steam.py
index aaa63a9..20d3133 100644
--- a/game_data_packager/steam.py
+++ b/game_data_packager/steam.py
@@ -78,10 +78,10 @@ def get_steam_id():
             if line not in ('users', '{'):
                 return line
 
-def run_steam_meta_mode(parsed, games):
+def run_steam_meta_mode(args, games):
     logger.info('Visit our community page: https://steamcommunity.com/groups/debian_gdp#curation')
     owned = set()
-    if parsed.download:
+    if args.download:
         steam_id = get_steam_id()
         if steam_id is None:
             logger.error("Couldn't read SteamID from ~/.steam/config/loginusers.vdf")
@@ -106,7 +106,7 @@ def run_steam_meta_mode(parsed, games):
                 continue
 
             installed = PACKAGE_CACHE.is_installed(package.name)
-            if parsed.new and installed:
+            if args.new and installed:
                 continue
 
             paths = []
@@ -146,23 +146,23 @@ def run_steam_meta_mode(parsed, games):
                 print('<game owned but not installed/found>')
         print()
 
-    if not parsed.new and not parsed.all:
+    if not args.new and not args.all:
        logger.info('Please specify --all or --new to create desired packages.')
        return
 
-    preserve_debs = (getattr(parsed, 'destination', None) is not None)
-    install_debs = getattr(parsed, 'install', True)
-    if getattr(parsed, 'compress', None) is None:
+    preserve_debs = (getattr(args, 'destination', None) is not None)
+    install_debs = getattr(args, 'install', True)
+    if getattr(args, 'compress', None) is None:
         # default to not compressing if we aren't going to install it
         # anyway
-        parsed.compress = preserve_debs
+        args.compress = preserve_debs
 
     all_debs = set()
 
     for shortname in sorted(found_games):
         game = games[shortname]
-        game.verbose = getattr(parsed, 'verbose', False)
-        game.save_downloads = parsed.save_downloads
+        game.verbose = getattr(args, 'verbose', False)
+        game.save_downloads = args.save_downloads
         game.look_for_files()
 
         todo = list()
@@ -180,14 +180,14 @@ def run_steam_meta_mode(parsed, games):
                          ' because downloads failed.' % game.shortname)
             continue
 
-        if parsed.destination is None:
+        if args.destination is None:
             destination = workdir = tempfile.mkdtemp(prefix='gdptmp.')
         else:
             workdir = None
-            destination = parsed.destination
+            destination = args.destination
 
         debs = game.build_packages(ready,
-                compress=getattr(parsed, 'compress', True),
+                compress=getattr(args, 'compress', True),
                 destination=destination)
         rm_rf(os.path.join(game.get_workdir(), 'tmp'))
 
diff --git a/game_data_packager/util.py b/game_data_packager/util.py
index 89e0c9d..a6e4297 100644
--- a/game_data_packager/util.py
+++ b/game_data_packager/util.py
@@ -193,8 +193,6 @@ def run_as_root(argv, gain_root='su'):
 def install_packages(debs, method, gain_root='su'):
     """Install one or more packages (a list of filenames)."""
 
-    default = None
-
     if method and method not in (
             'apt', 'dpkg',
             'gdebi', 'gdebi-gtk', 'gdebi-kde',

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