From: Joerg Jaspert Date: Sat, 18 Sep 2010 14:51:39 +0000 (+0200) Subject: Merge remote branch 'tolimar/tolimar-adopt-bts-categorize' into merge X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=dec160172b136c712dddf2c942ee03a52e8e0b88;hp=cf7a1f537151d67dbcfa5b8a21a24c4143bcacac;p=dak.git Merge remote branch 'tolimar/tolimar-adopt-bts-categorize' into merge * tolimar/tolimar-adopt-bts-categorize: Whatever the difference between the summary and the subject field is: We Port bts_categorize to python-debianbts Signed-off-by: Joerg Jaspert --- diff --git a/dak/bts_categorize.py b/dak/bts_categorize.py index 663690a1..4a803d56 100755 --- a/dak/bts_categorize.py +++ b/dak/bts_categorize.py @@ -5,6 +5,7 @@ bts -- manage bugs filed against ftp.debian.org @contact: Debian FTP Master @copyright: 2009 Mike O'Connor +@copyright: 2010 Alexander Reichle-Schmehl @license: GNU General Public License version 2 or later """ @@ -33,7 +34,7 @@ log = logging.getLogger() import apt_pkg from daklib import utils -from btsutils.debbugs import debbugs +import debianbts as bts def usage(): print """ @@ -83,18 +84,19 @@ class BugClassifier(object): dak_re: 'dak', arch_re: 'archs'} - def __init__( self ): - self.bts = debbugs() - self.bts.setUsers(['ftp.debian.org@packages.debian.org']) - - def unclassified_bugs(self): """ Returns a list of open bugs which have not yet been classified by one of our usertags. """ - return [ bug for bug in self.bts.query("pkg:ftp.debian.org") \ - if bug.status=='pending' and not bug.usertags ] + + tagged_bugs = bts.get_usertag('ftp.debian.org@packages.debian.org') + tagged_bugs_ftp = [] + for tags in tagged_bugs.keys(): + tagged_bugs_ftp += tagged_bugs[tags] + + return [ bug for bug in bts.get_status( bts.get_bugs("package", "ftp.debian.org" ) ) \ + if bug.pending=='pending' and not bug.bug_num in tagged_bugs_ftp ] def classify_bug(self, bug): @@ -106,15 +108,15 @@ class BugClassifier(object): retval = "" for classifier in self.classifiers.keys(): - if classifier.match(bug.summary): - retval = "usertag %s %s\n" % (bug.bug, + if classifier.match(bug.subject): + retval = "usertag %s %s\n" % (bug.bug_num, self.classifiers[classifier]) break if retval: log.info(retval) else: - log.debug("Unmatched: [%s] %s" % (bug.bug, bug.summary)) + log.debug("Unmatched: [%s] %s" % (bug.bug_num, bug.summary)) return retval diff --git a/docs/meta/common/ftpmaster-common b/docs/meta/common/ftpmaster-common index 831fff6a..5b54ac05 100644 --- a/docs/meta/common/ftpmaster-common +++ b/docs/meta/common/ftpmaster-common @@ -5,7 +5,7 @@ Standards-Version: 3.8.1 Package: ftpmaster-common Version: 1.0 Maintainer: Debian FTP Master -Depends: apt-utils, bzip2, gnupg, gpgv, gzip, libapt-pkg-dev, lintian, python, python-apt, python-btsutils, python-debian, python-gnupginterface, python-ldap, python-psycopg2, python-pygresql, python-pyrss2gen, python-yaml, python-sqlalchemy +Depends: apt-utils, bzip2, gnupg, gpgv, gzip, libapt-pkg-dev, lintian, python, python-apt, python-debianbts, python-debian, python-gnupginterface, python-ldap, python-psycopg2, python-pygresql, python-pyrss2gen, python-yaml, python-sqlalchemy Recommends: postgresql-plperl-8.4, postgresql-8.4-debversion, postgresql-plpython-8.4 Architecture: all Copyright: copyright