Package gen :: Package lib :: Module addressbase :: Class AddressBase
[frames] | no frames]

Class AddressBase

source code


Base class for address-aware objects.

Instance Methods
 
__init__(self, source=None)
Initialize a AddressBase.
source code
 
serialize(self)
Convert the object to a serialized tuple of data.
source code
 
unserialize(self, data)
Convert a serialized tuple of data to an object.
source code
 
add_address(self, address)
Add the Address instance to the object's list of addresses.
source code
bool
remove_address(self, address)
Remove the specified Address instance from the address list.
source code
list
get_address_list(self)
Return the list of Address instances associated with the object.
source code
 
set_address_list(self, address_list)
Assign the passed list to the object's list of Address instances.
source code
Method Details

__init__(self, source=None)
(Constructor)

source code 

Initialize a AddressBase.

If the source is not None, then object is initialized from values of the source object.

Parameters:
  • source (AddressBase) - Object used to initialize the new object

add_address(self, address)

source code 

Add the Address instance to the object's list of addresses.

Parameters:
  • address (list) - Address instance to add to the object's address list

remove_address(self, address)

source code 

Remove the specified Address instance from the address list.

If the instance does not exist in the list, the operation has no effect.

Parameters:
Returns: bool
True if the address was removed, False if it was not in the list.

get_address_list(self)

source code 

Return the list of Address instances associated with the object.

Returns: list
Returns the list of Address instances

set_address_list(self, address_list)

source code 

Assign the passed list to the object's list of Address instances.

Parameters:
  • address_list (list) - List of Address instances to be associated with the object