Mercurial > genshi > genshi-test
changeset 593:aa5762c7b7f1
Minor, cosmetic tweaks.
author | cmlenz |
---|---|
date | Mon, 13 Aug 2007 21:38:46 +0000 |
parents | 7145e4eba2ec |
children | 0fb43dc2e165 |
files | genshi/core.py genshi/filters/tests/__init__.py genshi/path.py |
diffstat | 3 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/genshi/core.py +++ b/genshi/core.py @@ -316,6 +316,12 @@ return True def __getslice__(self, i, j): + """Return a slice of the attributes list. + + >>> attrs = Attrs([('href', '#'), ('title', 'Foo')]) + >>> attrs[1:] + Attrs([('title', 'Foo')]) + """ return Attrs(tuple.__getslice__(self, i, j)) def __or__(self, attrs):
--- a/genshi/filters/tests/__init__.py +++ b/genshi/filters/tests/__init__.py @@ -11,7 +11,6 @@ # individuals. For the exact contribution history, see the revision # history and logs, available at http://genshi.edgewall.org/log/. -import doctest import unittest def suite():
--- a/genshi/path.py +++ b/genshi/path.py @@ -39,6 +39,7 @@ """ from math import ceil, floor +import operator import re from genshi.core import Stream, Attrs, Namespace, QName @@ -771,7 +772,7 @@ string2 = as_string(self.string2(kind, data, pos, namespaces, variables)) return re.search(string2, string1, self.flags) def _map_flags(self, flags): - return reduce(lambda a, b: a | b, + return reduce(operator.or_, [self.flag_map[flag] for flag in flags], re.U) def __repr__(self): return 'contains(%r, %r)' % (self.string1, self.string2)