Package gen :: Package lib :: Module srcbase :: Class SourceBase
[frames] | no frames]

Class SourceBase

source code


Base class for storing source references.

Instance Methods
 
__init__(self, source=None)
Create a new SourceBase, copying from source if not None.
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_source_reference(self, src_ref)
Add a source reference to this object.
source code
list
get_source_references(self)
Return the list of source references associated with the object.
source code
list
get_sourcref_child_list(self)
Return the list of child secondary objects that may refer sources.
source code
bool
has_source_reference(self, src_handle)
Return True if the object or any of it's child objects has reference to this source handle.
source code
 
remove_source_references(self, src_handle_list)
Remove references to all source handles in the list in this object and all child objects.
source code
 
replace_source_references(self, old_handle, new_handle)
Replace references to source handles in the list in this object and all child objects.
source code
 
set_source_reference_list(self, src_ref_list)
Assign the passed list to the object's list of source references.
source code
Method Details

__init__(self, source=None)
(Constructor)

source code 

Create a new SourceBase, copying from source if not None.

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

add_source_reference(self, src_ref)

source code 

Add a source reference to this object.

Parameters:
  • src_ref (SourceRef) - The source reference to be added to the SourceNote's list of source references.

get_source_references(self)

source code 

Return the list of source references associated with the object.

Returns: list
Returns the list of SourceRef objects assocated with the object.

get_sourcref_child_list(self)

source code 

Return the list of child secondary objects that may refer sources.

Returns: list
Returns the list of child secondary child objects that may refer sources.

has_source_reference(self, src_handle)

source code 

Return True if the object or any of it's child objects has reference to this source handle.

Parameters:
  • src_handle (str) - The source handle to be checked.
Returns: bool
Returns whether the object or any of it's child objects has reference to this source handle.

remove_source_references(self, src_handle_list)

source code 

Remove references to all source handles in the list in this object and all child objects.

Parameters:
  • src_handle_list (list) - The list of source handles to be removed.

replace_source_references(self, old_handle, new_handle)

source code 

Replace references to source handles in the list in this object and all child objects.

Parameters:
  • old_handle (str) - The source handle to be replaced.
  • new_handle (str) - The source handle to replace the old one with.

set_source_reference_list(self, src_ref_list)

source code 

Assign the passed list to the object's list of source references.

Parameters:
  • src_ref_list (list of SourceRef instances) - List of source references to ba associated with the object