Package suds :: Module properties :: Class Properties
[hide private]
[frames] | no frames]

Class Properties

source code

Represents basic application properties. Provides basic type validation, default values and link/synchronization behavior.

Instance Methods [hide private]
 
__init__(self, domain, definitions, kwargs) source code
Definition
definition(self, name)
Get the definition for the property name.
source code
Properties
update(self, other)
Update the property values as specified by keyword/value.
source code
bool
notset(self, name)
Get whether a property has never been set by name.
source code
Properties
set(self, name, value)
Set the value of a property by name.
source code
Properties
unset(self, name)
Unset a property by name.
source code
any
get(self, name, *df)
Get the value of a property by name.
source code
Properties
link(self, other)
Link (associate) this object with another properties object to create a network of properties.
source code
Properties
unlink(self, *others)
Unlink (disassociate) the specified properties object.
source code
Properties
provider(self, name, history=None)
Find the provider of the property by name.
source code
list
keys(self, history=None)
Get the set of all property names.
source code
list
domains(self, history=None)
Get the set of all domain names.
source code
Properties
prime(self)
Prime the stored values based on default values found in property definitions.
source code
 
__notset(self, name) source code
 
__set(self, name, value) source code
 
__get(self, name, *df) source code
 
str(self, history) source code
 
__repr__(self) source code
 
__str__(self) source code
Instance Variables [hide private]
dict defined
A dict of property values.
{name: Definition} definitions
A table of property definitions.
str domain
The domain name.
[Property,..] links
A list of linked property objects used to create a network of properties.
Method Details [hide private]

__init__(self, domain, definitions, kwargs)
(Constructor)

source code 
Parameters:
  • domain (str) - The property domain name.
  • definitions ({name: Definition}) - A table of property definitions.
  • kwargs (dict) - A list of property name/values to set.

definition(self, name)

source code 

Get the definition for the property name.

Parameters:
  • name (str) - The property name to find the definition for.
Returns: Definition
The property definition
Raises:
  • AttributeError - On not found.

update(self, other)

source code 

Update the property values as specified by keyword/value.

Parameters:
  • other ((dict|Properties)) - An object to update from.
Returns: Properties
self

notset(self, name)

source code 

Get whether a property has never been set by name.

Parameters:
  • name (str) - A property name.
Returns: bool
True if never been set.

set(self, name, value)

source code 

Set the value of a property by name. The value is validated against the definition and set to the default when value is None.

Parameters:
  • name (str) - The property name.
  • value (any) - The new property value.
Returns: Properties
self

unset(self, name)

source code 

Unset a property by name.

Parameters:
  • name (str) - A property name.
Returns: Properties
self

get(self, name, *df)

source code 

Get the value of a property by name.

Parameters:
  • name (str) - The property name.
  • df ([1].) - An optional value to be returned when the value is not set
Returns: any
The stored value, or df[0] if not set.

link(self, other)

source code 

Link (associate) this object with another properties object to create a network of properties. Links are bidirectional.

Parameters:
Returns: Properties
self

unlink(self, *others)

source code 

Unlink (disassociate) the specified properties object.

Parameters:
  • others ([Properties,..]) - The list object to unlink. Unspecified means unlink all.
Returns: Properties
self

provider(self, name, history=None)

source code 

Find the provider of the property by name.

Parameters:
  • name (str) - The property name.
  • history ([Properties,..]) - A history of nodes checked to prevent circular hunting.
Returns: Properties
The provider when found. Otherwise, None (when nested) and self when not nested.

keys(self, history=None)

source code 

Get the set of all property names.

Parameters:
  • history ([Properties,..]) - A history of nodes checked to prevent circular hunting.
Returns: list
A set of property names.

domains(self, history=None)

source code 

Get the set of all domain names.

Parameters:
  • history ([Properties,..]) - A history of nodes checked to prevent circular hunting.
Returns: list
A set of domain names.

prime(self)

source code 

Prime the stored values based on default values found in property definitions.

Returns: Properties
self