Package gen :: Package lib :: Module note :: Class Note
[frames] | no frames]

Class Note

source code


Introduction

The Note class defines a text note. The note may be preformatted or 'flowed', which indicates that it text string is considered to be in paragraphs, separated by newlines.

Instance Methods
 
__init__(self, text='')
Create a new Note object, initializing from the passed string.
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_text_data_list(self)
Return the list of all textual attributes of the object.
source code
 
set(self, text)
Set the text associated with the note to the passed string.
source code
str
get(self, markup=False)
Return the text string associated with the note.
source code
 
append(self, text)
Append the specified text to the text associated with the note.
source code
 
set_format(self, format)
Set the format of the note to the passed value.
source code
int
get_format(self)
Return the format of the note.
source code
 
set_type(self, the_type)
Set descriptive type of the Note.
source code
str
get_type(self)
Get descriptive type of the Note.
source code

Inherited from primaryobj.BasicPrimaryObject: get_change_display, get_change_time, get_gramps_id, get_handle, get_marker, has_handle_reference, has_media_reference, has_source_reference, remove_handle_references, remove_media_references, remove_source_references, replace_handle_reference, replace_media_references, replace_source_references, set_gramps_id, set_handle, set_marker

Inherited from baseobj.BaseObject: get_handle_referents, get_referenced_handles, get_referenced_handles_recursively, get_text_data_child_list, matches_regexp, matches_string

Inherited from privacybase.PrivacyBase: get_privacy, set_privacy

Class Variables
  FLOWED = 0
  FORMATTED = 1
Method Details

__init__(self, text='')
(Constructor)

source code 

Create a new Note object, initializing from the passed string.

Parameters:
  • source - Object used to initialize the new object
Overrides: privacybase.PrivacyBase.__init__

serialize(self)

source code 

Convert the object to a serialized tuple of data.

Overrides: privacybase.PrivacyBase.serialize

unserialize(self, data)

source code 

Convert a serialized tuple of data to an object.

Overrides: privacybase.PrivacyBase.unserialize

get_text_data_list(self)

source code 

Return the list of all textual attributes of the object.

Returns: list
Returns the list of all textual attributes of the object.
Overrides: baseobj.BaseObject.get_text_data_list

set(self, text)

source code 

Set the text associated with the note to the passed string.

Parameters:
  • text (str) - Text string defining the note contents.

get(self, markup=False)

source code 

Return the text string associated with the note.

Parameters:
  • markup (boolean) - If note should be returned with markup or plain text
Returns: str
Returns the text string defining the note contents.

append(self, text)

source code 

Append the specified text to the text associated with the note.

Parameters:
  • text (str) - Text string to be appended to the note.

set_format(self, format)

source code 

Set the format of the note to the passed value.

The value can either indicate Flowed or Preformatted.

Parameters:
  • format (int)

get_format(self)

source code 

Return the format of the note.

The value can either indicate Flowed or Preformatted.

Returns: int
0 indicates Flowed, 1 indicates Preformated

set_type(self, the_type)

source code 

Set descriptive type of the Note.

Parameters:
  • the_type (str) - descriptive type of the Note

get_type(self)

source code 

Get descriptive type of the Note.

Returns: str
the descriptive type of the Note