Mercurial > genshi > genshi-test
comparison genshi/path.py @ 857:24733a5854d9
Avoid unicode literals in `repr`s of `QName` and `Namespace` when not necessary.
author | cmlenz |
---|---|
date | Thu, 12 Nov 2009 15:09:26 +0000 |
parents | 1e2be9fb3348 |
children | 61d37796da98 |
comparison
equal
deleted
inserted
replaced
856:1e2be9fb3348 | 857:24733a5854d9 |
---|---|
617 >>> test = Path('child').test() | 617 >>> test = Path('child').test() |
618 >>> namespaces, variables = {}, {} | 618 >>> namespaces, variables = {}, {} |
619 >>> for event in xml: | 619 >>> for event in xml: |
620 ... if test(event, namespaces, variables): | 620 ... if test(event, namespaces, variables): |
621 ... print('%s %r' % (event[0], event[1])) | 621 ... print('%s %r' % (event[0], event[1])) |
622 START (QName(u'child'), Attrs([(QName(u'id'), u'2')])) | 622 START (QName('child'), Attrs([(QName('id'), u'2')])) |
623 | 623 |
624 :param ignore_context: if `True`, the path is interpreted like a pattern | 624 :param ignore_context: if `True`, the path is interpreted like a pattern |
625 in XSLT, meaning for example that it will match | 625 in XSLT, meaning for example that it will match |
626 at any depth | 626 at any depth |
627 :return: a function that can be used to test individual events in a | 627 :return: a function that can be used to test individual events in a |