Package gen :: Package lib :: Module urlbase :: Class UrlBase
[frames] | no frames]

Class UrlBase

source code


Base class for url-aware objects.

Instance Methods
 
__init__(self, source=None)
Initialize an UrlBase.
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
list
get_url_list(self)
Return the list of Url instances associated with the object.
source code
 
set_url_list(self, url_list)
Set the list of Url instances to passed the list.
source code
 
add_url(self, url)
Add a Url instance to the object's list of Url instances.
source code
bool
remove_url(self, url)
Remove the specified Url instance from the url list.
source code
Method Details

__init__(self, source=None)
(Constructor)

source code 

Initialize an UrlBase.

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

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

get_url_list(self)

source code 

Return the list of Url instances associated with the object.

Returns: list
List of Url instances

set_url_list(self, url_list)

source code 

Set the list of Url instances to passed the list.

Parameters:
  • url_list (list) - List of Url instances

add_url(self, url)

source code 

Add a Url instance to the object's list of Url instances.

Parameters:
  • url (Url) - Url instance to be added to the Person's list of related web sites.

remove_url(self, url)

source code 

Remove the specified Url instance from the url list.

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

Parameters:
  • url (Url) - Url instance to remove from the list
Returns: bool
True if the url was removed, False if it was not in the list.