daklib.textutils

Text utility functions

@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

Functions

fix_maintainer(maintainer)

Parses a Maintainer or Changed-By field and returns:

rfc2047_encode(s)

Encodes a (header) string per RFC2047 if necessary.

split_uploaders(field)

daklib.textutils.fix_maintainer(maintainer: str) tuple[str, str, str, str][source]
Parses a Maintainer or Changed-By field and returns:
  1. an RFC822 compatible version,

  2. an RFC2047 compatible version,

  3. the name

  4. the email

The name is forced to UTF-8 for both 1. and 3.. If the name field contains ‘.’ or ‘,’ (as allowed by Debian policy), 1. and 2. are switched to ‘email (name)’ format.

daklib.textutils.rfc2047_encode(s)[source]

Encodes a (header) string per RFC2047 if necessary. If the string is neither ASCII nor UTF-8, it’s assumed to be ISO-8859-1.

daklib.textutils.split_uploaders(field)[source]