Package ganeti :: Module ht
[hide private]
[frames] | no frames]

Module ht

source code

Module implementing the parameter types code.

Functions [hide private]
 
EmptyList()
Returns an empty list.
source code
 
EmptyDict()
Returns an empty dict.
source code
 
TNotNone(val)
Checks if the given value is not None.
source code
 
TNone(val)
Checks if the given value is None.
source code
 
TBool(val)
Checks if the given value is a boolean.
source code
 
TInt(val)
Checks if the given value is an integer.
source code
 
TFloat(val)
Checks if the given value is a float.
source code
 
TString(val)
Checks if the given value is a string.
source code
 
TTrue(val)
Checks if a given value evaluates to a boolean True value.
source code
 
TElemOf(target_list)
Builds a function that checks if a given value is a member of a list.
source code
 
TList(val)
Checks if the given value is a list.
source code
 
TDict(val)
Checks if the given value is a dictionary.
source code
 
TIsLength(size)
Check is the given container is of the given size.
source code
 
TAnd(*args)
Combine multiple functions using an AND operation.
source code
 
TOr(*args)
Combine multiple functions using an AND operation.
source code
 
TMap(fn, test)
Checks that a modified version of the argument passes the given test.
source code
 
TListOf(my_type)
Checks if a given value is a list with all elements of the same type.
source code
 
TDictOf(key_type, val_type)
Checks a dict type for the type of its key/values.
source code
Variables [hide private]
  NoDefault = object()
The without-default default value
  NoType = object()
The no-type (value to complex to check it in the type system)
  TNonEmptyString = TAnd(TString, TTrue)
a non-empty string
  TMaybeString = TOr(TNonEmptyString, TNone)
a maybe non-empty string
  TMaybeBool = TOr(TBool, TNone)
a maybe boolean (bool or none)
  TMaybeDict = TOr(TDict, TNone)
Maybe a dictionary (dict or None)
  TPositiveInt = TAnd(TInt, lambda v: v >= 0)
a positive integer
  TStrictPositiveInt = TAnd(TInt, lambda v: v > 0)
a strictly positive integer
  TNumber = TOr(TInt, TFloat)
Number

Imports: compat