Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Attributes
libpython.TruncatedStringIO Class Reference
Inheritance diagram for libpython.TruncatedStringIO:
Inheritance graph
Collaboration diagram for libpython.TruncatedStringIO:
Collaboration graph

List of all members.

Public Member Functions

def __init__
def write
def getvalue

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Attributes


Detailed Description

Similar to cStringIO, but can truncate the output by raising a
StringTruncated exception

Definition at line 119 of file

Constructor & Destructor Documentation

def libpython.TruncatedStringIO.__init__ (   self,
  maxlen = None 

Definition at line 122 of file

00123     def __init__(self, maxlen=None):
00124         self._val = ''
00125         self.maxlen = maxlen

Here is the caller graph for this function:

Member Function Documentation

Definition at line 135 of file

00136     def getvalue(self):
00137         return self._val

Here is the caller graph for this function:

def libpython.TruncatedStringIO.write (   self,

Definition at line 126 of file

00127     def write(self, data):
00128         if self.maxlen:
00129             if len(data) + len(self._val) > self.maxlen:
00130                 # Truncation:
00131                 self._val += data[0:self.maxlen - len(self._val)]
00132                 raise StringTruncated()
00134         self._val += data

Member Data Documentation

Definition at line 123 of file

Definition at line 124 of file

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

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