Package ganeti :: Package utils :: Class FieldSet
[hide private]
[frames] | no frames]

Class FieldSet

source code


A simple field set.

Among the features are:

Internally, all fields are held as regular expression objects.

Instance Methods [hide private]
 
__init__(self, *items)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
Extend(self, other_set)
Extend the field set with the items from another one
source code
 
Matches(self, field)
Checks if a field matches the current set
source code
list
NonMatching(self, items)
Returns the list of fields not matching the current set
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *items)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

Matches(self, field)

source code 

Checks if a field matches the current set

Parameters:
  • field (str) - the string to match
Returns:
either None or a regular expression match object

NonMatching(self, items)

source code 

Returns the list of fields not matching the current set

Parameters:
  • items (list) - the list of fields to check
Returns: list
list of non-matching fields