Package portage :: Package xml :: Module metadata :: Class MetaDataXML
[hide private]

Class MetaDataXML

source code

object --+
         |
        MetaDataXML

Access metadata.xml

Instance Methods [hide private]
 
__init__(self, metadata_xml_path, herds)
Parse a valid metadata.xml file.
source code
 
__repr__(self)
repr(x)
source code
str or None
_get_herd_email(self, herd)
Get a herd's email address.
source code
 
herds(self, include_email=False)
Return a list of text nodes for <herd>.
source code
list
descriptions(self)
Return a list of text nodes for <longdescription>.
source code
list
maintainers(self)
Get maintainers' name, email and description.
source code
list
use(self)
Get names and descriptions for USE flags defined in metadata.
source code
list
upstream(self)
Get upstream contact information.
source code
String
format_maintainer_string(self)
Format string containing maintainers and herds (emails if possible).
source code
String
format_upstream_string(self)
Format string containing upstream maintainers and bugtrackers.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, metadata_xml_path, herds)
(Constructor)

source code 

Parse a valid metadata.xml file.

Parameters:
  • metadata_xml_path (str) - path to a valid metadata.xml file
  • herds (str or ElementTree) - path to a herds.xml, or a pre-parsed ElementTree
Raises:
  • IOError - if metadata_xml_path can not be read
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

_get_herd_email(self, herd)

source code 

Get a herd's email address.

Parameters:
  • herd (str) - herd whose email you want
Returns: str or None
email address or None if herd is not in herds.xml
Raises:
  • IOError - if $PORTDIR/metadata/herds.xml can not be read

herds(self, include_email=False)

source code 
Return a list of text nodes for <herd>.

@type include_email: bool
@keyword include_email: if True, also look up the herd's email
@rtype: tuple
@return: if include_email is False, return a list of strings;
         if include_email is True, return a list of tuples containing:
                         [('herd1', 'herd1@gentoo.org'), ('no-herd', None);

descriptions(self)

source code 

Return a list of text nodes for <longdescription>.

Returns: list
package description in string format

To Do: Support the lang attribute

maintainers(self)

source code 

Get maintainers' name, email and description.

Returns: list
a sequence of _Maintainer objects in document order.

use(self)

source code 

Get names and descriptions for USE flags defined in metadata.

Returns: list
a sequence of _Useflag objects in document order.

upstream(self)

source code 

Get upstream contact information.

Returns: list
a sequence of _Upstream objects in document order.

format_maintainer_string(self)

source code 

Format string containing maintainers and herds (emails if possible). Used by emerge to display maintainer information. Entries are sorted according to the rules stated on the bug wranglers page.

Returns: String
a string containing maintainers and herds

format_upstream_string(self)

source code 

Format string containing upstream maintainers and bugtrackers. Used by emerge to display upstream information.

Returns: String
a string containing upstream maintainers and bugtrackers