Package flumotion :: Package component :: Package misc :: Package httpserver :: Module cachedprovider :: Class CachedFile
[hide private]

Class CachedFile

source code

             object --+    
                      |    
      fileprovider.File --+
                          |
extern.log.log.Loggable --+
                          |
                         CachedFile

Instance Methods [hide private]
 
__init__(self, plug, path, mimeType)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
open(self) source code
 
_sourceOpenFailed(self, failure) source code
 
__str__(self)
str(x)
source code
int
getmtime(self)
Returns: the modification time of the file
source code
long
getsize(self)
Returns: the size of the file
source code
long
tell(self)
Returns: the current read/write position in the file
source code
 
seek(self, offset)
Moves the reading/writing position inside the file.
source code
 
read(self, size)
Reads the specified amount of data asynchronously.
source code
 
close(self)
Close and cleanup the file.
source code
 
__del__(self) source code
dict
getLogFields(self)
Returns: a dictionary of log fields related to the file usage
source code
 
_closeSourceFile(self, sourceFile) source code
 
_selectDelegate(self, (sourceFile, sourceInfo)) source code
 
_removeCachedFile(self, cachePath) source code
 
_tryTempFile(self, sourcePath, sourceFile, sourceInfo) source code
 
_cacheFile(self, sourcePath, sourceFile, sourceInfo) source code

Inherited from fileprovider.File: getMimeType

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

Inherited from extern.log.log.Loggable: __providedBy__, __provides__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Variables [hide private]
  logCategory = 'fileprovider-localcached'
Implementors can provide a category to log their messages under.
  mimeType = None
hash(x)
  _delegate = None
hash(x)

Inherited from extern.log.log.Loggable: __implemented__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, plug, path, mimeType)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

getmtime(self)

source code 
Returns: int
the modification time of the file
Overrides: fileprovider.File.getmtime
(inherited documentation)

getsize(self)

source code 
Returns: long
the size of the file
Overrides: fileprovider.File.getsize
(inherited documentation)

tell(self)

source code 
Returns: long
the current read/write position in the file
Overrides: fileprovider.File.tell
(inherited documentation)

seek(self, offset)

source code 

Moves the reading/writing position inside the file. Only support absolute offset from file start.

Parameters:
  • offset - the byte offset from the start of the file to go to
Overrides: fileprovider.File.seek
(inherited documentation)

read(self, size)

source code 

Reads the specified amount of data asynchronously.

Parameters:
  • size - the amount of byte to read from the file
Returns:
a deferred fired with the read data or a failure. The data can be empty or smaller than the wanted size if the end of file is reached.
Overrides: fileprovider.File.read
(inherited documentation)

close(self)

source code 

Close and cleanup the file.

Overrides: fileprovider.File.close
(inherited documentation)

getLogFields(self)

source code 
Returns: dict
a dictionary of log fields related to the file usage
Overrides: fileprovider.File.getLogFields
(inherited documentation)