From: Mark Hymers Date: Sat, 3 May 2008 13:34:32 +0000 (+0100) Subject: clean up pychecker warnings X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=969f96350310474d777d4aa804e38ed96a41bd77;p=dak.git clean up pychecker warnings --- diff --git a/dak/check_proposed_updates.py b/dak/check_proposed_updates.py index 529f0a07..3a86ef71 100644 --- a/dak/check_proposed_updates.py +++ b/dak/check_proposed_updates.py @@ -183,16 +183,16 @@ def check_changes (filename): # Move to the pool directory cwd = os.getcwd() - file = files.keys()[0] - pool_dir = Cnf["Dir::Pool"] + '/' + daklib.utils.poolify(changes["source"], files[file]["component"]) + f = files.keys()[0] + pool_dir = Cnf["Dir::Pool"] + '/' + daklib.utils.poolify(changes["source"], files[f]["component"]) os.chdir(pool_dir) changes_result = 0 - for file in files.keys(): - if file.endswith(".deb"): - result = check_package(file, files) + for f in files.keys(): + if f.endswith(".deb"): + result = check_package(f, files) if Options["verbose"]: - pass_fail(file, result) + pass_fail(f, result) changes_result += result pass_fail (filename, changes_result) @@ -210,12 +210,12 @@ def check_deb (filename): ################################################################################ def check_joey (filename): - file = daklib.utils.open_file(filename) + f = daklib.utils.open_file(filename) cwd = os.getcwd() os.chdir("%s/dists/proposed-updates" % (Cnf["Dir::Root"])) - for line in file.readlines(): + for line in f.readlines(): line = line.rstrip() if line.find('install') != -1: split_line = line.split() @@ -228,7 +228,7 @@ def check_joey (filename): if Options["debug"]: print "Processing %s..." % (changes_filename) check_changes(changes_filename) - file.close() + f.close() os.chdir(cwd) @@ -292,15 +292,15 @@ def main (): parse_packages() print "done." - for file in arguments: - if file.endswith(".changes"): - check_changes(file) - elif file.endswith(".deb"): - check_deb(file) - elif file.endswith(".joey"): - check_joey(file) + for f in arguments: + if f.endswith(".changes"): + check_changes(f) + elif f.endswith(".deb"): + check_deb(f) + elif f.endswith(".joey"): + check_joey(f) else: - daklib.utils.fubar("Unrecognised file type: '%s'." % (file)) + daklib.utils.fubar("Unrecognised file type: '%s'." % (f)) #######################################################################################