I tried this and get these errors:

334162: ERROR: gramps.py: line 148: Unhandled exception
Traceback (most recent call last):
  File "/usr/share/gramps/ViewManager.py", line 1180, in <lambda>
    lst[0], lst[1], lst[2], lst[3], lst[4], lst[5])
  File "/usr/share/gramps/ReportBase/_ReportDialog.py", line 671, in report
    report_class(dbstate,uistate,person)
  File "/home/malcolm/.gramps/plugins/firstname.py", line 89, in __init__
    counter = counter + 1
TypeError: cannot concatenate 'str' and 'int' objects

Any suggestions on how to fix this?

Malcolm

On 7/3/07, Jérôme <romjerome@yahoo.fr> wrote:
Louis,


put firstname.py into your ./gramps/plugins
this should appears on "View" reports, try it ;)




Louis Edwards a écrit :
>
> I'm almost embarrased to send this request, since it seems so obvious.
> I tried without success the online documentation, faqs, and the message
> board archives.
>
> I have a baby due in a few months and my wife and I are searching for a
> name.  I would like to make a simple list of all the names in my gramps
> database, but can't seem to figure out how to do this.
>
> Any help is greatly appreciated.
>
> Louis

#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006  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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

"View/List firstnames"

#------------------------------------------------------------------------
#
# standard python modules
#
#------------------------------------------------------------------------
import os
import posixpath
from gettext import gettext as _

#------------------------------------------------------------------------
#
# GNOME/GTK modules
#
#------------------------------------------------------------------------
import gtk.glade

#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
import Sort
import RelLib
from PluginUtils import register_report
from ReportBase import CATEGORY_VIEW, MODE_GUI
import DateHandler
import ManagedWindow

#------------------------------------------------------------------------
#
# Build the text of the report
#
#------------------------------------------------------------------------
def build_report(database,person):

        personList = database.get_person_handles(sort_handles=False)
        text = "List of First Names\n"
        text = text + "--------------------\n\n"
        tmplist = []
        previous = ""
        counter = 1

        for person_handle in personList:

                person = database.get_person_from_handle(person_handle)
                name = person.get_primary_name()
                if not person:
                        continue
                elif not name.get_first_name():
                        continue
                else:
                        tmplist.append(name.get_first_name())

        # all first names in the list now sort it
         tmplist.sort ()

        for firstnames in tmplist:
                if firstnames == previous:
                        counter = counter + 1
                else:
                        text = text + "\t\t" + str(counter) + "\n" + firstnames
                        counter = 1
                previous = firstnames
        text = text + "\t\t" + str(counter) + "\n"

        return text


#------------------------------------------------------------------------
#
# Output report in a window
#
#------------------------------------------------------------------------
class RepoReport(ManagedWindow.ManagedWindow):
    def __init__(self,dbstate,uistate,person):
                self.title = _('Firstnames')
                ManagedWindow.ManagedWindow.__init__(self,uistate,[],self.__class__)

                database = dbstate.db
                text = build_report(database,person)

                base = os.path.dirname(__file__)
                glade_file = "%s/summary.glade" % base

                topDialog = gtk.glade.XML(glade_file,"summary","gramps")
                topDialog.signal_autoconnect({"destroy_passed_object" : self.close,})

                window = topDialog.get_widget("summary")
                self.set_window(window,topDialog.get_widget ('title'),self.title)
                textwindow = topDialog.get_widget("textwindow")
                textwindow.get_buffer().set_text(text)
                self.show()

    def build_menu_names(self,obj):
        return (self.title,None)
#
# Output report in a file
#
#               self.doc.start_bold()
#               self.doc.start_paragraph()
#               self.doc.write_text(_(""))
#               self.doc.end_paragraph()
#               self.doc.end_bold()
#               self.doc.write_text(text)

#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
register_report(
    name = 'firstnames',
    category = CATEGORY_VIEW,
    report_class = RepoReport,
    options_class = None,
    modes = MODE_GUI,
    translated_name = _("firstname"),
    status = _("Alpha"),
    description= _("firstnames"),
    require_active=False,
    )

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Gramps-users mailing list
Gramps-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gramps-users