class documentation

class FieldSet(object):

View In Hierarchy

A simple field set.

Among the features are:

  • checking if a string is among a list of static string or regex objects
  • checking if a whole list of string matches
  • returning the matching groups from a regex match

Internally, all fields are held as regular expression objects.

Method __init__ Undocumented
Method Extend Extend the field set with the items from another one
Method Matches Checks if a field matches the current set
Method NonMatching Returns the list of fields not matching the current set
Instance Variable items Undocumented
def __init__(self, *items):

Undocumented

def Extend(self, other_set):

Extend the field set with the items from another one

def Matches(self, field):

Checks if a field matches the current set

Parameters
field:strthe string to match
Returns
either None or a regular expression match object
def NonMatching(self, items):

Returns the list of fields not matching the current set

Parameters
items:listthe list of fields to check
Returns
listlist of non-matching fields
items =

Undocumented