From fc8a94c7aac56886d87a6b02fdc7708dde06ebbf Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 14 Jul 2005 17:49:48 +0000 Subject: [PATCH] * src/plugins/NavWebPage.py: wrap content with div, fix encoding problems svn: r4929 --- gramps2/ChangeLog | 3 + gramps2/src/plugins/NavWebPage.py | 523 +++++++++++++++--------------- 2 files changed, 272 insertions(+), 254 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 2002c169a..dce272090 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-07-14 Don Allingham + * src/plugins/NavWebPage.py: wrap content with div, fix encoding problems + 2005-07-13 Don Allingham * src/Sort.py: don't use upper case, let locale.strcoll figure this out (correctly) for us diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index e8fcd0cb7..ced5585b4 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -128,11 +128,11 @@ class BasePage: def create_file(self,name): if self.archive: self.string_io = StringIO() - of = codecs.EncodedFile(self.string_io,self.encoding) + of = codecs.EncodedFile(self.string_io,'utf-8',self.encoding) self.cur_name = name + "." + self.ext else: page_name = os.path.join(self.html_dir,name + "." + self.ext) - of = codecs.EncodedFile(open(page_name, "w"),self.encoding) + of = codecs.EncodedFile(open(page_name, "w"),'utf-8',self.encoding) return of def close_file(self,of): @@ -152,51 +152,53 @@ class BasePage: msg = _('Generated by ' 'GRAMPS on %(date)s' % { 'date' : value }) - - of.write(u'


\n') - of.write(u'\n' % msg) - of.write(u'\n') - of.write(u'\n') + + of.write('\n') + of.write('\n' % msg) + of.write('


\n') + of.write('\n') + of.write('\n') def display_header(self,of,title,author=""): if author: author = author.replace(',,,','') year = time.localtime(time.time())[0] - cright = _(u'Copyright © %(person)s %(year)d') % { + cright = _('Copyright © %(person)s %(year)d') % { 'person' : author, 'year' : year } - of.write(u'\n') - of.write(u'\n\n') - of.write(u'%s\n' % self.title_str) - of.write(u'\n' % self.encoding) - of.write(u'\n') - of.write(u'\n') - of.write(u'\n') - of.write(u'\n') - of.write(u'\n') + of.write('
\n') #------------------------------------------------------------------------ # @@ -216,14 +218,14 @@ class IndividualListPage(BasePage): "database, sorted by their last names. Selecting person's name " "will take you to that person's individual page.") - of.write(u'

%s

\n' % _('Individuals')) - of.write(u'

%s

\n' % msg) - of.write(u'
\n') - of.write(u'\n') - of.write(u'\n' % _('Surname')) - of.write(u'\n' % _('Name')) - of.write(u'\n') + of.write('

%s

\n' % _('Individuals')) + of.write('

%s

\n' % msg) + of.write('
\n') + of.write('
%s%s
\n') + of.write('\n' % _('Surname')) + of.write('\n' % _('Name')) + of.write('\n') flist = sets.Set(person_handle_list) @@ -231,23 +233,23 @@ class IndividualListPage(BasePage): for (surname,handle_list) in person_handle_list: first = True - of.write(u'\n') + of.write('\n') for person_handle in handle_list: person = db.get_person_from_handle(person_handle) - of.write(u'\n') + of.write('\n') first = False - of.write(u'
%s%s
 
 
') + of.write('
') if first: - of.write(u'%s' % (self.lnkfmt(surname),surname)) + of.write('%s' % (self.lnkfmt(surname),surname)) else: - of.write(u' ') - of.write(u'') - of.write(u' ' % (person.handle,self.ext)) + of.write(' ') + of.write('') + of.write(' ' % (person.handle,self.ext)) of.write(person.get_primary_name().get_first_name()) if not self.noid: of.write(u" [%s]" % person.gramps_id) - of.write(u'
\n
\n') + of.write('\n\n') self.display_footer(of) self.close_file(of) @@ -268,17 +270,17 @@ class PlaceListPage(BasePage): "database, sorted by their title. Clicking on a place's " "title will take you to that place's page.") - of.write(u'

%s

\n' % _('Places')) - of.write(u'

%s

\n' % msg ) + of.write('

%s

\n' % _('Places')) + of.write('

%s

\n' % msg ) - of.write(u'
\n') - of.write(u'\n') - of.write(u'\n' % _('Letter')) - of.write(u'\n' % _('Place')) - of.write(u'\n') + of.write('
\n') + of.write('
') - of.write(u'%s') - of.write(u'%s
\n') + of.write('\n' % _('Letter')) + of.write('\n' % _('Place')) + of.write('\n') self.sort = Sort.Sort(db) handle_list = list(place_handles) @@ -295,26 +297,26 @@ class PlaceListPage(BasePage): if n[0] != last_letter: last_letter = n[0] - of.write(u'\n') - of.write(u'' % last_letter) - of.write(u'\n') + of.write('' % last_letter) + of.write('') + of.write(' [%s]' % place.gramps_id) + of.write('') last_surname = n elif n != last_surname: - of.write(u'') - of.write(u'') + of.write('') + of.write(' [%s]' % place.gramps_id) + of.write('') last_surname = n - of.write(u'
') + of.write('%s') + of.write('%s
 
%s') - of.write(u'' % (place.handle,self.ext)) + of.write('
 
%s') + of.write('' % (place.handle,self.ext)) of.write(n) if not self.noid: - of.write(u' [%s]' % place.gramps_id) - of.write(u'
 ') - of.write(u'' % (place.handle,self.ext)) + of.write('
 ') + of.write('' % (place.handle,self.ext)) of.write(n) if not self.noid: - of.write(u' [%s]' % place.gramps_id) - of.write(u'
\n
\n') + of.write('\n\n') self.display_footer(of) self.close_file(of) @@ -333,14 +335,14 @@ class PlacePage(BasePage): self.display_header(of,place_name, db.get_researcher().get_name()) - of.write(u'
\n') - of.write(u'

%s

\n' % place_name) - of.write(u'\n') + of.write('
\n') + of.write('

%s

\n' % place_name) + of.write('
\n') - of.write(u'\n' % _('GRAMPS ID')) - of.write(u'\n' % place.gramps_id) - of.write(u'\n') + of.write('\n' % _('GRAMPS ID')) + of.write('\n' % place.gramps_id) + of.write('\n') if place.main_loc: ml = place.main_loc @@ -348,22 +350,22 @@ class PlacePage(BasePage): (_('County'),ml.county),(_('State/Province'),ml.state), (_('Postal Code'),ml.postal),(_('Country'),ml.country)]: if val[1]: - of.write(u'\n' % val[0]) - of.write(u'\n' % val[1]) - of.write(u'\n') + of.write('\n' % val[0]) + of.write('\n' % val[1]) + of.write('\n') if place.long: - of.write(u'\n' % _('Longitude')) - of.write(u'\n' % place.long) - of.write(u'\n') + of.write('\n' % _('Longitude')) + of.write('\n' % place.long) + of.write('\n') if place.lat: - of.write(u'\n' % _('Latitude')) - of.write(u'\n' % place.lat) - of.write(u'\n') + of.write('\n' % _('Latitude')) + of.write('\n' % place.lat) + of.write('\n') - of.write(u'
%s%s
%s%s
%s%s
%s%s
%s%s
%s%s
%s%s
%s%s
\n') - of.write(u'
\n') + of.write('\n') + of.write('
\n') photolist = place.get_media_list() if photolist: @@ -372,11 +374,11 @@ class PlacePage(BasePage): try: newpath = self.copy_media(photo) - of.write(u'
\n') - of.write(u'' % newpath) - of.write(u'') - of.write(u'
\n') + of.write('
\n') + of.write('' % newpath) + of.write('') + of.write('
\n') except (IOError,OSError),msg: ErrorDialog(str(msg)) @@ -393,7 +395,7 @@ class PlacePage(BasePage): text = u"
" + u"
".join(text.split("\n")) else: text = u"

".join(text.split("\n")) - of.write(u'

%s

\n' % text) + of.write('

%s

\n' % text) self.display_footer(of) self.close_file(of) @@ -411,21 +413,21 @@ class SurnameListPage(BasePage): self.display_header(of,_('Surnames'), db.get_researcher().get_name()) - of.write(u'

%s

\n' % _('Surnames')) - of.write(u'

%s

\n' % _( + of.write('

%s

\n' % _('Surnames')) + of.write('

%s

\n' % _( 'This page contains an index of all the ' 'surnames in the database. Selecting a link ' 'will lead to a list of individuals in the ' 'database with this same surname.')) - of.write(u'
\n') - of.write(u'\n') - of.write(u'\n' % _('Letter')) - of.write(u'\n' % _('Surname')) - of.write(u'\n') + of.write('
\n') + of.write('
') - of.write(u'%s') - of.write(u'%s
\n') + of.write('\n' % _('Letter')) + of.write('\n' % _('Surname')) + of.write('\n') person_handle_list = sort_people(db,person_handle_list) last_letter = '' @@ -437,20 +439,20 @@ class SurnameListPage(BasePage): if surname[0] != last_letter: last_letter = surname[0] - of.write(u'' % last_letter) - of.write(u'' % last_letter) + of.write('') + of.write('') elif surname != last_surname: - of.write(u'') - of.write(u'') + of.write('') + of.write('') last_surname = surname - of.write(u'
') + of.write('%s') + of.write('%s
%s') - of.write(u'' % (self.ext,self.lnkfmt(surname))) + of.write('
%s') + of.write('' % (self.ext,self.lnkfmt(surname))) of.write(surname) - of.write(u'
 ') - of.write(u'' % (self.ext,self.lnkfmt(surname))) + of.write('
 ') + of.write('' % (self.ext,self.lnkfmt(surname))) of.write(surname) - of.write(u'
\n
\n') + of.write('\n\n') self.display_footer(of) self.close_file(of) return @@ -470,19 +472,32 @@ class IntroductionPage(BasePage): self.display_header(of,_('Introduction'), db.get_researcher().get_name()) - of.write(u'

%s

\n' % _('Introduction')) + of.write('

%s

\n' % _('Introduction')) if note_id: - obj = db.get_object_from_gramps_id(note_id) + obj = db.get_object_from_handle(note_id) + if obj: + mime_type = obj.get_mime_type() + if mime_type and mime_type.startswith("image"): + try: + newpath = self.copy_media(obj) + of.write('
\n') + of.write('' % newpath) + of.write('
\n') + except (IOError,OSError),msg: + ErrorDialog(str(msg)) + note_obj = obj.get_note_object() - text = note_obj.get() - if note_obj.get_format(): - of.write(u'
\n%s\n
\n' % text) - else: - of.write(u'

') - of.write(u'

'.join(text.split('\n'))) - of.write(u'

') + if note_obj: + text = note_obj.get() + if note_obj.get_format(): + of.write('
\n%s\n
\n' % text) + else: + of.write('

') + of.write('

'.join(text.split('\n'))) + of.write('

') self.display_footer(of) self.close_file(of) @@ -512,22 +527,22 @@ class HomePage(BasePage): if mime_type and mime_type.startswith("image"): try: newpath = self.copy_media(obj) - of.write(u'
\n') - of.write(u'' % newpath) - of.write(u'
\n') + of.write('
\n') + of.write('' % newpath) + of.write('
\n') except (IOError,OSError),msg: ErrorDialog(str(msg)) - + note_obj = obj.get_note_object() if note_obj: text = note_obj.get() if note_obj.get_format(): - of.write(u'
\n%s\n
\n' % text) + of.write('
\n%s\n
\n' % text) else: - of.write(u'

') - of.write(u'

'.join(text.split('\n'))) - of.write(u'

') + of.write('

') + of.write('

'.join(text.split('\n'))) + of.write('

') self.display_footer(of) self.close_file(of) @@ -548,20 +563,20 @@ class SourcesPage(BasePage): handle_list = list(handle_set) - of.write(u'

%s

\n

' % _('Sources')) + of.write('

%s

\n

' % _('Sources')) of.write(_('All sources cited in the project.')) - of.write(u'

\n
\n\n') + of.write('

\n
\n
\n') index = 1 for handle in handle_list: source = db.get_source_from_handle(handle) - of.write(u'\n' % index) - of.write(u'\n' % index) + of.write('\n') + of.write('\n') index += 1 - of.write(u'
%d.') + of.write('
%d.') of.write(source.get_title()) - of.write(u'
\n
\n') + of.write('\n
\n') self.display_footer(of) self.close_file(of) @@ -580,7 +595,7 @@ class DownloadPage(BasePage): self.display_header(of,_('Download'), db.get_researcher().get_name()) - of.write(u'

%s

\n' % _('Download')) + of.write('

%s

\n' % _('Download')) self.display_footer(of) self.close_file(of) @@ -599,8 +614,8 @@ class ContactPage(BasePage): self.display_header(of,_('Contact'), db.get_researcher().get_name()) - of.write(u'
\n') - of.write(u'

%s

\n' % _('Contact')) + of.write('
\n') + of.write('

%s

\n' % _('Contact')) note_id = options.handler.options_dict['NWEBcontact'] obj = db.get_object_from_handle(note_id) @@ -609,25 +624,25 @@ class ContactPage(BasePage): if mime_type and mime_type.startswith("image"): try: newpath = self.copy_media(obj) - of.write(u'
\n') - of.write(u'') - of.write(u'
') - of.write(u'' % newpath) - of.write(u'
\n') - of.write(u'
\n') + of.write('
\n') + of.write('') + of.write('
') + of.write('' % newpath) + of.write('
\n') + of.write('
\n') except (IOError,OSError),msg: ErrorDialog(str(msg)) r = db.get_researcher() - of.write(u'
\n') - of.write(u'%s
\n' % r.name) - of.write(u'%s
\n' % r.addr) - of.write(u'%s, %s, %s
\n' % (r.city,r.state,r.postal)) - of.write(u'%s
\n' % r.country) - of.write(u'%s
\n' % r.email) - of.write(u'
\n') + of.write('
\n') + of.write('%s
\n' % r.name) + of.write('%s
\n' % r.addr) + of.write('%s, %s, %s
\n' % (r.city,r.state,r.postal)) + of.write('%s
\n' % r.country) + of.write('%s
\n' % r.email) + of.write('
\n') nobj = obj.get_note_object() if nobj: @@ -638,9 +653,9 @@ class ContactPage(BasePage): text = u"
" + u"
".join(text.split("\n")) else: text = u"

".join(text.split("\n")) - of.write(u'

%s

\n' % text) + of.write('

%s

\n' % text) else: - of.write(u'



\n') + of.write('



\n') self.display_footer(of) self.close_file(of) @@ -685,10 +700,10 @@ class IndividualPage(BasePage): sreflist = self.person.get_source_references() if not sreflist: return - of.write(u'

%s

\n' % _('Sources')) - of.write(u'
\n') - of.write(u'\n') + of.write('

%s

\n' % _('Sources')) + of.write('
\n') + of.write('
\n') index = 1 for sref in sreflist: @@ -699,7 +714,7 @@ class IndividualPage(BasePage): title = source.get_title() publisher = source.get_publication_info() date = _dd.display(sref.get_date_object()) - of.write(u'\n') - of.write(u'
%d. ' % index) + of.write('
%d. ' % index) values = [] if author: values.append(author) @@ -709,9 +724,9 @@ class IndividualPage(BasePage): values.append(publisher) if date: values.append(date) - of.write(u', '.join(values)) - of.write(u'
\n') + of.write(', '.join(values)) + of.write('\n') + of.write('\n') def display_ind_pedigree(self,of): @@ -728,33 +743,33 @@ class IndividualPage(BasePage): father = None mother = None - of.write(u'

%s

\n' % _('Pedigree')) - of.write(u'
\n
\n') - of.write(u'\n') - of.write(u'\n\n
\n') + of.write('

%s

\n' % _('Pedigree')) + of.write('
\n
\n') + of.write('\n') + of.write('\n\n
\n') if father or mother: - of.write(u'
\n') + of.write('
\n') if father: self.pedigree_person(of,father) if mother: self.pedigree_person(of,mother) - of.write(u'
\n') + of.write('
\n') if family: for child_handle in family.get_child_handle_list(): if child_handle == self.person.handle: - of.write(u'| %s
\n' % self.name) + of.write('| %s
\n' % self.name) self.pedigree_family(of) else: child = self.db.get_person_from_handle(child_handle) self.pedigree_person(of,child) else: - of.write(u'| %s
\n' % self.name) + of.write('| %s
\n' % self.name) self.pedigree_family(of) - of.write(u'
\n') + of.write('
\n') if father or mother: - of.write(u'
\n') - of.write(u'
\n') + of.write('\n') + of.write('
\n') def display_ind_general(self,of): photolist = self.person.get_media_list() @@ -764,72 +779,72 @@ class IndividualPage(BasePage): try: newpath = self.copy_media(photo) - of.write(u'
\n') - of.write(u'' % newpath) - of.write(u'') - of.write(u'
\n') + of.write('
\n') + of.write('' % newpath) + of.write('') + of.write('
\n') except (IOError,OSError),msg: ErrorDialog(str(msg)) - of.write(u'
\n') - of.write(u'

%s

\n' % self.sort_name) - of.write(u'\n') + of.write('
\n') + of.write('

%s

\n' % self.sort_name) + of.write('
\n') - of.write(u'\n' % _('GRAMPS ID')) - of.write(u'\n' % self.person.gramps_id) - of.write(u'\n') + of.write('\n' % _('GRAMPS ID')) + of.write('\n' % self.person.gramps_id) + of.write('\n') # Gender - of.write(u'\n' % _('Gender')) + of.write('\n' % _('Gender')) gender = self.gender_map[self.person.gender] - of.write(u'\n' % gender) - of.write(u'\n') + of.write('\n' % gender) + of.write('\n') # Birth handle = self.person.get_birth_handle() if handle: event = self.db.get_event_from_handle(handle) - of.write(u'\n' % _('Birth')) - of.write(u'\n' % self.format_event(event)) - of.write(u'\n') + of.write('\n' % _('Birth')) + of.write('\n' % self.format_event(event)) + of.write('\n') # Death handle = self.person.get_death_handle() if handle: event = self.db.get_event_from_handle(handle) - of.write(u'\n' % _('Death')) - of.write(u'\n' % self.format_event(event)) - of.write(u'\n') + of.write('\n' % _('Death')) + of.write('\n' % self.format_event(event)) + of.write('\n') - of.write(u'
%s%s
%s%s
%s
%s%s
%s
%s%s
%s%s
%s%s
%s%s
\n') - of.write(u'
\n') + of.write('\n') + of.write('
\n') def display_ind_events(self,of): if len(self.person.get_event_list()) == 0: return - of.write(u'

%s

\n' % _('Events')) - of.write(u'
\n') - of.write(u'\n') + of.write('

%s

\n' % _('Events')) + of.write('
\n') + of.write('
\n') for event_id in self.person.get_event_list(): event = self.db.get_event_from_handle(event_id) - of.write(u'\n' % event.get_name()) - of.write(u'\n' % event.get_name()) + of.write('\n') - of.write(u'\n') - of.write(u'
%s\n') + of.write('
%s\n') of.write(self.format_event(event)) - of.write(u'
\n') + of.write('\n') + of.write('\n') + of.write('\n') def display_ind_narrative(self,of): noteobj = self.person.get_note_object() if noteobj: - of.write(u'

%s

\n' % _('Narrative')) - of.write(u'
\n') + of.write('

%s

\n' % _('Narrative')) + of.write('
\n') format = noteobj.get_format() text = noteobj.get() @@ -837,23 +852,23 @@ class IndividualPage(BasePage): text = u"
" + u"
".join(text.split("\n")) else: text = u"

".join(text.split("\n")) - of.write(u'

%s

\n' % text) + of.write('

%s

\n' % text) def display_parent(self,of,handle,title): use_link = handle in self.ind_list person = self.db.get_person_from_handle(handle) - of.write(u'%s\n' % title) - of.write(u'') + of.write('%s\n' % title) + of.write('') val = person.gramps_id if use_link: of.write('' % (person.handle,self.ext)) of.write(_nd.display(person)) if not self.noid: - of.write(u' [%s]' % (val)) + of.write(' [%s]' % (val)) if use_link: of.write('') - of.write(u'\n') + of.write('\n') def display_ind_relationships(self,of): parent_list = self.person.get_parent_family_handle_list() @@ -862,30 +877,30 @@ class IndividualPage(BasePage): if not parent_list and not family_list: return - of.write(u'

%s

\n' % _("Relationships")) - of.write(u'
\n') - of.write(u'\n') + of.write('

%s

\n' % _("Relationships")) + of.write('
\n') + of.write('
\n') if parent_list: for (family_handle,mrel,frel) in parent_list: family = self.db.get_family_from_handle(family_handle) - of.write(u'\n') - of.write(u'\n' % _("Parents")) + of.write('\n') + of.write('\n' % _("Parents")) father_handle = family.get_father_handle() if father_handle: self.display_parent(of,father_handle,_('Father')) - of.write(u'\n') + of.write('\n') mother_handle = family.get_mother_handle() if mother_handle: self.display_parent(of,mother_handle,_('Mother')) - of.write(u'\n') - of.write(u'\n') + of.write('\n') + of.write('\n') if family_list: - of.write(u'\n' % _("Spouses")) + of.write('\n' % _("Spouses")) first = True for family_handle in family_list: family = self.db.get_family_from_handle(family_handle) @@ -893,23 +908,23 @@ class IndividualPage(BasePage): first = False childlist = family.get_child_handle_list() if childlist: - of.write(u'\n') - of.write(u'\n' % _("Children")) - of.write(u'\n') + of.write('\n' % _("Children")) + of.write('\n\n') - of.write(u'
 
%s
 
%s
 
 
 
 
%s
%s
 %s\n') + of.write('
 %s\n') for child_handle in childlist: use_link = child_handle in self.ind_list child = self.db.get_person_from_handle(child_handle) gid = child.get_gramps_id() if use_link: - of.write(u'' % (child.handle,self.ext)) + of.write('' % (child.handle,self.ext)) of.write(_nd.display(child)) if not self.noid: - of.write(u' [%s]' % gid) + of.write(' [%s]' % gid) if use_link: - of.write(u'\n') + of.write('\n') of.write(u"
\n") - of.write(u'
\n') + of.write('\n\n') + of.write('\n') def display_spouse(self,of,family,first=True): gender = self.person.get_gender() @@ -932,41 +947,41 @@ class IndividualPage(BasePage): else: name = _("unknown") if not first: - of.write(u' \n') - of.write(u' ') - of.write(u'%s\n' % relstr) - of.write(u'') + of.write(' \n') + of.write(' ') + of.write('%s\n' % relstr) + of.write('') if spouse_id: use_link = spouse_id in self.ind_list gid = spouse.get_gramps_id() if use_link: - of.write(u'' % (spouse.handle,self.ext)) + of.write('' % (spouse.handle,self.ext)) of.write(name) if not self.noid: - of.write(u' [%s]' % (gid)) + of.write(' [%s]' % (gid)) if use_link: - of.write(u'') + of.write('') - of.write(u'\n\n') + of.write('\n\n') for event_id in family.get_event_list(): event = self.db.get_event_from_handle(event_id) - of.write(u' \n') - of.write(u'%s\n' % event.get_name()) - of.write(u'\n') + of.write(' \n') + of.write('%s\n' % event.get_name()) + of.write('\n') of.write(self.format_event(event)) - of.write(u'\n\n') + of.write('\n\n') def pedigree_person(self,of,person,bullet='|'): person_link = person.handle in self.ind_list - of.write(u'%s ' % bullet) + of.write('%s ' % bullet) if person_link: - of.write(u'' % (person.handle,self.ext)) + of.write('' % (person.handle,self.ext)) of.write(_nd.display(person)) if person_link: - of.write(u'') - of.write(u'
\n') + of.write('') + of.write('
\n') def pedigree_family(self,of): for family_handle in self.person.get_family_handle_list(): @@ -977,11 +992,11 @@ class IndividualPage(BasePage): self.pedigree_person(of,spouse,'•') childlist = rel_family.get_child_handle_list() if childlist: - of.write(u'
\n') + of.write('
\n') for child_handle in childlist: child = self.db.get_person_from_handle(child_handle) self.pedigree_person(of,child) - of.write(u'
\n') + of.write('
\n') def format_event(self,event): for sref in event.get_source_references(): @@ -1418,10 +1433,10 @@ class WebReportOptions(ReportOptions.ReportOptions): store = gtk.ListStore(str,str) for data in media_list: if data[1] == self.inc_contact: - intro_node = store.append(row=data) + contact_node = store.append(row=data) else: store.append(row=data) - self.contact = GrampsNoteComboBox(store,intro_node) + self.contact = GrampsNoteComboBox(store,contact_node) dialog.add_frame_option(title,_('Home Media/Note ID'), self.home_note)