pysnmp.asn1.constraints
index
/home/mcfletch/pylive/pysnmp/asn1/constraints.py

Constraint functions/objects for pysnmp
 
Constraints are relatively rare, but every ASN1 object
is doing checks all the time for whether they have any
constraints and whether they are applicable to the object.
 
What we're going to do is define objects/functions that
can be called unconditionally if they are present, and that
are simply not present if there are no constraints.

 
Modules
       
pysnmp.asn1.error

 
Classes
       
object
Constraint
SingleValueConstraint
SingleValueConstraint

 
class Constraint(object)
    Abstract base-class for constraint objects
 
Constraints should be stored in a simple sequence in the
namespace of their client Asn1Object sub-classes.
 
  Methods defined here:
__call__(self, client, value)
Raise errors if value not appropriate for client

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Constraint' objects>
list of weak references to the object (if defined)

 
PermittedAlphabetConstraint = class SingleValueConstraint(Constraint)
    Value must be part of defined set constraint
 
 
Method resolution order:
SingleValueConstraint
Constraint
object

Methods defined here:
__call__(self, client, value)
Raise errors if value not appropriate for client
__init__(self, *set)
Initialise the SingleValueConstraint with items
 
*set -- hashable objects allowed

Data and other attributes inherited from Constraint:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Constraint' objects>
list of weak references to the object (if defined)

 
class SingleValueConstraint(Constraint)
    Value must be part of defined set constraint
 
 
Method resolution order:
SingleValueConstraint
Constraint
object

Methods defined here:
__call__(self, client, value)
Raise errors if value not appropriate for client
__init__(self, *set)
Initialise the SingleValueConstraint with items
 
*set -- hashable objects allowed

Data and other attributes inherited from Constraint:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Constraint' objects>
list of weak references to the object (if defined)

 
Functions
       
ValueRangeConstraint(start, stop)
Construct a callable object for checking value-range within start:stop inclusive
ValueSizeConstraint(start, stop)
Construct a callable object for checking value-range within start:stop inclusive