Did I find the right examples for you? yes no

All Samples(14)  |  Call(12)  |  Derive(0)  |  Import(2)

        def pushtree(obj, pattern, target, uri=None, entity_factory=None, standalone=False, validate=False, namespaces=None):
    # Adapter for what Dave uses. FIXME?!
    class Handler(object):
        def startElementMatch(self, node):
            pass
        def endElementMatch(self, node):
            target(node)
        def attributeMatch(self, pair):
            # Returns the node and the attribute name (hack!)
            # Get just the node
            target(pair[0])
    
    # Create a rule handler object
    mgr = PushtreeManager(pattern, Handler(),
                          namespaces = namespaces)
    rhand = mgr.build_pushtree_handler()

    # Run the parser on the rule handler
    return parse(obj,uri,entity_factory,standalone,validate,rule_handler=rhand)
        


src/i/n/ingestion-HEAD/lib/oai.py   ingestion(Download)
import urllib
 
from amara.pushtree import pushtree
from amara.thirdparty import httplib2
from akara import logger
            sets.append(dict([('setSpec', setSpec), ('setName', setName), ('setDescription', setDescription)]))
 
        pushtree(content, u"o:OAI-PMH/o:ListSets/o:set", receive_nodes, namespaces=PREFIXES)
        return sets
 

src/a/m/Amara-2.0.0/test/pushtree/test_pushtree.py   Amara(Download)
from cStringIO import StringIO
 
import amara
from amara.pushtree import pushtree
from amara.lib import treecompare
        results.append(node)
 
    pushtree(XML1, u"a", callback)
 
    for result, expected in zip(results, EXPECTED):
        results.append(node)
 
    pushtree(XML2, u"a", callback, namespaces = {None: "urn:bogus:x"})
 
    for result, expected in zip(results, EXPECTED):
        results.append(node)
 
    pushtree(XML3, u"x:a", callback, namespaces = {"x": "urn:bogus:x"})
 
    for result, expected in zip(results, EXPECTED):
        results.append(node)
 
    pushtree(XML4, u"x:a", callback, namespaces = {"x": "urn:bogus:x"})
 
    for result, expected in zip(results, EXPECTED):