Class s.p.c.Capability:

Part of stoqdrivers.printers.capabilities View In Hierarchy

This class is used to represent a driver capability, offering methods to validate a value with base in the capability limits.
Method __init__ Creates a new driver capability. A driver capability can be
Method check_value Undocumented
@argcheck(int, int, number, number, int, number)
def __init__(self, min_len=None, max_len=None, max_size=None, min_size=None, digits=None, decimals=None):
Creates a new driver capability. A driver capability can be represented basically by the max length of a string, the max digits number of a value or its minimum/maximum size. With an instance of Capability you can check if a value is acceptable by the driver through the check_value method. The Capability arguments are:
Parametersmin_lenThe minimum length of a string (type: number )
max_lenThe max length of a string (type: number @param max_size The maximum size for a value )
max_size (type: number )
min_sizeThe minimum size for a value (type: number )
digitsThe number of digits that a number can have (type: number )
decimalsIf the max value for the capability is a float, this parameter specifies the max precision that the number can have. (type: number

Note that 'max_len' can't be used together with 'min_size', 'max_size' and 'digits', in the same way that 'max_size' and 'min_size' can't be used with 'digits'. The values defined for these parameters are used also to verify the value type in the 'check_value' method.

)
def check_value(self, value):
Undocumented
API Documentation for Stoqdrivers, generated by pydoctor at 2009-04-30 17:14:35.