From: James Troup Date: Sun, 11 Jun 2006 05:19:47 +0000 (+0100) Subject: Use string object methods rather than string module. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e8dc068d879b7fed7adedc394422501448d0ede;p=dak Use string object methods rather than string module. --- diff --git a/ChangeLog b/ChangeLog index 7c9db65c..a675948e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-06-11 James Troup + * dak/daklib/queue.py (Upload.source_exists): use string object + methods rather than string module. + (Upload.get_anyversion): likewise. + * dak/daklib/utils.py (validate_changes_file_arg): update filename slicing to cope with new .dak filenames. diff --git a/daklib/queue.py b/daklib/queue.py index 13409eb4..0a03d1fe 100644 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -695,7 +695,7 @@ distribution.""" if x[1] in s and x[0] not in s: s.append(x[0]) - que = "SELECT s.version FROM source s JOIN src_associations sa ON (s.id = sa.source) JOIN suite su ON (sa.suite = su.id) WHERE s.source = '%s' AND (%s)" % (package, string.join(["su.suite_name = '%s'" % a for a in s], " OR ")) + que = "SELECT s.version FROM source s JOIN src_associations sa ON (s.id = sa.source) JOIN suite su ON (sa.suite = su.id) WHERE s.source = '%s' AND (%s)" % (package, " OR ".join(["su.suite_name = '%s'" % a for a in s])) q = self.projectB.query(que) # Reduce the query results to a list of version numbers @@ -774,7 +774,7 @@ distribution.""" anyversion=None anysuite = [suite] + self.Cnf.ValueList("Suite::%s::VersionChecks::Enhances" % (suite)) for (v, s) in query_result: - if s in [ string.lower(x) for x in anysuite ]: + if s in [ x.lower() for x in anysuite ]: if not anyversion or apt_pkg.VersionCompare(anyversion, v) <= 0: anyversion=v return anyversion