* src/RelLib.py (NoteBase,PlaceBase): Add new classes.
* src/ReadGedcom.py: Use get_note for comments. * src/ReadXML.py: Use get_note for comments. * src/Sources.py: Use get_note for comments. * src/WriteGedcom.py: Use get_note for comments. * src/WriteXML.py: Use get_note for comments. * src/plugins/Ancestors.py: Use get_note for comments. * src/plugins/FtmStyleAncestors.py: Use get_note for comments. * src/plugins/FtmStyleDescendants.py: Use get_note for comments. * src/plugins/NavWebPage.py: Use get_note for comments. * src/plugins/ScratchPad.py: Use get_note for comments. * src/plugins/WebPage.py: Use get_note for comments. svn: r4246
This commit is contained in:
parent
7bc078bb43
commit
adfdc9c807
@ -7,6 +7,19 @@
|
||||
* src/gramps_main.py (on_views_switch_page): Enable merge button;
|
||||
(on_merge_activate): Call merge for sources.
|
||||
|
||||
* src/RelLib.py (NoteBase,PlaceBase): Add new classes.
|
||||
* src/ReadGedcom.py: Use get_note for comments.
|
||||
* src/ReadXML.py: Use get_note for comments.
|
||||
* src/Sources.py: Use get_note for comments.
|
||||
* src/WriteGedcom.py: Use get_note for comments.
|
||||
* src/WriteXML.py: Use get_note for comments.
|
||||
* src/plugins/Ancestors.py: Use get_note for comments.
|
||||
* src/plugins/FtmStyleAncestors.py: Use get_note for comments.
|
||||
* src/plugins/FtmStyleDescendants.py: Use get_note for comments.
|
||||
* src/plugins/NavWebPage.py: Use get_note for comments.
|
||||
* src/plugins/ScratchPad.py: Use get_note for comments.
|
||||
* src/plugins/WebPage.py: Use get_note for comments.
|
||||
|
||||
2005-03-26 Alex Roitman <shura@gramps-project.org>
|
||||
* src/RelLib.py (Source.replace_source_references): Add method.
|
||||
* src/MergeData.py (MergeSources.merge): Use new handle replacement.
|
||||
|
@ -883,7 +883,7 @@ class GedcomParser:
|
||||
return self.parse_note_base(matches,obj,level,old_note,obj.set_note)
|
||||
|
||||
def parse_comment(self,matches,obj,level,old_note):
|
||||
return self.parse_note_base(matches,obj,level,old_note,obj.set_comments)
|
||||
return self.parse_note_base(matches,obj,level,old_note,obj.set_note)
|
||||
|
||||
def parse_individual(self):
|
||||
name_cnt = 0
|
||||
|
@ -1291,7 +1291,7 @@ class GrampsParser:
|
||||
note = fix_spaces(self.scomments_list)
|
||||
else:
|
||||
note = tag
|
||||
self.source_ref.set_comments(note)
|
||||
self.source_ref.set_note(note)
|
||||
|
||||
def stop_last(self,tag):
|
||||
if self.name:
|
||||
|
@ -298,7 +298,92 @@ class PrimaryObject(BaseObject):
|
||||
def _replace_handle_reference(self,classname,old_handle,new_handle):
|
||||
pass
|
||||
|
||||
class SourceNote(BaseObject):
|
||||
class NoteBase:
|
||||
"""
|
||||
Base class for storing notes.
|
||||
"""
|
||||
def __init__(self,source=None):
|
||||
"""
|
||||
Create a new NoteBase, copying from source if not None
|
||||
|
||||
@param source: Object used to initialize the new object
|
||||
@type source: NoteBase
|
||||
"""
|
||||
|
||||
if source and source.note:
|
||||
self.note = Note(source.note.get())
|
||||
else:
|
||||
self.note = None
|
||||
|
||||
def set_note(self,text):
|
||||
"""
|
||||
Assigns the specified text to the associated note.
|
||||
|
||||
@param text: Text of the note
|
||||
@type text: str
|
||||
"""
|
||||
if self.note == None:
|
||||
self.note = Note()
|
||||
self.note.set(text)
|
||||
|
||||
def get_note(self):
|
||||
"""
|
||||
Returns the text of the current note.
|
||||
|
||||
@returns: the text of the current note
|
||||
@rtype: str
|
||||
"""
|
||||
if self.note == None:
|
||||
return ""
|
||||
else:
|
||||
return self.note.get()
|
||||
|
||||
def set_note_format(self,val):
|
||||
"""
|
||||
Sets the note's format to the given value. The format indicates
|
||||
whether the text is flowed (wrapped) or preformatted.
|
||||
|
||||
@param val: True indicates the text is flowed
|
||||
@type val: bool
|
||||
"""
|
||||
if self.note:
|
||||
self.note.set_format(val)
|
||||
|
||||
def get_note_format(self):
|
||||
"""
|
||||
Returns the current note's format
|
||||
|
||||
@returns: True indicates that the note should be flowed (wrapped)
|
||||
@rtype: bool
|
||||
"""
|
||||
if self.note == None:
|
||||
return False
|
||||
else:
|
||||
return self.note.get_format()
|
||||
|
||||
def set_note_object(self,note_obj):
|
||||
"""
|
||||
Replaces the current L{Note} object associated with the object
|
||||
|
||||
@param note_obj: New L{Note} object to be assigned
|
||||
@type note_obj: L{Note}
|
||||
"""
|
||||
self.note = note_obj
|
||||
|
||||
def get_note_object(self):
|
||||
"""
|
||||
Returns the L{Note} instance associated with the object.
|
||||
|
||||
@returns: L{Note} object assocated with the object
|
||||
@rtype: L{Note}
|
||||
"""
|
||||
return self.note
|
||||
|
||||
def unique_note(self):
|
||||
"""Creates a unique instance of the current note"""
|
||||
self.note = Note(self.note.get())
|
||||
|
||||
class SourceNote(BaseObject,NoteBase):
|
||||
"""
|
||||
Base class for storing source references and notes
|
||||
"""
|
||||
@ -311,13 +396,11 @@ class SourceNote(BaseObject):
|
||||
@type source: SourceNote
|
||||
"""
|
||||
|
||||
self.source_list = []
|
||||
self.note = None
|
||||
|
||||
NoteBase.__init__(self,source)
|
||||
if source:
|
||||
self.source_list = [SourceRef(sref) for sref in source.source_list]
|
||||
if source.note:
|
||||
self.note = Note(source.note.get())
|
||||
else:
|
||||
self.source_list = []
|
||||
|
||||
def add_source_reference(self,src_ref) :
|
||||
"""
|
||||
@ -411,74 +494,6 @@ class SourceNote(BaseObject):
|
||||
"""
|
||||
self.source_list = src_ref_list
|
||||
|
||||
def set_note(self,text):
|
||||
"""
|
||||
Assigns the specified text to the associated note.
|
||||
|
||||
@param text: Text of the note
|
||||
@type text: str
|
||||
"""
|
||||
if self.note == None:
|
||||
self.note = Note()
|
||||
self.note.set(text)
|
||||
|
||||
def get_note(self):
|
||||
"""
|
||||
Returns the text of the current note.
|
||||
|
||||
@returns: the text of the current note
|
||||
@rtype: str
|
||||
"""
|
||||
if self.note == None:
|
||||
return ""
|
||||
else:
|
||||
return self.note.get()
|
||||
|
||||
def set_note_format(self,val):
|
||||
"""
|
||||
Sets the note's format to the given value. The format indicates
|
||||
whether the text is flowed (wrapped) or preformatted.
|
||||
|
||||
@param val: True indicates the text is flowed
|
||||
@type val: bool
|
||||
"""
|
||||
if self.note:
|
||||
self.note.set_format(val)
|
||||
|
||||
def get_note_format(self):
|
||||
"""
|
||||
Returns the current note's format
|
||||
|
||||
@returns: True indicates that the note should be flowed (wrapped)
|
||||
@rtype: bool
|
||||
"""
|
||||
if self.note == None:
|
||||
return False
|
||||
else:
|
||||
return self.note.get_format()
|
||||
|
||||
def set_note_object(self,note_obj):
|
||||
"""
|
||||
Replaces the current L{Note} object associated with the object
|
||||
|
||||
@param note_obj: New L{Note} object to be assigned
|
||||
@type note_obj: L{Note}
|
||||
"""
|
||||
self.note = note_obj
|
||||
|
||||
def get_note_object(self):
|
||||
"""
|
||||
Returns the L{Note} instance associated with the object.
|
||||
|
||||
@returns: L{Note} object assocated with the object
|
||||
@rtype: L{Note}
|
||||
"""
|
||||
return self.note
|
||||
|
||||
def unique_note(self):
|
||||
"""Creates a unique instance of the current note"""
|
||||
self.note = Note(self.note.get())
|
||||
|
||||
class MediaBase:
|
||||
"""
|
||||
Base class for storing media references
|
||||
@ -753,6 +768,42 @@ class AttributeBase:
|
||||
"""
|
||||
self.attribute_list = attribute_list
|
||||
|
||||
class PlaceBase:
|
||||
"""
|
||||
Base class for place-aware objects.
|
||||
"""
|
||||
def __init__(self,source=None):
|
||||
"""
|
||||
Initialize a PlaceBase. If the source is not None, then object
|
||||
is initialized from values of the source object.
|
||||
|
||||
@param source: Object used to initialize the new object
|
||||
@type source: PlaceBase
|
||||
"""
|
||||
if source:
|
||||
self.place = source.place
|
||||
else:
|
||||
self.place = ""
|
||||
|
||||
def set_place_handle(self,place_handle):
|
||||
"""
|
||||
Sets the database handle for L{Place} associated with the object.
|
||||
|
||||
@param place_handle: L{Place} database handle
|
||||
@type place_handle: str
|
||||
"""
|
||||
self.place = place_handle
|
||||
|
||||
def get_place_handle(self):
|
||||
"""
|
||||
Returns the database handle of the L{Place} assocated with
|
||||
the Event.
|
||||
|
||||
@returns: L{Place} database handle
|
||||
@rtype: str
|
||||
"""
|
||||
return self.place
|
||||
|
||||
class PrivateSourceNote(SourceNote,PrivacyBase):
|
||||
"""
|
||||
Same as SourceNote, plus the privacy capabilities.
|
||||
@ -1873,7 +1924,7 @@ class Family(PrimaryObject,SourceNote,MediaBase,AttributeBase):
|
||||
"""
|
||||
self.event_list = event_list
|
||||
|
||||
class Event(PrimaryObject,PrivateSourceNote,MediaBase,DateBase):
|
||||
class Event(PrimaryObject,PrivateSourceNote,MediaBase,DateBase,PlaceBase):
|
||||
"""
|
||||
Introduction
|
||||
============
|
||||
@ -1897,9 +1948,9 @@ class Event(PrimaryObject,PrivateSourceNote,MediaBase,DateBase):
|
||||
PrivateSourceNote.__init__(self,source)
|
||||
MediaBase.__init__(self,source)
|
||||
DateBase.__init__(self,source)
|
||||
PlaceBase.__init__(self,source)
|
||||
|
||||
if source:
|
||||
self.place = source.place
|
||||
self.description = source.description
|
||||
self.name = source.name
|
||||
self.cause = source.cause
|
||||
@ -1908,7 +1959,6 @@ class Event(PrimaryObject,PrivateSourceNote,MediaBase,DateBase):
|
||||
else:
|
||||
self.witness = None
|
||||
else:
|
||||
self.place = ""
|
||||
self.description = ""
|
||||
self.name = ""
|
||||
self.cause = ""
|
||||
@ -2116,26 +2166,6 @@ class Event(PrimaryObject,PrivateSourceNote,MediaBase,DateBase):
|
||||
"""
|
||||
return self.name
|
||||
|
||||
def set_place_handle(self,place_handle):
|
||||
"""
|
||||
Sets the database handle for L{Place} associated with the
|
||||
Event.
|
||||
|
||||
@param place_handle: L{Place} database handle
|
||||
@type place_handle: str
|
||||
"""
|
||||
self.place = place_handle
|
||||
|
||||
def get_place_handle(self):
|
||||
"""
|
||||
Returns the database handle of the L{Place} assocated with
|
||||
the Event.
|
||||
|
||||
@returns: L{Place} database handle
|
||||
@rtype: str
|
||||
"""
|
||||
return self.place
|
||||
|
||||
def set_cause(self,cause):
|
||||
"""
|
||||
Sets the cause of the Event to the passed string. The string
|
||||
@ -2591,13 +2621,14 @@ class MediaObject(PrimaryObject,SourceNote,DateBase,AttributeBase):
|
||||
"""returns the description of the image"""
|
||||
return self.desc
|
||||
|
||||
class Source(PrimaryObject,MediaBase):
|
||||
class Source(PrimaryObject,MediaBase,NoteBase):
|
||||
"""A record of a source of information"""
|
||||
|
||||
def __init__(self):
|
||||
"""creates a new Source instance"""
|
||||
PrimaryObject.__init__(self)
|
||||
MediaBase.__init__(self)
|
||||
NoteBase.__init__(self)
|
||||
self.title = ""
|
||||
self.author = ""
|
||||
self.pubinfo = ""
|
||||
@ -2720,34 +2751,6 @@ class Source(PrimaryObject,MediaBase):
|
||||
"""
|
||||
return self.title
|
||||
|
||||
def set_note(self,text):
|
||||
"""sets the text of the note attached to the Source"""
|
||||
self.note.set(text)
|
||||
|
||||
def get_note(self):
|
||||
"""returns the text of the note attached to the Source"""
|
||||
return self.note.get()
|
||||
|
||||
def set_note_format(self,val):
|
||||
"""Set the note's format to the given value"""
|
||||
self.note.set_format(val)
|
||||
|
||||
def get_note_format(self):
|
||||
"""Return the current note's format"""
|
||||
return self.note.get_format()
|
||||
|
||||
def set_note_object(self,obj):
|
||||
"""sets the Note instance attached to the Source"""
|
||||
self.note = obj
|
||||
|
||||
def get_note_object(self):
|
||||
"""returns the Note instance attached to the Source"""
|
||||
return self.note
|
||||
|
||||
def unique_note(self):
|
||||
"""Creates a unique instance of the current note"""
|
||||
self.note = Note(self.note.get())
|
||||
|
||||
def set_author(self,author):
|
||||
"""sets the author of the Source"""
|
||||
self.author = author
|
||||
@ -2772,7 +2775,7 @@ class Source(PrimaryObject,MediaBase):
|
||||
"""returns the title abbreviation of the Source"""
|
||||
return self.abbrev
|
||||
|
||||
class LdsOrd(SourceNote,DateBase):
|
||||
class LdsOrd(SourceNote,DateBase,PlaceBase):
|
||||
"""
|
||||
Class that contains information about LDS Ordinances. LDS
|
||||
ordinances are similar to events, but have very specific additional
|
||||
@ -2784,17 +2787,16 @@ class LdsOrd(SourceNote,DateBase):
|
||||
"""Creates a LDS Ordinance instance"""
|
||||
SourceNote.__init__(self,source)
|
||||
DateBase.__init__(self,source)
|
||||
PlaceBase.__init__(self,source)
|
||||
|
||||
if source:
|
||||
self.famc = source.famc
|
||||
self.temple = source.temple
|
||||
self.status = source.status
|
||||
self.place = source.place
|
||||
else:
|
||||
self.famc = None
|
||||
self.temple = ""
|
||||
self.status = 0
|
||||
self.place = None
|
||||
|
||||
def get_text_data_list(self):
|
||||
"""
|
||||
@ -2817,14 +2819,6 @@ class LdsOrd(SourceNote,DateBase):
|
||||
check_list.append(self.note)
|
||||
return check_list
|
||||
|
||||
def set_place_handle(self,place):
|
||||
"""sets the Place database handle of the ordinance"""
|
||||
self.place = place
|
||||
|
||||
def get_place_handle(self):
|
||||
"""returns the Place handle of the ordinance"""
|
||||
return self.place
|
||||
|
||||
def set_family_handle(self,family):
|
||||
"""Sets the Family database handle associated with the LDS ordinance"""
|
||||
self.famc = family
|
||||
@ -3707,7 +3701,7 @@ class Witness(BaseObject,PrivacyBase):
|
||||
def get_comment(self):
|
||||
return self.comment
|
||||
|
||||
class SourceRef(BaseObject,DateBase,PrivacyBase):
|
||||
class SourceRef(BaseObject,DateBase,PrivacyBase,NoteBase):
|
||||
"""Source reference, containing detailed information about how a
|
||||
referenced source relates to it"""
|
||||
|
||||
@ -3715,17 +3709,17 @@ class SourceRef(BaseObject,DateBase,PrivacyBase):
|
||||
"""creates a new SourceRef, copying from the source if present"""
|
||||
DateBase.__init__(self,source)
|
||||
PrivacyBase.__init__(self,source)
|
||||
NoteBase.__init__(self,source)
|
||||
if source:
|
||||
self.confidence = source.confidence
|
||||
self.ref = source.ref
|
||||
self.page = source.page
|
||||
self.comments = Note(source.comments.get())
|
||||
self.text = source.text
|
||||
else:
|
||||
self.confidence = CONF_NORMAL
|
||||
self.ref = None
|
||||
self.page = ""
|
||||
self.comments = Note()
|
||||
self.note = Note()
|
||||
self.text = ""
|
||||
|
||||
def get_text_data_list(self):
|
||||
@ -3744,7 +3738,7 @@ class SourceRef(BaseObject,DateBase,PrivacyBase):
|
||||
@return: Returns the list of child objects that may carry textual data.
|
||||
@rtype: list
|
||||
"""
|
||||
return [self.comments]
|
||||
return [self.note]
|
||||
|
||||
def set_confidence_level(self,val):
|
||||
"""Sets the confidence level"""
|
||||
@ -3778,18 +3772,6 @@ class SourceRef(BaseObject,DateBase,PrivacyBase):
|
||||
"""returns the text related to the SourceRef"""
|
||||
return self.text
|
||||
|
||||
def set_note_object(self,note):
|
||||
"""Change the Note instance to obj"""
|
||||
self.comments = note
|
||||
|
||||
def set_comments(self,comments):
|
||||
"""sets the comments about the SourceRef"""
|
||||
self.comments.set(comments)
|
||||
|
||||
def get_comments(self):
|
||||
"""returns the comments about the SourceRef"""
|
||||
return self.comments.get()
|
||||
|
||||
def are_equal(self,other):
|
||||
"""returns True if the passed SourceRef is equal to the current"""
|
||||
if self.ref and other.ref:
|
||||
@ -3802,7 +3784,7 @@ class SourceRef(BaseObject,DateBase,PrivacyBase):
|
||||
return False
|
||||
if self.get_text() != other.get_text():
|
||||
return False
|
||||
if self.get_comments() != other.get_comments():
|
||||
if self.get_note() != other.get_note():
|
||||
return False
|
||||
if self.confidence != other.confidence:
|
||||
return False
|
||||
@ -3812,10 +3794,6 @@ class SourceRef(BaseObject,DateBase,PrivacyBase):
|
||||
else:
|
||||
return False
|
||||
|
||||
def unique_note(self):
|
||||
"""Creates a unique instance of the current note"""
|
||||
self.comments = Note(self.comments.get())
|
||||
|
||||
class GenderStats:
|
||||
"""
|
||||
Class for keeping track of statistics related to Given Name vs.
|
||||
|
@ -496,7 +496,7 @@ class SourceEditor:
|
||||
text.get_buffer().set_text(self.source_ref.get_text())
|
||||
|
||||
scom = self.get_widget("scomment")
|
||||
scom.get_buffer().set_text(self.source_ref.get_comments())
|
||||
scom.get_buffer().set_text(self.source_ref.get_note())
|
||||
src = self.db.get_source_from_handle(self.source_ref.get_base_handle())
|
||||
self.active_source = src
|
||||
if src:
|
||||
@ -557,7 +557,7 @@ class SourceEditor:
|
||||
self.source_ref.set_page(page)
|
||||
self.source_ref.set_date_object(self.date_obj)
|
||||
self.source_ref.set_text(text)
|
||||
self.source_ref.set_comments(comments)
|
||||
self.source_ref.set_note(comments)
|
||||
self.source_ref.set_confidence_level(conf)
|
||||
self.source_ref.set_privacy(self.private.get_active())
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2000-2004 Donald N. Allingham
|
||||
# Copyright (C) 2000-2005 Donald N. Allingham
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -27,9 +27,9 @@
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import os
|
||||
import string
|
||||
import time
|
||||
import re
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -53,8 +53,6 @@ import Errors
|
||||
import ansel_utf8
|
||||
import Utils
|
||||
import NameDisplay
|
||||
|
||||
from gettext import gettext as _
|
||||
from QuestionDialog import ErrorDialog
|
||||
|
||||
def keep_utf8(s):
|
||||
@ -274,7 +272,7 @@ def fmtline(text,limit,level,endl):
|
||||
if len(text) > 0:
|
||||
new_text.append(text)
|
||||
app = "%s%d CONC " % (endl,level+1)
|
||||
return string.join(new_text,app)
|
||||
return app.join(new_text)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -887,7 +885,7 @@ class GedcomWriter:
|
||||
else:
|
||||
self.writeln("1 EVEN")
|
||||
self.writeln("2 TYPE %s" % self.cnvtxt(name))
|
||||
self.writeln("2 PLAC %s" % string.replace(self.cnvtxt(attr.get_value()),'\r',' '))
|
||||
self.writeln("2 PLAC %s" % self.cnvtxt(attr.get_value()).replace('\r',' '))
|
||||
if attr.get_note():
|
||||
self.write_long_text("NOTE",2,self.cnvtxt(attr.get_note()))
|
||||
for srcref in attr.get_source_references():
|
||||
@ -918,7 +916,7 @@ class GedcomWriter:
|
||||
text = addr_append(text,addr.get_country())
|
||||
text = addr_append(text,addr.get_phone())
|
||||
if text:
|
||||
self.writeln("2 PLAC %s" % string.replace(self.cnvtxt(text),'\r',' '))
|
||||
self.writeln("2 PLAC %s" % self.cnvtxt(text).replace('\r',' '))
|
||||
if addr.get_note():
|
||||
self.write_long_text("NOTE",2,self.cnvtxt(addr.get_note()))
|
||||
for srcref in addr.get_source_references():
|
||||
@ -1009,7 +1007,7 @@ class GedcomWriter:
|
||||
while ll > 0:
|
||||
brkpt = 70
|
||||
if ll > brkpt:
|
||||
while (ll > brkpt and line[brkpt] in string.whitespace):
|
||||
while (ll > brkpt and line[brkpt].isspace()):
|
||||
brkpt = brkpt+1
|
||||
if ll == brkpt:
|
||||
self.writeln("%s %s" % (prefix,line))
|
||||
@ -1038,7 +1036,7 @@ class GedcomWriter:
|
||||
while ll > 0:
|
||||
brkpt = 70
|
||||
if ll > brkpt:
|
||||
while (ll > brkpt and line[brkpt] not in string.whitespace):
|
||||
while (ll > brkpt and not line[brkpt].isspace()):
|
||||
brkpt = brkpt+1
|
||||
if ll == brkpt:
|
||||
self.writeln("%s %s" % (prefix,line))
|
||||
@ -1061,7 +1059,7 @@ class GedcomWriter:
|
||||
self.print_date("2 DATE",dateobj)
|
||||
if event.get_place_handle():
|
||||
place_name = self.db.get_place_from_handle(event.get_place_handle()).get_title()
|
||||
self.writeln("2 PLAC %s" % string.replace(self.cnvtxt(place_name),'\r',' '))
|
||||
self.writeln("2 PLAC %s" % self.cnvtxt(place_name).replace('\r',' '))
|
||||
if event.get_cause():
|
||||
self.writeln("2 CAUS %s" % self.cnvtxt(event.get_cause()))
|
||||
if event.get_note():
|
||||
@ -1081,7 +1079,7 @@ class GedcomWriter:
|
||||
self.writeln('%d TEMP %s' % (index+1,ord.get_temple()))
|
||||
if ord.get_place_handle():
|
||||
place_name = self.db.get_place_from_handle(ord.get_place_handle()).get_title()
|
||||
self.writeln("2 PLAC %s" % string.replace(self.cnvtxt(place_name),'\r',' '))
|
||||
self.writeln("2 PLAC %s" % self.cnvtxt(place_name).replace('\r',' '))
|
||||
if ord.get_status() != 0:
|
||||
self.writeln("2 STAT %s" % self.cnvtxt(statlist[ord.get_status()]))
|
||||
if ord.get_note():
|
||||
@ -1189,8 +1187,8 @@ class GedcomWriter:
|
||||
ref_text = ref.get_text()
|
||||
self.write_long_text("TEXT",level+1,self.cnvtxt(ref_text))
|
||||
|
||||
if ref.get_comments():
|
||||
self.write_long_text("NOTE",level+1,self.cnvtxt(ref.get_comments()))
|
||||
if ref.get_note():
|
||||
self.write_long_text("NOTE",level+1,self.cnvtxt(ref.get_note()))
|
||||
|
||||
def fid(self,id):
|
||||
family = self.db.get_family_from_handle (id)
|
||||
|
@ -539,7 +539,7 @@ class XmlWriter:
|
||||
source = self.db.get_source_from_handle(source_ref.get_base_handle())
|
||||
if source:
|
||||
p = source_ref.get_page()
|
||||
c = source_ref.get_comments()
|
||||
c = source_ref.get_note()
|
||||
t = source_ref.get_text()
|
||||
d = source_ref.get_date_object()
|
||||
q = source_ref.get_confidence_level()
|
||||
|
@ -624,7 +624,7 @@ class ComprehensiveAncestorsReport (Report.Report):
|
||||
ind = len (self.sources)
|
||||
|
||||
citation += "[%d" % ind
|
||||
comments = ref.get_comments ()
|
||||
comments = ref.get_note ()
|
||||
if comments and comments.find ('\n') == -1:
|
||||
citation += " - %s" % comments.rstrip ('.')
|
||||
|
||||
|
@ -164,7 +164,7 @@ class FtmAncestorReport(Report.Report):
|
||||
self.doc.write_text(' ')
|
||||
self.doc.write_text(item)
|
||||
|
||||
item = srcref.get_comments()
|
||||
item = srcref.get_note()
|
||||
if item:
|
||||
self.doc.write_text('; ')
|
||||
self.doc.write_text(_('Comments:'))
|
||||
|
@ -194,7 +194,7 @@ class FtmDescendantReport(Report.Report):
|
||||
self.doc.write_text(' ')
|
||||
self.doc.write_text(item)
|
||||
|
||||
item = srcref.get_comments()
|
||||
item = srcref.get_note()
|
||||
if item:
|
||||
self.doc.write_text('; ')
|
||||
self.doc.write_text(_('Comments:'))
|
||||
|
@ -72,7 +72,7 @@ _css = [
|
||||
'TD {\nvertical-align: top;\n}',
|
||||
'H1 {',
|
||||
'font-family: "Verdana", "Bistream Vera Sans", "Arial", "Helvetica", sans-serif;',
|
||||
'font-weight: bolder;\nfont-size: 160%;\nmargin: 2px;\n}\n',
|
||||
'font-weight: bolder;\nfont-size: 160%;\nmargin: 2px;\n}\n',
|
||||
'H2 {',
|
||||
'font-family: "Verdana", "Bistream Vera Sans", "Arial", "Helvetica", sans-serif;',
|
||||
'font-weight: bolder;\nfont-style: italic;\nfont-size: 150%;\n}',
|
||||
@ -82,7 +82,7 @@ _css = [
|
||||
'padding-left: 4px;\nbackground-color: #667;\ncolor: #fff;\n}',
|
||||
'H5 {\nmargin-bottom: 0.5em;\n}',
|
||||
'H6 {\nfont-weight: normal;\nfont-style: italic;',
|
||||
'font-size: 100%;\nmargin-left: 1em;\nmargin-top: 1.3em;',
|
||||
'font-size: 100%;\nmargin-left: 1em;\nmargin-top: 1.3em;',
|
||||
'margin-bottom: 0.8em;\n}',
|
||||
'HR {\nheight: 0;\nwidth: 0;\nmargin: 0;\nmargin-top: 1px;',
|
||||
'margin-bottom: 1px;\npadding: 0;\nborder-top: 0;',
|
||||
@ -132,10 +132,10 @@ class BasePage:
|
||||
return text.replace(' ','%20')
|
||||
|
||||
def display_footer(self,of):
|
||||
of.write('<br>\n')
|
||||
of.write('<br>\n')
|
||||
of.write('<hr>\n')
|
||||
of.write('<div class="footer">Generated by ')
|
||||
of.write('<br>\n')
|
||||
of.write('<br>\n')
|
||||
of.write('<hr>\n')
|
||||
of.write('<div class="footer">Generated by ')
|
||||
of.write('<a href="http://gramps.sourceforge.net">GRAMPS</a> ')
|
||||
of.write('on 13 December 2004.')
|
||||
of.write('</div>\n')
|
||||
@ -146,15 +146,15 @@ class BasePage:
|
||||
of.write('<!DOCTYPE HTML PUBLIC ')
|
||||
of.write('"-//W3C//DTD HTML 4.01 Transitional//EN">\n')
|
||||
of.write('<html>\n<head>\n')
|
||||
of.write('<title>%s</title>\n' % self.title_str)
|
||||
of.write('<meta http-equiv="Content-Type" content="text/html; ')
|
||||
of.write('<title>%s</title>\n' % self.title_str)
|
||||
of.write('<meta http-equiv="Content-Type" content="text/html; ')
|
||||
of.write('charset=ISO-8859-1">\n')
|
||||
of.write('<link href="%s" ' % _NARRATIVE)
|
||||
of.write('<link href="%s" ' % _NARRATIVE)
|
||||
of.write('rel="stylesheet" type="text/css">\n')
|
||||
of.write('<link href="favicon.png" rel="Shortcut Icon">\n')
|
||||
of.write('<link href="favicon.png" rel="Shortcut Icon">\n')
|
||||
of.write('</head>\n')
|
||||
of.write('<body>\n')
|
||||
of.write('<div class="navheader">\n')
|
||||
of.write('<div class="navheader">\n')
|
||||
of.write(' <div class="navbyline">By: %s</div>\n' % author)
|
||||
of.write(' <h1 class="navtitle">%s</h1>\n' % self.title_str)
|
||||
of.write(' <hr>\n')
|
||||
@ -168,7 +168,7 @@ class BasePage:
|
||||
of.write(' <a href="download.html">Download</a> \n')
|
||||
of.write(' <a href="contact.html">Contact</a> \n')
|
||||
of.write(' </div>\n')
|
||||
of.write(' </div>\n')
|
||||
of.write(' </div>\n')
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -185,12 +185,12 @@ class IndividualListPage(BasePage):
|
||||
self.display_header(of,_('Individuals'),
|
||||
db.get_researcher().get_name())
|
||||
|
||||
of.write('<h3>%s</h3>\n' % _('Individuals'))
|
||||
of.write('<h3>%s</h3>\n' % _('Individuals'))
|
||||
of.write('<p>%s</p>\n' % _('Index of individuals, sorted by last name.'))
|
||||
of.write('<blockquote>\n')
|
||||
of.write('<table class="infolist" cellspacing="0" ')
|
||||
of.write('<blockquote>\n')
|
||||
of.write('<table class="infolist" cellspacing="0" ')
|
||||
of.write('cellpadding="0" border="0">\n')
|
||||
of.write('<tr><td class="field"><u><b>%s</b></u></td>\n' % _('Surname'))
|
||||
of.write('<tr><td class="field"><u><b>%s</b></u></td>\n' % _('Surname'))
|
||||
of.write('<td class="field"><u><b>%s</b></u></td>\n' % _('Name'))
|
||||
of.write('</tr>\n')
|
||||
|
||||
@ -234,14 +234,14 @@ class PlaceListPage(BasePage):
|
||||
self.display_header(of,_('Places'),
|
||||
db.get_researcher().get_name())
|
||||
|
||||
of.write('<h3>%s</h3>\n' % _('Places'))
|
||||
of.write('<h3>%s</h3>\n' % _('Places'))
|
||||
of.write('<p>%s</p>\n' % _('Index of all the places in the '
|
||||
'project.'))
|
||||
|
||||
of.write('<blockquote>\n')
|
||||
of.write('<table class="infolist" cellspacing="0" ')
|
||||
of.write('<blockquote>\n')
|
||||
of.write('<table class="infolist" cellspacing="0" ')
|
||||
of.write('cellpadding="0" border="0">\n')
|
||||
of.write('<tr><td class="field"><u>')
|
||||
of.write('<tr><td class="field"><u>')
|
||||
of.write('<b>%s</b></u></td>\n' % _('Letter'))
|
||||
of.write('<td class="field"><u>')
|
||||
of.write('<b>%s</b></u></td>\n' % _('Place'))
|
||||
@ -297,16 +297,16 @@ class SurnameListPage(BasePage):
|
||||
self.display_header(of,_('Surnames'),
|
||||
db.get_researcher().get_name())
|
||||
|
||||
of.write('<h3>%s</h3>\n' % _('Surnames'))
|
||||
of.write('<h3>%s</h3>\n' % _('Surnames'))
|
||||
of.write('<p>%s</p>\n' % _('Index of all the surnames in the '
|
||||
'project. The links lead to a list '
|
||||
'of individuals in the database with '
|
||||
'this same surname.'))
|
||||
|
||||
of.write('<blockquote>\n')
|
||||
of.write('<table class="infolist" cellspacing="0" ')
|
||||
of.write('<blockquote>\n')
|
||||
of.write('<table class="infolist" cellspacing="0" ')
|
||||
of.write('cellpadding="0" border="0">\n')
|
||||
of.write('<tr><td class="field"><u>')
|
||||
of.write('<tr><td class="field"><u>')
|
||||
of.write('<b>%s</b></u></td>\n' % _('Letter'))
|
||||
of.write('<td class="field"><u>')
|
||||
of.write('<b>%s</b></u></td>\n' % _('Surname'))
|
||||
@ -359,7 +359,7 @@ class IntroductionPage(BasePage):
|
||||
self.display_header(of,_('Introduction'),
|
||||
db.get_researcher().get_name())
|
||||
|
||||
of.write('<h3>%s</h3>\n' % _('Introduction'))
|
||||
of.write('<h3>%s</h3>\n' % _('Introduction'))
|
||||
|
||||
if note_id:
|
||||
obj = db.get_object_from_gramps_id(note_id)
|
||||
@ -393,7 +393,7 @@ class HomePage(BasePage):
|
||||
self.display_header(of,_('Home'),
|
||||
db.get_researcher().get_name())
|
||||
|
||||
of.write('<h3>%s</h3>\n' % _('Home'))
|
||||
of.write('<h3>%s</h3>\n' % _('Home'))
|
||||
|
||||
if note_id:
|
||||
obj = db.get_object_from_gramps_id(note_id)
|
||||
@ -440,8 +440,8 @@ class SourcesPage(BasePage):
|
||||
|
||||
handle_list = list(handle_set)
|
||||
|
||||
of.write('<h3>%s</h3>\n<p>' % _('Sources'))
|
||||
of.write(_('All sources cited in the project.'))
|
||||
of.write('<h3>%s</h3>\n<p>' % _('Sources'))
|
||||
of.write(_('All sources cited in the project.'))
|
||||
of.write('</p>\n<blockquote>\n<table class="infolist">\n')
|
||||
|
||||
index = 1
|
||||
@ -470,7 +470,7 @@ class DownloadPage(BasePage):
|
||||
self.display_header(of,_('Download'),
|
||||
db.get_researcher().get_name())
|
||||
|
||||
of.write('<h3>%s</h3>\n' % _('Download'))
|
||||
of.write('<h3>%s</h3>\n' % _('Download'))
|
||||
|
||||
self.display_footer(of)
|
||||
of.close()
|
||||
@ -490,7 +490,7 @@ class ContactPage(BasePage):
|
||||
self.display_header(of,_('Contact'),
|
||||
db.get_researcher().get_name())
|
||||
|
||||
of.write('<h3>%s</h3>\n' % _('Contact'))
|
||||
of.write('<h3>%s</h3>\n' % _('Contact'))
|
||||
|
||||
self.display_footer(of)
|
||||
of.close()
|
||||
@ -536,9 +536,9 @@ class IndividualPage(BasePage):
|
||||
sreflist = self.person.get_source_references()
|
||||
if not sreflist:
|
||||
return
|
||||
of.write('<h4>%s</h4>\n' % _('Sources'))
|
||||
of.write('<hr>\n')
|
||||
of.write('<table class="infolist" cellpadding="0" ')
|
||||
of.write('<h4>%s</h4>\n' % _('Sources'))
|
||||
of.write('<hr>\n')
|
||||
of.write('<table class="infolist" cellpadding="0" ')
|
||||
of.write('cellspacing="0" border="0">\n')
|
||||
|
||||
index = 1
|
||||
@ -562,7 +562,7 @@ class IndividualPage(BasePage):
|
||||
values.append(date)
|
||||
of.write(', '.join(values))
|
||||
of.write('</td></tr>\n')
|
||||
of.write('</table>\n')
|
||||
of.write('</table>\n')
|
||||
|
||||
def display_ind_pedigree(self,of):
|
||||
|
||||
@ -580,8 +580,8 @@ class IndividualPage(BasePage):
|
||||
mother = None
|
||||
|
||||
of.write('<h4>%s</h4>\n' % _('Pedigree'))
|
||||
of.write('<hr>\n<br>\n')
|
||||
of.write('<table class="pedigree">\n')
|
||||
of.write('<hr>\n<br>\n')
|
||||
of.write('<table class="pedigree">\n')
|
||||
of.write('<tr><td>\n')
|
||||
if father or mother:
|
||||
of.write('<blockquote class="pedigreeind">\n')
|
||||
@ -622,7 +622,7 @@ class IndividualPage(BasePage):
|
||||
of.write('height="100"></a>')
|
||||
of.write('</div>\n')
|
||||
|
||||
of.write('<div class="summaryarea">\n')
|
||||
of.write('<div class="summaryarea">\n')
|
||||
of.write('<h3>%s</h3>\n' % self.sort_name)
|
||||
of.write('<table class="infolist" cellpadding="0" cellspacing="0" ')
|
||||
of.write('border="0">\n')
|
||||
@ -650,12 +650,12 @@ class IndividualPage(BasePage):
|
||||
of.write('</tr>\n')
|
||||
|
||||
of.write('</table>\n')
|
||||
of.write('</div>\n')
|
||||
of.write('</div>\n')
|
||||
|
||||
def display_ind_events(self,of):
|
||||
of.write('<h4>%s</h4>\n' % _('Events'))
|
||||
of.write('<hr>\n')
|
||||
of.write('<table class="infolist" cellpadding="0" cellspacing="0" ')
|
||||
of.write('<h4>%s</h4>\n' % _('Events'))
|
||||
of.write('<hr>\n')
|
||||
of.write('<table class="infolist" cellpadding="0" cellspacing="0" ')
|
||||
of.write('border="0">\n')
|
||||
|
||||
for event_id in self.person.get_event_list():
|
||||
@ -667,11 +667,11 @@ class IndividualPage(BasePage):
|
||||
of.write('</td>\n')
|
||||
of.write('</tr>\n')
|
||||
|
||||
of.write('</table>\n')
|
||||
of.write('</table>\n')
|
||||
|
||||
def display_ind_narrative(self,of):
|
||||
of.write('<h4>%s</h4>\n' % _('Narrative'))
|
||||
of.write('<hr>\n')
|
||||
of.write('<h4>%s</h4>\n' % _('Narrative'))
|
||||
of.write('<hr>\n')
|
||||
|
||||
noteobj = self.person.get_note_object()
|
||||
if noteobj:
|
||||
@ -703,9 +703,9 @@ class IndividualPage(BasePage):
|
||||
if not parent_list and not family_list:
|
||||
return
|
||||
|
||||
of.write('<h4>%s</h4>\n' % _("Relationships"))
|
||||
of.write('<hr>\n')
|
||||
of.write('<table class="infolist" cellpadding="0" ')
|
||||
of.write('<h4>%s</h4>\n' % _("Relationships"))
|
||||
of.write('<hr>\n')
|
||||
of.write('<table class="infolist" cellpadding="0" ')
|
||||
of.write('cellspacing="0" border="0">\n')
|
||||
|
||||
if parent_list:
|
||||
@ -747,7 +747,7 @@ class IndividualPage(BasePage):
|
||||
of.write('</a>\n')
|
||||
of.write("<br>\n")
|
||||
of.write('</td>\n</tr>\n')
|
||||
of.write('</table>\n')
|
||||
of.write('</table>\n')
|
||||
|
||||
def display_spouse(self,of,family,first=True):
|
||||
gender = self.person.get_gender()
|
||||
|
@ -421,7 +421,7 @@ class ScratchPadWindow:
|
||||
_("Title"),escape(base.get_title()),
|
||||
_("Page"), escape(srcref.get_page()),
|
||||
_("Text"), escape(srcref.get_text()),
|
||||
_("Comment"), escape(srcref.get_comments()))
|
||||
_("Comment"), escape(srcref.get_note()))
|
||||
|
||||
return s
|
||||
|
||||
|
@ -237,7 +237,7 @@ class IndividualPage:
|
||||
self.write_info(sref.get_page())
|
||||
if self.usecomments:
|
||||
self.write_info(sref.get_text())
|
||||
self.write_info(sref.get_comments())
|
||||
self.write_info(sref.get_note())
|
||||
self.doc.end_paragraph()
|
||||
|
||||
def write_info(self,info):
|
||||
|
Loading…
Reference in New Issue
Block a user