#!/usr/bin/env python
-""" Display information about package(s) (suite, version, etc.) """
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 James Troup <james@nocrew.org>
+"""
+Display information about package(s) (suite, version, etc.)
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2000, 2001, 2002, 2003, 2004, 2005, 2006 James Troup <james@nocrew.org>
+@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
# the Free Software Foundation; either version 2 of the License, or
################################################################################
-import os, pg, sys
+import os
+import pg
+import sys
import apt_pkg
from daklib import database
from daklib import utils
################################################################################
-Cnf = None
-projectB = None
+Cnf = None #: Configuration, apt_pkg.Configuration
+projectB = None #: database connection, pgobject
################################################################################
#!/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 <james@nocrew.org>
+"""
+Generate Maintainers file used by e.g. the Debian Bug Tracking System
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2000, 2001, 2002, 2003, 2004, 2006 James Troup <james@nocrew.org>
+@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
################################################################################
-import pg, sys
+import pg
+import sys
import apt_pkg
from daklib import database
from daklib import utils
################################################################################
-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 <email> per source_id
+packages = {} #: packages data to write out
+fixed_maintainer_cache = {} #: caches fixed ( L{daklib.utils.fix_maintainer} ) maintainer data
################################################################################
################################################################################
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):
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):
#!/usr/bin/env python
-""" Output override files for apt-ftparchive and indices/ """
-# Copyright (C) 2000, 2001, 2002, 2004, 2006 James Troup <james@nocrew.org>
+"""
+Output override files for apt-ftparchive and indices/
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2000, 2001, 2002, 2004, 2006 James Troup <james@nocrew.org>
+@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
################################################################################
-import pg, sys
+import pg
+import sys
import apt_pkg
from daklib import database
from daklib import utils
################################################################################
-Cnf = None
-projectB = None
-override = {}
+Cnf = None #: Configuration, apt_pkg.Configuration
+projectB = None #: database connection, pgobject
+override = {} #: override data to write out
################################################################################
################################################################################
def do_list(output_file, suite, component, otype):
+ """
+ Fetch override data for suite from the database and dump it.
+
+ @type output_file: fileobject
+ @param output_file: where to write the overrides to
+
+ @type suite: string
+ @param suite: The name of the suite
+
+ @type component: string
+ @param component: The name of the component
+
+ @type otype: string
+ @param otype: type of override. deb/udeb/dsc
+
+ """
global override
suite_id = database.get_suite_id(suite)