CLAM Parameters

class clam.common.parameters.AbstractParameter(id, name, description='', **kwargs)

This is the base class from which all parameter classes have to be derived.

access(user)

This method checks if the given user has access to see/set this parameter, based on the denyusers and/or allowusers option.

allowusers

You can restrict this parameter to only be available to certain users, set the usernames you want to allow here, all others are denied

compilearg()

This method compiles the parameter into syntax that can be used on the shell, such as for example: –paramflag=value

constrainable()

Should this parameter be used in checking contraints?

denyusers

You can restrict this parameter to only be available to certain users, set the usernames you want to deny access here, all others are allowed

description

A clear description for this parameter, which the user will see

error

If this parameter has any validation errors, this will be set to an error message (by default set to None, meaning no error)

static fromxml(node)

Create a Parameter instance (of any class derived from AbstractParameter!) given its XML description. Node can be a string containing XML or an lxml _Element

id

A unique alphanumeric ID

name

A representational name for this parameter, which the user will see

paramflag

The parameter flag that will be used when this parameter is passed on the commandline (using COMMAND= and $PARAMETERS) (by default set to None)

set(value)

This parameter method attempts to set a specific value for this parameter. The value will be validated first, and if it can not be set. An error message will be set in the error property of this parameter

validate(value)

Validate the parameter

valuefrompostdata(postdata)

This parameter method searches the POST data and retrieves the values it needs. It does not set the value yet though, but simply returns it. Needs to be explicitly passed to parameter.set()

xml(indent='')

This methods renders an XML representation of this parameter, along with its selected value, and feedback on validation errors

class clam.common.parameters.BooleanParameter(id, name, description='', **kwargs)

A parameter that takes a Boolean (True/False) value.

compilearg()

This method compiles the parameter into syntax that can be used on the shell, such as for example: –paramflag=value

constrainable()

Should this parameter be used in checking contraints?

set(value=True)

Set the boolean parameter

unset()
valuefrompostdata(postdata)

This parameter method searches the POST data and retrieves the values it needs. It does not set the value yet though, but simply returns it. Needs to be explicitly passed to parameter.set(). It typically returns the default None when something is left unset (but that default can be overridden)

class clam.common.parameters.ChoiceParameter(id, name, description, **kwargs)

Choice parameter, users have to choose one of the available values, or multiple values if instantiated with multi=True.

compilearg()

This method compiles the parameter into syntax that can be used on the shell, such as -paramflag=value

set(value)

This parameter method attempts to set a specific value for this parameter. The value will be validated first, and if it can not be set. An error message will be set in the error property of this parameter

validate(values)

Validate the parameter

valuefrompostdata(postdata)

This parameter method searches the POST data and retrieves the values it needs. It does not set the value yet though, but simply returns it. Needs to be explicitly passed to parameter.set()

xml(indent='')

This methods renders an XML representation of this parameter, along with its selected value, and feedback on validation errors

class clam.common.parameters.FloatParameter(id, name, description='', **kwargs)
constrainable()

Should this parameter be used in checking contraints?

set(value)

This parameter method attempts to set a specific value for this parameter. The value will be validated first, and if it can not be set. An error message will be set in the error property of this parameter

validate(value)

Validate the parameter

valuefrompostdata(postdata)

This parameter method searches the POST data and retrieves the values it needs. It does not set the value yet though, but simply returns it. Needs to be explicitly passed to parameter.set()

class clam.common.parameters.IntegerParameter(id, name, description='', **kwargs)
constrainable()

Should this parameter be used in checking contraints?

set(value)

This parameter method attempts to set a specific value for this parameter. The value will be validated first, and if it can not be set. An error message will be set in the error property of this parameter

validate(value)

Validate the parameter

valuefrompostdata(postdata)

This parameter method searches the POST data and retrieves the values it needs. It does not set the value yet though, but simply returns it. Needs to be explicitly passed to parameter.set()

class clam.common.parameters.StaticParameter(id, name, description='', **kwargs)

This is a parameter that can’t be changed (it’s a bit of a contradiction, I admit). But useful for some metadata specifications.

class clam.common.parameters.StringParameter(id, name, description='', **kwargs)

String Parameter, taking a text value, presented as a one line input box

compilearg()

This method compiles the parameter into syntax that can be used on the shell, such as for example: –paramflag=value

validate(value)

Validate the parameter

class clam.common.parameters.TextParameter(id, name, description='', **kwargs)

Text Parameter, taking a text value, presented as a multiline input box

compilearg()

This method compiles the parameter into syntax that can be used on the shell, such as for example: –paramflag=value