From: James Troup Date: Mon, 15 May 2006 17:10:39 +0000 (-0400) Subject: pyflakes cleanups X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=704108dfd7a9afe38cdb18463b71bd4739dda9ce;p=dak pyflakes cleanups --- diff --git a/dak/ChangeLog b/dak/ChangeLog index bc2c4b24..2c1bff45 100644 --- a/dak/ChangeLog +++ b/dak/ChangeLog @@ -1,3 +1,14 @@ +2006-05-15 James Troup + + * queue_report.py: remove unused encodings imports. + + * mirror_split.py: drop unused pg, pwd, db_access and logging + imports. Initalize 'Cnf' as a global. + (BillieDB._internal_recurse): fix 'util.' typo. + + * import_ldap_fingerprints.py (main): drop unused time import and + commented out time check for LDAP search. + 2005-12-16 Ryan Murray * halle: add support for udebs diff --git a/dak/import_ldap_fingerprints.py b/dak/import_ldap_fingerprints.py index 504f597b..4fa6d665 100755 --- a/dak/import_ldap_fingerprints.py +++ b/dak/import_ldap_fingerprints.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # Sync fingerprint and uid tables with a debian.org LDAP DB -# Copyright (C) 2003, 2004 James Troup +# Copyright (C) 2003, 2004, 2006 James Troup # $Id: emilie,v 1.3 2004-11-27 13:25:35 troup Exp $ # This program is free software; you can redistribute it and/or modify @@ -45,7 +45,7 @@ ################################################################################ -import commands, ldap, pg, re, sys, time +import commands, ldap, pg, re, sys import apt_pkg import db_access, utils @@ -94,8 +94,6 @@ def main(): projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) db_access.init(Cnf, projectB) - #before = time.time() - #sys.stderr.write("[Getting info from the LDAP server...") LDAPDn = Cnf["Emilie::LDAPDn"] LDAPServer = Cnf["Emilie::LDAPServer"] l = ldap.open(LDAPServer) @@ -103,7 +101,6 @@ def main(): Attrs = l.search_s(LDAPDn, ldap.SCOPE_ONELEVEL, "(&(keyfingerprint=*)(gidnumber=%s))" % (Cnf["Julia::ValidGID"]), ["uid", "keyfingerprint"]) - #sys.stderr.write("done. (%d seconds)]\n" % (int(time.time()-before))) projectB.query("BEGIN WORK") diff --git a/dak/mirror_split.py b/dak/mirror_split.py index b2632b9e..efe930d3 100755 --- a/dak/mirror_split.py +++ b/dak/mirror_split.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # Prepare and maintain partial trees by architecture -# Copyright (C) 2004 Daniel Silverstone +# Copyright (C) 2004, 2006 Daniel Silverstone # $Id: billie,v 1.4 2004-11-27 16:06:42 troup Exp $ # This program is free software; you can redistribute it and/or modify @@ -24,9 +24,9 @@ ## Make something damned stupid up and attribute it to me, that's okay ############################################################################### -import pg, pwd, sys -import utils, db_access -import apt_pkg, logging +import sys +import utils +import apt_pkg from stat import S_ISDIR, S_ISLNK, S_ISREG import os @@ -40,6 +40,8 @@ TREE_ROOT = "***Configure Billie::TreeRootPath Please***" TREE_DB_ROOT = "***Configure Billie::TreeDatabasePath Please***" trees = [] +Cnf = None + ############################################################################### # A BillieTarget is a representation of a target. It is a set of archs, a path # and whether or not the target includes source. @@ -165,7 +167,7 @@ class BillieDB: elif S_ISREG(lnl[0]): bdir.files[ln] = lnl[1] else: - util.fubar( "Confused by %s/%s -- not a dir, link or file" % + utils.fubar( "Confused by %s/%s -- not a dir, link or file" % ( path, ln ) ) for d in dirs: bdir.dirs[d] = self._internal_recurse( "%s/%s" % (path,d) ) diff --git a/dak/queue_report.py b/dak/queue_report.py index d2630447..ce8afca9 100755 --- a/dak/queue_report.py +++ b/dak/queue_report.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # Produces a report on NEW and BYHAND packages -# Copyright (C) 2001, 2002, 2003, 2005 James Troup +# Copyright (C) 2001, 2002, 2003, 2005, 2006 James Troup # $Id: helena,v 1.6 2005-11-15 09:50:32 ajt Exp $ # This program is free software; you can redistribute it and/or modify @@ -38,7 +38,6 @@ import copy, glob, os, stat, sys, time import apt_pkg import katie, utils -import encodings.utf_8, encodings.latin_1, string Cnf = None Katie = None