Package rhn :: Module SmartIO :: Class SmartIO
[hide private]
[frames] | no frames]

Class SmartIO

source code

The SmartIO class allows one to put a cap on the memory consumption. StringIO objects are very fast, because they are stored in memory, but if they are too big the memory footprint becomes noticeable. The write method of a SmartIO determines if the data that is to be added to the (initially) StrintIO object does not exceed a certain threshold; if it does, it switches the storage to a temporary disk file

Instance Methods [hide private]
 
__init__(self, max_mem_size=16384, force_mem=0) source code
 
set_max_mem_size(self, max_mem_size) source code
 
get_max_mem_size(self) source code
 
write(self, data) source code
 
__getattr__(self, name) source code