Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
StreamWriter Class Reference
Inheritance diagram for StreamWriter:
Codec

Public Member Functions

def __init__
 
def write
 
def writelines
 
def reset
 
def __getattr__
 
- Public Member Functions inherited from Codec
def encode
 
def decode
 

Data Fields

 stream
 
 errors
 

Detailed Description

Definition at line 112 of file codecs.py.

Constructor & Destructor Documentation

def __init__ (   self,
  stream,
  errors = 'strict' 
)
Creates a StreamWriter instance.

    stream must be a file-like object open for writing
    (binary) data.

    The StreamWriter may implement different error handling
    schemes by providing the errors keyword argument. These
    parameters are defined:

     'strict' - raise a ValueError (or a subclass)
     'ignore' - ignore the character and continue with the next
     'replace'- replace with a suitable replacement character

Definition at line 114 of file codecs.py.

115  def __init__(self, stream, errors='strict'):
116 
117  """ Creates a StreamWriter instance.
118 
119  stream must be a file-like object open for writing
120  (binary) data.
121 
122  The StreamWriter may implement different error handling
123  schemes by providing the errors keyword argument. These
124  parameters are defined:
125 
126  'strict' - raise a ValueError (or a subclass)
127  'ignore' - ignore the character and continue with the next
128  'replace'- replace with a suitable replacement character
129 
130  """
131  self.stream = stream
132  self.errors = errors

Member Function Documentation

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

Definition at line 160 of file codecs.py.

References StreamWriter.stream.

161  getattr=getattr):
162 
163  """ Inherit all other methods from the underlying stream.
164  """
165  return getattr(self.stream, name)
def reset (   self)
Flushes and resets the codec buffers used for keeping state.

    Calling this method should ensure that the data on the
    output is put into a clean state, that allows appending
    of new fresh data without having to rescan the whole
    stream to recover state.

Definition at line 147 of file codecs.py.

148  def reset(self):
149 
150  """ Flushes and resets the codec buffers used for keeping state.
151 
152  Calling this method should ensure that the data on the
153  output is put into a clean state, that allows appending
154  of new fresh data without having to rescan the whole
155  stream to recover state.
156 
157  """
158  pass
def write (   self,
  object 
)
Writes the object's contents encoded to self.stream.

Definition at line 133 of file codecs.py.

References Codec.encode(), StreamRecoder.encode, and StreamWriter.errors.

134  def write(self, object):
135 
136  """ Writes the object's contents encoded to self.stream.
137  """
138  data, consumed = self.encode(object, self.errors)
139  self.stream.write(data)
def writelines (   self,
  list 
)
Writes the concatenated list of strings to the stream
    using .write().

Definition at line 140 of file codecs.py.

References dospath.join(), Pickler.write, openrsrc.write(), _Hqxcoderengine.write(), StreamWriter.write(), _Rlecoderengine.write(), InteractiveInterpreter.write(), BinHex.write(), Marshaller.write, and file_wrapper.write.

141  def writelines(self, list):
142 
143  """ Writes the concatenated list of strings to the stream
144  using .write().
145  """
146  self.write(''.join(list))

Field Documentation

errors

Definition at line 131 of file codecs.py.

stream

Definition at line 130 of file codecs.py.


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