Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
plistlib.DumbXMLWriter Class Reference
Inheritance diagram for plistlib.DumbXMLWriter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def beginElement
def endElement
def simpleElement
def writeln

Public Attributes

 file
 stack
 indentLevel
 indent

Detailed Description

Definition at line 115 of file plistlib.py.


Constructor & Destructor Documentation

def plistlib.DumbXMLWriter.__init__ (   self,
  file,
  indentLevel = 0,
  indent = "\t" 
)

Definition at line 116 of file plistlib.py.

00116 
00117     def __init__(self, file, indentLevel=0, indent="\t"):
00118         self.file = file
00119         self.stack = []
00120         self.indentLevel = indentLevel
00121         self.indent = indent

Here is the caller graph for this function:


Member Function Documentation

def plistlib.DumbXMLWriter.beginElement (   self,
  element 
)

Definition at line 122 of file plistlib.py.

00122 
00123     def beginElement(self, element):
00124         self.stack.append(element)
00125         self.writeln("<%s>" % element)
00126         self.indentLevel += 1

Here is the call graph for this function:

Here is the caller graph for this function:

def plistlib.DumbXMLWriter.endElement (   self,
  element 
)

Definition at line 127 of file plistlib.py.

00127 
00128     def endElement(self, element):
00129         assert self.indentLevel > 0
00130         assert self.stack.pop() == element
00131         self.indentLevel -= 1
00132         self.writeln("</%s>" % element)

Here is the call graph for this function:

Here is the caller graph for this function:

def plistlib.DumbXMLWriter.simpleElement (   self,
  element,
  value = None 
)

Definition at line 133 of file plistlib.py.

00133 
00134     def simpleElement(self, element, value=None):
00135         if value is not None:
00136             value = _escape(value)
00137             self.writeln("<%s>%s</%s>" % (element, value, element))
00138         else:
00139             self.writeln("<%s/>" % element)

Here is the call graph for this function:

Here is the caller graph for this function:

def plistlib.DumbXMLWriter.writeln (   self,
  line 
)

Definition at line 140 of file plistlib.py.

00140 
00141     def writeln(self, line):
00142         if line:
00143             # plist has fixed encoding of utf-8
00144             if isinstance(line, str):
00145                 line = line.encode('utf-8')
00146             self.file.write(self.indentLevel * self.indent)
00147             self.file.write(line)
00148         self.file.write(b'\n')
00149 
00150 
00151 # Contents should conform to a subset of ISO 8601
00152 # (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'.  Smaller units may be omitted with
#  a loss of precision)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 117 of file plistlib.py.

Definition at line 120 of file plistlib.py.

Definition at line 119 of file plistlib.py.

Definition at line 118 of file plistlib.py.


The documentation for this class was generated from the following file: