Package eggbasket :: Module pkginfo
[hide private]

Module pkginfo

source code

Helper functions for handling package meta data.

Classes [hide private]
  ParseError
  UnsupportedFormatError
Functions [hide private]
 
_to_unicode(s)
Convert string to unicode by assuming ISO-8859-15 encoding.
source code
 
read_pkg_info_from_tar(filename)
Read PKG-INFO file from (compresse/gzipped/bzipped) tar file.
source code
 
read_pkg_info_from_egg(filename)
Read PKG-INFO file from Python egg file or directory.
source code
 
set_pkg_info_field(pkg_info, field, value)
Sets field value in pkg_info.
source code
 
parse_pkg_info(pkg_info_src)
Parse string with PKG-INFO meta data.
source code
 
read_pkg_info(filename)
Read PKG-INFO meta data from given package distribution file.
source code
Variables [hide private]
  _line_rx = re.compile(r'^([\w-]+?):\s?(.*)')
  log = logging.getLogger("eggbasket.controllers")
Function Details [hide private]

set_pkg_info_field(pkg_info, field, value)

source code 

Sets field value in pkg_info.

If field is already set, value will be a list of all values.

parse_pkg_info(pkg_info_src)

source code 

Parse string with PKG-INFO meta data.

Returns dictionary with PKG-INFO fields as keys. Mutiple field values are collected in a list value.

Raises ParseError on any malformatted line.

read_pkg_info(filename)

source code 

Read PKG-INFO meta data from given package distribution file.

If the package file format is not supported, returns empty dict.

See parse_pkg_info() for more information.