Package daklib :: Module textutils
[hide private]
[frames] | no frames]

Module textutils

source code

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 [hide private]
 
fix_maintainer(maintainer)
Parses a Maintainer or Changed-By field and returns:
source code
 
rfc2047_encode(s)
Encodes a (header) string per RFC2047 if necessary.
source code
 
split_uploaders(field) source code
Variables [hide private]
  __package__ = 'daklib'
  re_parse_maintainer = re.compile(r'^\s*(\S.*\S)\s*<([^>]+)>')

Imports: AlreadyLockedError, CantOverwriteError, DBUpdateError, DakError, InvalidDscError, NoFilesFieldError, NoFreeFilenameError, ParseChangesError, ParseMaintError, SendmailFailedError, TransitionsError, UnknownFormatError, email


Function Details [hide private]

fix_maintainer(maintainer)

source code 

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.

rfc2047_encode(s)

source code 

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.