Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
StreamReaderWriter Class Reference

Public Member Functions

def __init__
 
def read
 
def readline
 
def readlines
 
def write
 
def writelines
 
def reset
 
def __getattr__
 

Data Fields

 stream
 
 reader
 
 writer
 
 errors
 

Static Public Attributes

string encoding = 'unknown'
 

Detailed Description

StreamReaderWriter instances allow wrapping streams which
    work in both read and write modes.

    The design is such that one can use the factory functions
    returned by the codec.lookup() function to construct the
    instance.

Definition at line 293 of file codecs.py.

Constructor & Destructor Documentation

def __init__ (   self,
  stream,
  Reader,
  Writer,
  errors = 'strict' 
)
Creates a StreamReaderWriter instance.

    stream must be a Stream-like object.

    Reader, Writer must be factory functions or classes
    providing the StreamReader, StreamWriter interface resp.

    Error handling is done in the same way as defined for the
    StreamWriter/Readers.

Definition at line 306 of file codecs.py.

307  def __init__(self, stream, Reader, Writer, errors='strict'):
308 
309  """ Creates a StreamReaderWriter instance.
310 
311  stream must be a Stream-like object.
312 
313  Reader, Writer must be factory functions or classes
314  providing the StreamReader, StreamWriter interface resp.
315 
316  Error handling is done in the same way as defined for the
317  StreamWriter/Readers.
318 
319  """
320  self.stream = stream
321  self.reader = Reader(stream, errors)
322  self.writer = Writer(stream, errors)
323  self.errors = errors

Member Function Documentation

def __getattr__ (   self,
  name,
  getattr = getattr 
)
Inherit all other methods from the underlying stream.

Definition at line 350 of file codecs.py.

References StreamWriter.stream, StreamReader.stream, and StreamReaderWriter.stream.

351  getattr=getattr):
352 
353  """ Inherit all other methods from the underlying stream.
354  """
355  return getattr(self.stream, name)
def read (   self,
  size = -1 
)

Definition at line 324 of file codecs.py.

325  def read(self, size=-1):
326 
327  return self.reader.read(size)
def readline (   self,
  size = None 
)

Definition at line 328 of file codecs.py.

329  def readline(self, size=None):
330 
331  return self.reader.readline(size)
def readlines (   self,
  sizehint = None 
)

Definition at line 332 of file codecs.py.

333  def readlines(self, sizehint=None):
334 
335  return self.reader.readlines(sizehint)
def reset (   self)

Definition at line 344 of file codecs.py.

References StreamReaderWriter.__getattr__().

345  def reset(self):
346 
347  self.reader.reset()
348  self.writer.reset()
def write (   self,
  data 
)

Definition at line 336 of file codecs.py.

337  def write(self, data):
338 
339  return self.writer.write(data)
def writelines (   self,
  list 
)

Definition at line 340 of file codecs.py.

341  def writelines(self, list):
342 
343  return self.writer.writelines(list)

Field Documentation

string encoding = 'unknown'
static

Definition at line 304 of file codecs.py.

errors

Definition at line 322 of file codecs.py.

reader

Definition at line 320 of file codecs.py.

stream

Definition at line 319 of file codecs.py.

writer

Definition at line 321 of file codecs.py.


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