WebKit.ASStreamOut | index /usr/local/share/webware/WebKit/ASStreamOut.py

`This module defines a class for handling writing reponses.`

Classes

``

__builtin__.object
  ASStreamOut
exceptions.Exception(exceptions.BaseException)
  ConnectionAbortedError
  InvalidCommandSequence

class ASStreamOut(__builtin__.object)

``

`This is a response stream to the client.
The key attributes of this class are:
`_autoCommit`:
If True, the stream will automatically start sending data
once it has accumulated `_bufferSize` data. This means that
it will ask the response to commit itself, without developer
interaction. By default, this is set to False.
`_bufferSize`:
The size of the data buffer. This is only used when autocommit
is True. If not using autocommit, the whole response is
buffered and sent in one shot when the servlet is done.
`flush()`:
Send the accumulated response data now. Will ask the `Response`
to commit if it hasn't already done so.
`

Methods defined here:

__init__(self, autoCommit=False, bufferSize=8192)

autoCommit(self)
  `Get the auto commit mode.`

buffer(self)
  `Return accumulated data which has not yet been flushed.
  We want to be able to get at this data without having to call flush
  first, so that we can (for example) integrate automatic HTML validation.`

bufferSize(self)
  `Get the buffer size.`

clear(self)
  `Try to clear any accumulated response data.
  Will fail if the response is already sommitted.`

close(self)
  `Close this buffer. No more data may be sent.`

closed(self)
  `Check whether we are closed to new data.`

commit(self, autoCommit=True)
  `Called by the Response to tell us to go.
  If `_autoCommit` is True, then we will be placed into autoCommit mode.`

committed(self)
  `Are we committed?`

flush(self)
  `Flush stream.
  Send available data as soon as possible, i.e. *now*.
  Returns True if we are ready to send, otherwise False (i.e.,
  if the buffer is full enough).`

needCommit(self)
  `Request for commitment.
  Called by the `HTTPResponse` instance that is using this instance
  to ask if the response needs to be prepared to be delivered.
  The response should then commit its headers, etc.`

pop(self, count)
  `Remove count bytes from the front of the buffer.`

prepend(self, charstr)
  `Add the attached string to front of the response buffer.
  Invalid if we are already committed.`

setAutoCommit(self, autoCommit=True)
  `Set the auto commit mode.`

setBufferSize(self, bufferSize=8192)
  `Set the buffer size.`

size(self)
  `Return the current size of the data held here.`

write(self, charstr)
  `Write a string to the buffer.`

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

class ConnectionAbortedError(exceptions.Exception)
`` | `Connection aborted error`

Method resolution order:
  ConnectionAbortedError
  exceptions.Exception
  exceptions.BaseException
  __builtin__.object

Data descriptors defined here:

__weakref__
  `list of weak references to the object (if defined)`

Methods inherited from exceptions.Exception:

__init__(...)
  `x.__init__(...) initializes x; see help(type(x)) for signature`

Data and other attributes inherited from exceptions.Exception:

__new__ = <built-in method __new__ of type object>
  `T.__new__(S, ...) -> a new object with type S, a subtype of T`

Methods inherited from exceptions.BaseException:

__delattr__(...)
  `x.__delattr__('name') <==> del x.name`

__getattribute__(...)
  `x.__getattribute__('name') <==> x.name`

__getitem__(...)
  `x.__getitem__(y) <==> x[y]`

__getslice__(...)
  `x.__getslice__(i, j) <==> x[i:j]
  Use of negative indices is not supported.`

__reduce__(...)

__repr__(...)
  `x.__repr__() <==> repr(x)`

__setattr__(...)
  `x.__setattr__('name', value) <==> x.name = value`

__setstate__(...)

__str__(...)
  `x.__str__() <==> str(x)`

__unicode__(...)

Data descriptors inherited from exceptions.BaseException:

__dict__

args

message

class InvalidCommandSequence(exceptions.Exception)
`` | `Invalid command sequence error`

Method resolution order:
  InvalidCommandSequence
  exceptions.Exception
  exceptions.BaseException
  __builtin__.object

Data descriptors defined here:

__weakref__
  `list of weak references to the object (if defined)`

Methods inherited from exceptions.Exception:

__init__(...)
  `x.__init__(...) initializes x; see help(type(x)) for signature`

Data and other attributes inherited from exceptions.Exception:

__new__ = <built-in method __new__ of type object>
  `T.__new__(S, ...) -> a new object with type S, a subtype of T`

Methods inherited from exceptions.BaseException:

__delattr__(...)
  `x.__delattr__('name') <==> del x.name`

__getattribute__(...)
  `x.__getattribute__('name') <==> x.name`

__getitem__(...)
  `x.__getitem__(y) <==> x[y]`

__getslice__(...)
  `x.__getslice__(i, j) <==> x[i:j]
  Use of negative indices is not supported.`

__reduce__(...)

__repr__(...)
  `x.__repr__() <==> repr(x)`

__setattr__(...)
  `x.__setattr__('name', value) <==> x.name = value`

__setstate__(...)

__str__(...)
  `x.__str__() <==> str(x)`

__unicode__(...)

Data descriptors inherited from exceptions.BaseException:

__dict__

args

message

Data
`` |  | debug = False