Package gavo :: Package protocols :: Module uws :: Class UWSJobWithWD
[frames] | no frames]

Class UWSJobWithWD

source code

object --+    
         |    
BaseUWSJob --+
             |
            UWSJobWithWD
Known Subclasses:

A UWS job with a working directory.

This generates ids from directory names in a directory (the uwsWD) shared for all UWSes on the system.

It also adds methods

Nested Classes

Inherited from BaseUWSJob: __metaclass__

Instance Methods
 
getWD(self) source code
 
prepareForDestruction(self)
is called before the job's database row is torn down.
source code
 
fixTypeForResultName(self, resultName, mediaType)
sets the media type for result resultName.
source code
 
addResult(self, source, mimeType, name=None)
adds a result, with data taken from source.
source code
 
openResult(self, mimeType, name)
returns a writable file that adds a result.
source code
 
getResult(self, resName)
returns a pair of file name and mime type for a named job result.
source code
 
getResults(self)
returns a list of this service's results.
source code
 
openFile(self, name, mode='r')
returns an open file object for a file within the job's work directory.
source code

Inherited from BaseUWSJob: __getattr__, __init__, __setattr__, change, getProperties, getSerializedPar, getTransitionTo, getURL, getWritable, iterParameterNames, iterSerializedPars, setPar, setParamsFromRequest, setSerializedPar, update

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

Class Methods
 
getNewId(self, uws, conn) source code

Inherited from BaseUWSJob: getDefaults

Properties

Inherited from BaseUWSJob: quote

Inherited from object: __class__

Method Details

getNewId(self, uws, conn)
Class Method

source code 
Overrides: BaseUWSJob.getNewId

prepareForDestruction(self)

source code 

is called before the job's database row is torn down.

Self is writable at this point.

Overrides: BaseUWSJob.prepareForDestruction
(inherited documentation)

fixTypeForResultName(self, resultName, mediaType)

source code 

sets the media type for result resultName.

It is not an error if no result with resultName exists.

addResult(self, source, mimeType, name=None)

source code 

adds a result, with data taken from source.

source may be a file-like object or a byte string.

If no name is passed, a name is auto-generated.

getResult(self, resName)

source code 

returns a pair of file name and mime type for a named job result.

If the result does not exist, a NotFoundError is raised.

getResults(self)

source code 

returns a list of this service's results.

The list contains dictionaries having at least resultName and resultType keys.

openFile(self, name, mode='r')

source code 

returns an open file object for a file within the job's work directory.

No path parts are allowed on name.