Back to index

python3.2  3.2.2
Public Member Functions
test.test_pprint.DottedPrettyPrinter Class Reference
Inheritance diagram for test.test_pprint.DottedPrettyPrinter:
Inheritance graph
[legend]
Collaboration diagram for test.test_pprint.DottedPrettyPrinter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def format
def pprint
def pformat
def isrecursive
def isreadable

Detailed Description

Definition at line 465 of file test_pprint.py.


Member Function Documentation

def test.test_pprint.DottedPrettyPrinter.format (   self,
  object,
  context,
  maxlevels,
  level 
)
Format object for a specific context, returning a string
and flags indicating whether the representation is 'readable'
and whether the object represents a recursive construct.

Reimplemented from pprint.PrettyPrinter.

Definition at line 467 of file test_pprint.py.

00467 
00468     def format(self, object, context, maxlevels, level):
00469         if isinstance(object, str):
00470             if ' ' in object:
00471                 return repr(object), 1, 0
00472             else:
00473                 return object, 0, 0
00474         else:
00475             return pprint.PrettyPrinter.format(
00476                 self, object, context, maxlevels, level)
00477 

Here is the call graph for this function:

Here is the caller graph for this function:

def pprint.PrettyPrinter.isreadable (   self,
  object 
) [inherited]

Definition at line 143 of file pprint.py.

00143 
00144     def isreadable(self, object):
00145         s, readable, recursive = self.format(object, {}, 0, 0)
00146         return readable and not recursive

Here is the call graph for this function:

def pprint.PrettyPrinter.isrecursive (   self,
  object 
) [inherited]

Definition at line 140 of file pprint.py.

00140 
00141     def isrecursive(self, object):
00142         return self.format(object, {}, 0, 0)[2]

Here is the call graph for this function:

def pprint.PrettyPrinter.pformat (   self,
  object 
) [inherited]

Definition at line 135 of file pprint.py.

00135 
00136     def pformat(self, object):
00137         sio = _StringIO()
00138         self._format(object, sio, 0, 0, {}, 0)
00139         return sio.getvalue()

Here is the call graph for this function:

def pprint.PrettyPrinter.pprint (   self,
  object 
) [inherited]

Definition at line 131 of file pprint.py.

00131 
00132     def pprint(self, object):
00133         self._format(object, self._stream, 0, 0, {}, 0)
00134         self._stream.write("\n")

Here is the call graph for this function:


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