Package gen :: Package lib :: Module notebase :: Class NoteBase
[frames] | no frames]

Class NoteBase

source code


Base class for storing notes.

Starting in 3.0 branch, the objects may have multiple notes. Internally, this class maintains a list of Note handles, as a note_list attribute of the NoteBase object.

Instance Methods
 
__init__(self, source=None)
Create a new NoteBase, 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
bool
add_note(self, handle)
Add the Note handle to the list of note handles.
source code
 
remove_note(self, handle)
Remove the specified handle from the list of note handles, and all secondary child objects.
source code
list
get_note_child_list(self)
Return the list of child secondary objects that may refer notes.
source code
list
get_note_list(self)
Return the list of Note handles associated with the object.
source code
 
set_note_list(self, note_list)
Assign the passed list to be object's list of Note handles.
source code
list
get_referenced_note_handles(self)
Return the list of (classname, handle) tuples for all referenced notes.
source code
Method Details

__init__(self, source=None)
(Constructor)

source code 

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

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

add_note(self, handle)

source code 

Add the Note handle to the list of note handles.

Parameters:
  • handle (str) - Note handle to add the list of notes
Returns: bool
True if handle was added, False if it already was in the list

remove_note(self, handle)

source code 

Remove the specified handle from the list of note handles, and all secondary child objects.

Parameters:
  • handle (str) - Note handle to remove from the list of notes

get_note_child_list(self)

source code 

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

All methods which inherit from NoteBase and have other child objects with notes, should return here a list of child objects which are NoteBase

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

get_note_list(self)

source code 

Return the list of Note handles associated with the object.

Returns: list
The list of Note handles

set_note_list(self, note_list)

source code 

Assign the passed list to be object's list of Note handles.

Parameters:
  • note_list (list) - List of Note handles to be set on the object

get_referenced_note_handles(self)

source code 

Return the list of (classname, handle) tuples for all referenced notes.

This method should be used to get the Note portion of the list by objects that store note lists.

Returns: list
List of (classname, handle) tuples for referenced objects.