X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=25549f049c95656df3b48759e83ad940f97dcb95;hb=728941d6c0323db2905d868166118ca51b8753fb;hp=cd5eb7914c7641f51df41addff0d7ecb0014f838;hpb=5ae0dac7c89af97eab8ba4fb34e1099a3b9dddc7;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index cd5eb791..25549f04 100644 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -701,13 +701,11 @@ def send_mail (message, filename=""): ################################################################################ -def poolify (source, component): - if component: - component += '/' +def poolify (source, component=None): if source[:3] == "lib": - return component + source[:4] + '/' + source + '/' + return source[:4] + '/' + source + '/' else: - return component + source[:1] + '/' + source + '/' + return source[:1] + '/' + source + '/' ################################################################################ @@ -1550,7 +1548,6 @@ def get_packages_from_ftp(root, suite, component, architecture): @rtype: TagFile @return: apt_pkg class containing package data - """ filename = "%s/dists/%s/%s/binary-%s/Packages.gz" % (root, suite, component, architecture) (fd, temp_file) = temp_filename() @@ -1576,15 +1573,20 @@ def deb_extract_control(fh): ################################################################################ def mail_addresses_for_upload(maintainer, changed_by, fingerprint): - """Mail addresses to contact for an upload + """mail addresses to contact for an upload + + @type maintainer: str + @param maintainer: Maintainer field of the .changes file - Args: - maintainer (str): Maintainer field of the changes file - changed_by (str): Changed-By field of the changes file - fingerprint (str): Fingerprint of the PGP key used to sign the upload + @type changed_by: str + @param changed_by: Changed-By field of the .changes file - Returns: - List of RFC 2047-encoded mail addresses to contact regarding this upload + @type fingerprint: str + @param fingerprint: fingerprint of the key used to sign the upload + + @rtype: list of str + @return: list of RFC 2047-encoded mail addresses to contact regarding + this upload """ addresses = [maintainer] if changed_by != maintainer: @@ -1600,14 +1602,16 @@ def mail_addresses_for_upload(maintainer, changed_by, fingerprint): ################################################################################ def call_editor(text="", suffix=".txt"): - """Run editor and return the result as a string + """run editor and return the result as a string + + @type text: str + @param text: initial text - Kwargs: - text (str): initial text - suffix (str): extension for temporary file + @type suffix: str + @param suffix: extension for temporary file - Returns: - string with the edited text + @rtype: str + @return: string with the edited text """ editor = os.environ.get('VISUAL', os.environ.get('EDITOR', 'vi')) tmp = tempfile.NamedTemporaryFile(suffix=suffix, delete=False)