diff --git a/src/DisplayModels/_NoteModel.py b/src/DisplayModels/_NoteModel.py index 3c469e3bf..4bef39d8a 100644 --- a/src/DisplayModels/_NoteModel.py +++ b/src/DisplayModels/_NoteModel.py @@ -25,7 +25,6 @@ # #------------------------------------------------------------------------- import logging -import re log = logging.getLogger(".") #------------------------------------------------------------------------- diff --git a/src/Editors/_EditNote.py b/src/Editors/_EditNote.py index ce0c45205..3b9dcc76f 100644 --- a/src/Editors/_EditNote.py +++ b/src/Editors/_EditNote.py @@ -387,7 +387,7 @@ class EditNote(EditPrimary): if self.obj: self.empty = False self.flow_changed(self.obj.get_format()) - buffer_.set_text(self.obj.get(markup=True)) + buffer_.set_text(self.obj.get()) else: self.empty = True diff --git a/src/GrampsDbUtils/_GrampsDbWriteXML.py b/src/GrampsDbUtils/_GrampsDbWriteXML.py index 226788876..427d4083f 100644 --- a/src/GrampsDbUtils/_GrampsDbWriteXML.py +++ b/src/GrampsDbUtils/_GrampsDbWriteXML.py @@ -400,7 +400,7 @@ class GrampsDbXmlWriter(UpdateCallback): ntype = escxml(note.get_type().xml_str()) format = note.get_format() - text = note.get(markup=True) + text = note.get() self.g.write(' type="%s"' % ntype) if format != note.FLOWED: diff --git a/src/GrampsWidgets.py b/src/GrampsWidgets.py index 81f18d72c..f67f459f3 100644 --- a/src/GrampsWidgets.py +++ b/src/GrampsWidgets.py @@ -1064,7 +1064,7 @@ class NoteEntry(ObjEntry): return self.db.get_note_from_handle(handle) def get_label(self, note): - txt = " ".join(note.get(markup=False).split()) + txt = " ".join(note.get().split()) if len(txt) > 35: txt = txt[:35]+"..." else: diff --git a/src/Merge/_MergePerson.py b/src/Merge/_MergePerson.py index 28cde0a84..cc212e4da 100644 --- a/src/Merge/_MergePerson.py +++ b/src/Merge/_MergePerson.py @@ -915,8 +915,8 @@ class MergePeople: print "Deleted empty family %s" % family_handle def merge_notes(self, note1, note2): - t1 = note1.get(markup=True) - t2 = note2.get(markup=True) + t1 = note1.get() + t2 = note2.get() if not t2: return note1 elif not t1: diff --git a/src/PluginUtils/_GuiOptions.py b/src/PluginUtils/_GuiOptions.py index 07d4beab0..9472d2255 100644 --- a/src/PluginUtils/_GuiOptions.py +++ b/src/PluginUtils/_GuiOptions.py @@ -659,7 +659,7 @@ class GuiNoteOption(gtk.HBox): """ if note: note_id = note.get_gramps_id() - txt = " ".join(note.get(markup=False).split()) + txt = " ".join(note.get().split()) if len(txt) > 35: txt = txt[:35]+"..." else: diff --git a/src/gen/lib/note.py b/src/gen/lib/note.py index 65955a742..c4b45c352 100644 --- a/src/gen/lib/note.py +++ b/src/gen/lib/note.py @@ -29,7 +29,6 @@ Note class for GRAMPS. # standard python modules # #------------------------------------------------------------------------- -import re from types import InstanceType #------------------------------------------------------------------------- @@ -41,8 +40,6 @@ from gen.lib.primaryobj import BasicPrimaryObject from gen.lib.notetype import NoteType from gen.lib.markertype import MarkerType -#ROOT_START_TAG = '' - #------------------------------------------------------------------------- # # Class for notes used throughout the majority of GRAMPS objects @@ -107,39 +104,15 @@ class Note(BasicPrimaryObject): """ self.text = text - def get(self, markup=False): + def get(self): """ Return the text string associated with the note. - @param markup: If note should be returned with markup or plain text - @type markup: boolean @returns: Returns the text string defining the note contents. @rtype: str """ text = self.text -# -# if not markup and text.startswith(ROOT_START_TAG): -# text = self.delete_tags(text) - return text -# -# def delete_tags(self, markup_text): -# """ -# Create a plain text version of the note text by removing all pango -# markup tags. -# -# @param markup_text: Pango style markup text -# @type markup_text: str -# @return: Plain text -# @rtype: str -# """ -# text = re.sub(r'(<.*?>)', '', markup_text) -# -# text = text.replace('&', '&') -# text = text.replace('<', '<') -# text = text.replace('>', '>') -# -# return text def append(self, text): """ @@ -188,14 +161,3 @@ class Note(BasicPrimaryObject): @rtype: str """ return self.type - -if __name__ == "__main__": - import hotshot - prof = hotshot.Profile("note.profile") - - f = open("notetest3_10.txt") - note = Note(f.read()) - - for i in range(100000): - prof.runcall(note.get) - prof.close()