Share and Money Management  0.16
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
gui.log.StringHandler Class Reference

Stores the log records as a list of strings. More...

Public Member Functions

def __init__
 Constructor.
def getBufferAsList
 Returns all buffered messages.
def getBufferAsString
 Returns all buffered messages.
def emit
 Emit a record.
def flush
 Empty the buffer.

Public Attributes

 storeAsUnicode
 Stores the log records as unicode strings.
 buffer
 The message buffer itself.

Static Public Attributes

tuple encoding = sys.stdout.encodingorsys.getfilesystemencoding()
 Encoding of all character strings.

Private Member Functions

def _toUnicode
 Convert a non unicode string into a unicode string.

Detailed Description

Stores the log records as a list of strings.

Constructor & Destructor Documentation

def gui.log.StringHandler.__init__ (   self,
  storeAsUnicode = True 
)

Constructor.

Parameters
selfThe object instance itself
storeAsUnicodeStore recorded log records as unicode strings

Member Function Documentation

def gui.log.StringHandler._toUnicode (   self,
  msg 
)
private

Convert a non unicode string into a unicode string.

Returns
The unicode string
See Also
encoding

References smm.objects.SMMBaseObject.encoding, smm.quote.base.FetchPluginBase.encoding, and gui.log.StringHandler.encoding.

Referenced by gui.log.StringHandler.emit().

Here is the caller graph for this function:

def gui.log.StringHandler.emit (   self,
  record 
)

Emit a record.

Add a formatted log record to the buffer.

References gui.log.StringHandler._toUnicode(), smm.objects.SMMBaseObject._toUnicode(), gui.log.StringHandler.flush(), and gui.log.StringHandler.storeAsUnicode.

Here is the call graph for this function:

def gui.log.StringHandler.flush (   self)

Empty the buffer.

Referenced by gui.log.FileHandler.close(), gui.log.StringHandler.emit(), gui.log.StreamHandler.emit(), and gui.log.StringHandler.getBufferAsList().

Here is the caller graph for this function:

def gui.log.StringHandler.getBufferAsList (   self,
  clean = True 
)

Returns all buffered messages.

Parameters
cleanClean the internal message buffer
Returns
List of messages strings
See Also
getBufferAsString()

References gui.log.StringHandler.buffer, and gui.log.StringHandler.flush().

Referenced by gui.log.StringHandler.getBufferAsString().

Here is the call graph for this function:

Here is the caller graph for this function:

def gui.log.StringHandler.getBufferAsString (   self,
  clean = True 
)

Returns all buffered messages.

Parameters
cleanClean the internal message buffer
Returns
Messages concatenate to a string
See Also
getBufferAsList(self,)

References gui.log.StringHandler.getBufferAsList(), and gui.log.StringHandler.storeAsUnicode.

Here is the call graph for this function:

Member Data Documentation

gui.log.StringHandler.buffer

The message buffer itself.

Referenced by gui.log.StringHandler.getBufferAsList().

tuple gui.log.StringHandler.encoding = sys.stdout.encodingorsys.getfilesystemencoding()
static

Encoding of all character strings.

The default_encoding is used to convert character strings into unicode strings

See Also
storeAsUnicode

Referenced by gui.log.FileHandler._open(), and gui.log.StringHandler._toUnicode().

gui.log.StringHandler.storeAsUnicode

Stores the log records as unicode strings.

Referenced by gui.log.StringHandler.emit(), and gui.log.StringHandler.getBufferAsString().


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