Package wtf :: Package app :: Package services :: Module resources :: Class ResourceStream
[hide private]
[frames] | no frames]

Class ResourceStream

source code

          object --+    
                   |    
stream.GenericStream --+
                       |
                      ResourceStream

Extended generic stream, which provides more info about the resource
Instance Methods [hide private]
int
__len__(self)
Determine the size of the resource in bytes
source code

Inherited from stream.GenericStream: __del__, __iter__, close, fileno, flush, isatty, next, read, read_exact, readline, readlines, write, writelines, xreadlines

Inherited from stream.GenericStream (private): _bufferedread, _unread

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
a new object with type S, a subtype of T

__new__(cls, resource, fullname, mode, buffering, blockiter)
Initialization
source code
Class Variables [hide private]

Inherited from stream.GenericStream (private): _DEFAULT_CHUNK_SIZE

Instance Variables [hide private]
int _length
Resource size in bytes.
datetime.datetime last_modified
Last modification time
str resource
The name, which the resource was resolved from

Inherited from stream.GenericStream: softspace

Properties [hide private]

Inherited from stream.GenericStream: closed, name

Inherited from object: __class__

Method Details [hide private]

__new__(cls, resource, fullname, mode, buffering, blockiter)
Static Method

source code 
Initialization
Parameters:
  • resource (str) - Resource name (just for making it available)
  • fullname (str) - Full name of the file to open
  • mode (str) - File opening mode
  • buffering (int) - Buffering spec
  • blockiter (int) - Iterator mode
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__

__len__(self)
(Length operator)

source code 
Determine the size of the resource in bytes
Returns: int
The resource size

Instance Variable Details [hide private]

_length

Resource size in bytes. Retrieve it via len``(r)``
Type:
int