Package omeroweb :: Package webgateway :: Module webgateway_cache :: Class WebGatewayTempFile
[hide private]
[frames] | no frames]

Class WebGatewayTempFile

source code


Class for handling creation of temporary files

Instance Methods [hide private]
 
__init__(self, tdir=TMPROOT)
Initialises class, setting the directory to be used for temp files.
source code
 
_createdir(self)
Tries to create the directories required for the temp file base dir
source code
 
_cleanup(self)
Tries to delete all the temp files that have expired their cache timeout.
source code
 
newdir(self, key=None)
Creates a new directory using key as the dir name, and adds a timestamp file with it's creation time.
source code
 
new(self, name, key=None)
Creates a new directory if needed, see newdir and checks whether this contains a file 'name'.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, tdir=TMPROOT)
(Constructor)

source code 

Initialises class, setting the directory to be used for temp files.

Overrides: object.__init__

newdir(self, key=None)

source code 

Creates a new directory using key as the dir name, and adds a timestamp file with it's creation time. If key is not specified, use a unique key based on timestamp.

Parameters:
  • key - The new dir name
Returns:
Tuple of (path to new directory, key used)

new(self, name, key=None)

source code 

Creates a new directory if needed, see newdir and checks whether this contains a file 'name'. If not, a file lock is created for this location and returned.

Parameters:
  • name - Name of file we want to create.
  • key - The new dir name
Returns:
Tuple of (abs path to new directory, relative path key/name, AutoFileLock or True if exists)