MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / Document

Class Document

suds/sax/document.py:27–61  ·  view source on GitHub ↗

simple document

Source from the content-addressed store, hash-verified

25
26
27class Document(Element):
28 """ simple document """
29
30 DECL = '<?xml version="1.0" encoding="UTF-8"?>'
31
32 def __init__(self, root=None):
33 Element.__init__(self, 'document')
34 if root is not None:
35 self.append(root)
36
37 def root(self):
38 if len(self.children):
39 return self.children[0]
40 else:
41 return None
42
43 def str(self):
44 s = []
45 s.append(self.DECL)
46 s.append('\n')
47 if self.root() is not None:
48 s.append(self.root().str())
49 return ''.join(s)
50
51 def plain(self):
52 s = []
53 s.append(self.DECL)
54 s.append(self.root().plain())
55 return ''.join(s)
56
57 def __str__(self):
58 return self.str()
59
60 def __unicode__(self):
61 return self.str()

Callers 3

add_methodsMethod · 0.90
processMethod · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected