Ejemplo n.º 1
0
 def __init__(self, node, **kwargs):
     Object.__init__(self)
     self.node = node
     self.data = None
     self.text = None
     for k,v in kwargs.items():
         setattr(self, k, v)
Ejemplo n.º 2
0
 def __init__(self):
     """ """
     Object.__init__(self)
     self.mustUnderstand = True
     self.tokens = []
     self.signatures = []
     self.references = []
     self.keys = []
Ejemplo n.º 3
0
 def __init__(self, tag=None, value=None, **kwargs):
     """
     @param tag: The content tag.
     @type tag: str
     @param value: The content's value.
     @type value: I{any}
     """
     Object.__init__(self)
     self.tag = tag
     self.value = value
     for k, v in kwargs.items():
         setattr(self, k, v)
Ejemplo n.º 4
0
 def __init__(self, root, definitions=None):
     """
     @param root: An XML root element.
     @type root: L{Element}
     @param definitions: A definitions object.
     @type definitions: L{Definitions}
     """
     Object.__init__(self)
     self.root = root
     pmd = Metadata()
     pmd.excludes = ['root']
     pmd.wrappers = dict(qname=repr)
     self.__metadata__.__print__ = pmd
Ejemplo n.º 5
0
    print "person=\n%s" % person
    #
    # add the person (using the webservice)
    #
    print "addPersion()"
    result = client.service.addPerson(person)
    print "\nreply(\n%s\n)\n" % str(result)

    #
    # Async
    #
    client.options.nosend = True
    reply = '<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:addPersonResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://basic.suds.fedora.org"><addPersonReturn xsi:type="xsd:string">person (jeff&#x4D2;,ortel) at age 43 with phone numbers (410-555-5138,919-555-4406,205-777-1212, and pets (Chance,) - added.</addPersonReturn></ns1:addPersonResponse></soapenv:Body></soapenv:Envelope>'
    request = client.service.addPerson(person)
    result = request.succeeded(reply)
    error = Object()
    error.httpcode = "500"
    client.options.nosend = False
    #    request.failed(error)

    #
    #
    # create a new name object used to update the person
    #
    newname = client.factory.create("ns0:Name")
    newname.first = "Todd"
    newname.last = None
    #
    # create AnotherPerson using Person
    #
    ap = client.factory.create("ns0:AnotherPerson")
Ejemplo n.º 6
0
 def __init__(self):
         Object.__init__(self)