X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fmake_maintainers.py;h=4e2fe244bb6fd911930641eebef3730fb19f9a66;hb=b612f3da207fa0d75a5d3b204ac8f02bb244231a;hp=55cc4a9b6324b020efa6b9658914df065798bca2;hpb=cdffcfe2a0e6804ed35df56c4c2aa084c2b63677;p=dak.git diff --git a/dak/make_maintainers.py b/dak/make_maintainers.py index 55cc4a9b..4e2fe244 100755 --- a/dak/make_maintainers.py +++ b/dak/make_maintainers.py @@ -1,7 +1,12 @@ #!/usr/bin/env python -# Generate Maintainers file used by e.g. the Debian Bug Tracking System -# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 James Troup +""" +Generate Maintainers file used by e.g. the Debian Bug Tracking System +@contact: Debian FTP Master +@copyright: 2000, 2001, 2002, 2003, 2004, 2006 James Troup +@license: GNU General Public License version 2 or later + +""" # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,7 +30,8 @@ ################################################################################ -import pg, sys +import pg +import sys import apt_pkg from daklib import database from daklib import utils @@ -33,11 +39,11 @@ from daklib.regexes import re_comments ################################################################################ -projectB = None -Cnf = None -maintainer_from_source_cache = {} -packages = {} -fixed_maintainer_cache = {} +Cnf = None #: Configuration, apt_pkg.Configuration +projectB = None #: database connection, pgobject +maintainer_from_source_cache = {} #: caches the maintainer name per source_id +packages = {} #: packages data to write out +fixed_maintainer_cache = {} #: caches fixed ( L{daklib.utils.fix_maintainer} ) maintainer data ################################################################################ @@ -52,6 +58,15 @@ Generate an index of packages <=> Maintainers. ################################################################################ def fix_maintainer (maintainer): + """ + Fixup maintainer entry, cache the result. + + @type maintainer: string + @param maintainer: A maintainer entry as passed to L{daklib.utils.fix_maintainer} + + @rtype: tuple + @returns: fixed maintainer tuple + """ global fixed_maintainer_cache if not fixed_maintainer_cache.has_key(maintainer): @@ -60,9 +75,25 @@ def fix_maintainer (maintainer): return fixed_maintainer_cache[maintainer] def get_maintainer (maintainer): + """ + Retrieves maintainer name from database, passes it through fix_maintainer and + passes on whatever that returns. + + @type maintainer: int + @param maintainer: maintainer_id + """ return fix_maintainer(database.get_maintainer(maintainer)) def get_maintainer_from_source (source_id): + """ + Returns maintainer name for given source_id. + + @type source_id: int + @param source_id: source package id + + @rtype: string + @return: maintainer name/email + """ global maintainer_from_source_cache if not maintainer_from_source_cache.has_key(source_id):