Mercurial > genshi > mirror
diff genshi/core.py @ 435:be39660919a5 trunk
More API doc enhancements.
author | cmlenz |
---|---|
date | Thu, 22 Mar 2007 23:23:55 +0000 |
parents | 5692bc32ba5f |
children | 2c38ec4e2dff |
line wrap: on
line diff
--- a/genshi/core.py +++ b/genshi/core.py @@ -159,6 +159,11 @@ XPath expression. :param path: a string containing the XPath expression + :param namespaces: mapping of namespace prefixes used in the path + :param variables: mapping of variable names to values + :return: the selected substream + :raises PathSyntaxError: if the given path expression is invalid or not + supported """ from genshi.path import Path return Path(path).select(self, namespaces, variables) @@ -305,6 +310,11 @@ def get(self, name, default=None): """Return the value of the attribute with the specified name, or the value of the `default` parameter if no such attribute is found. + + :param name: the name of the attribute + :param default: the value to return when the attribute does not exist + :return: the attribute value, or the `default` value if that attribute + does not exist """ for attr, value in self: if attr == name: