Esempio n. 1
0
    def __init__(self, database, options, user):
        """
        Create HourGlass object that produces the report.

        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        inc_id        - Whether to include IDs.
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        menu = options.menu

        self.set_locale(menu.get_option_by_name('trans').get_value())

        stdoptions.run_date_format_option(self, menu)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)
        self.database = CacheProxyDb(self.database)
        self.__db = self.database

        self.__used_people = []
        self.__family_father = [] # links allocated from family to father
        self.__family_mother = [] # links allocated from family to mother

        self.__node_label = {} # labels of node for merge sosa number

        self.max_descend = menu.get_option_by_name('maxdescend').get_value()
        self.max_ascend = menu.get_option_by_name('maxascend').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = self.__db.get_person_from_gramps_id(pid)
        if self.center_person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        self.colorize = menu.get_option_by_name('color').get_value()
        self.colors = {'male': menu.get_option_by_name('colormales').get_value(),
            'female': menu.get_option_by_name('colorfemales').get_value(),
            'unknown': menu.get_option_by_name('colorunknown').get_value(),
            'family': menu.get_option_by_name('colorfamilies').get_value()
        }
        self.roundcorners = menu.get_option_by_name('roundcorners').get_value()

        self.ahnentafel = menu.get_option_by_name('ahnentafel').get_value()

        self.ahnentafelnum = menu.get_option_by_name('ahnentafelnum').get_value()

        self.includeid = menu.get_option_by_name('inc_id').get_value()

        arrow_str = menu.get_option_by_name('arrow').get_value()
        if 'o' in arrow_str:
            self.arrowheadstyle = 'normal'
        else:
            self.arrowheadstyle = 'none'
        if 'c' in arrow_str:
            self.arrowtailstyle = 'normal'
        else:
            self.arrowtailstyle = 'none'

        stdoptions.run_name_format_option(self, menu)
Esempio n. 2
0
    def __init__(self, database, options, user):
        """
        Create SimpleBookTitle object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        title     - Title string.
        subtitle  - Subtitle string.
        imgid     - Gramps ID of the media object to use as an image.
        imgsize   - Size for the image.
        footer    - Footer string.
        """
        Report.__init__(self, database, options, user)
        self._user = user

        menu = options.menu
        self.title_string = menu.get_option_by_name("title").get_value()
        self.image_size = menu.get_option_by_name("imgsize").get_value()
        self.subtitle_string = menu.get_option_by_name("subtitle").get_value()
        self.footer_string = menu.get_option_by_name("footer").get_value()
        self.object_id = menu.get_option_by_name("imgid").get_value()
Esempio n. 3
0
    def __init__(self, database, options_class, user):
        """
        Create the Census report.
        
        The arguments are:

        database        - the GRAMPS database instance
        options_class   - instance of the Options class for this report
        user            - a gen.user.User() instance

        The following parameters are defined in the options class:
        
        pid       - Selected person.
        pg_break  - Whether to include page breaks between generations.

        """

        Report.__init__(self, database, options_class, user)

        menu = options_class.menu
        self.pgbrk = menu.get_option_by_name('pg_break').get_value()

        self.report_type = menu.get_option_by_name('report_type').get_value()

        pid = menu.get_option_by_name('pid').get_value()
        self.person = database.get_person_from_gramps_id(pid)
        if (self.person == None) :
            user.notify_error(_("Census Report"),
                              _("Person %s is not in the Database") % pid)

        self.src_handle = menu.get_option_by_name('src_handle').get_value()
Esempio n. 4
0
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu
        mgobn = lambda name:options.menu.get_option_by_name(name).get_value()

        stdoptions.run_private_data_option(self, menu)
        # (this report has its own "living people" option ("alive") already)

        self.titletext = mgobn('titletext')
        self.relationships = mgobn('relationships')
        self.year = mgobn('year')
        self.country = mgobn('country')
        self.anniversaries = mgobn('anniversaries')
        self.start_dow = mgobn('start_dow')
        self.maiden_name = mgobn('maiden_name')
        self.alive = mgobn('alive')
        self.birthdays = mgobn('birthdays')
        self.text1 = mgobn('text1')
        self.text2 = mgobn('text2')
        self.text3 = mgobn('text3')
        self.filter_option =  menu.get_option_by_name('filter')
        self.filter = self.filter_option.get_filter()
        pid = mgobn('pid')

        lang = menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(lang)

        stdoptions.run_name_format_option(self, menu)

        self.center_person = self.database.get_person_from_gramps_id(pid)
        if (self.center_person == None) :
            raise ReportError(_("Person %s is not in the Database") % pid )
Esempio n. 5
0
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)
        menu = options.menu
        self._user = user

        stdoptions.run_private_data_option(self, menu)

        get_value = lambda name: menu.get_option_by_name(name).get_value()
        
        self.year = get_value('year')
        self.name_format = get_value('name_format')
        self.country = get_value('country')
        self.anniversaries = get_value('anniversaries')
        self.start_dow = get_value('start_dow')
        self.maiden_name = get_value('maiden_name')
        self.alive = get_value('alive')
        self.birthdays = get_value('birthdays')
        self.text1 = get_value('text1')
        self.text2 = get_value('text2')
        self.text3 = get_value('text3')
        self.filter_option = menu.get_option_by_name('filter')
        self.filter = self.filter_option.get_filter()
        pid = get_value('pid')
        self.center_person = self.database.get_person_from_gramps_id(pid)
        if (self.center_person == None) :
            raise ReportError(_("Person %s is not in the Database") % pid )

        self._locale = self.set_locale(get_value('trans'))
Esempio n. 6
0
    def __init__(self, database, options, user):
        """
        Create the TagReport object that produces the report.
        
        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.
        
        tag             - The tag each object must match to be included.
        name_format     - Preferred format to display names of people
        incl_private    - Whether to include private data
        """
        Report.__init__(self, database, options, user)
        menu = options.menu

        stdoptions.run_private_data_option(self, menu)

        self.tag = menu.get_option_by_name('tag').get_value()
        if not self.tag:
            raise ReportError(_('Tag Report'),
                _('You must first create a tag before running this report.'))
       
        self.set_locale(menu.get_option_by_name('trans').get_value())

        stdoptions.run_name_format_option(self, menu)
    def __init__(self, database, options, user):
        """
        Create the SourceReport object that produces the report.
        
        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.
        
        Sources          - List of places to report on.
        """

        Report.__init__(self, database, options, user)
        self.__db = database
       
        menu = options.menu
        self.title_string = menu.get_option_by_name('title').get_value()
        self.subtitle_string = menu.get_option_by_name('subtitle').get_value()
        self.footer_string = menu.get_option_by_name('footer').get_value()
        self.showperson = menu.get_option_by_name('showperson').get_value()

        
        filter_option = menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()

        if self.filter.get_name() != '':
            # Use the selected filter to provide a list of source handles
            sourcefilterlist = self.__db.iter_source_handles()
            self.source_handles = self.filter.apply(self.__db, sourcefilterlist)
        else:
            self.source_handles = self.__db.get_source_handles()
    def __init__(self, database, options, user):
        """
        Create the NumberOfAncestorsReport object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        Menu options:
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        """
        Report.__init__(self, database, options, user)

        stdoptions.run_private_data_option(self, options.menu)
        self.__db = self.database

        pid = options.menu.get_option_by_name('pid').get_value()
        self.__person = self.__db.get_person_from_gramps_id(pid)
        if (self.__person == None) :
            raise ReportError(_("Person %s is not in the Database") % pid )

        lang = options.menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(lang)

        stdoptions.run_name_format_option(self, options.menu)
Esempio n. 9
0
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)
        menu = options.menu
        self._user = user

        stdoptions.run_private_data_option(self, menu)

        get_value = lambda name: menu.get_option_by_name(name).get_value()

        self.year = get_value('year')
        self.name_format = get_value('name_format')
        self.country = get_value('country')
        self.anniversaries = get_value('anniversaries')
        self.start_dow = get_value('start_dow')
        self.maiden_name = get_value('maiden_name')
        self.alive = get_value('alive')
        self.birthdays = get_value('birthdays')
        self.text1 = get_value('text1')
        self.text2 = get_value('text2')
        self.text3 = get_value('text3')
        self.filter_option = menu.get_option_by_name('filter')
        self.filter = self.filter_option.get_filter()
        pid = get_value('pid')
        self.center_person = self.database.get_person_from_gramps_id(pid)
        if (self.center_person == None):
            raise ReportError(_("Person %s is not in the Database") % pid)

        self._locale = self.set_locale(get_value('trans'))
Esempio n. 10
0
    def __init__(self, database, options, user):
        """
        This report needs the following parameters (class variables)
        that come in the options class.

        incl_private    - Whether to include private data
        """

        Report.__init__(self, database, options, user)
        menu = options.menu

        stdoptions.run_private_data_option(self, menu)

        self.filter_option =  menu.get_option_by_name('filter')
        self.filter = self.filter_option.get_filter()

        self.top_size = menu.get_option_by_name('top_size').get_value()
        self.callname = menu.get_option_by_name('callname').get_value()

        self.footer = menu.get_option_by_name('footer').get_value()

        self.include = {}
        for (text, varname, default) in RECORDS:
            self.include[varname] = menu.get_option_by_name(varname).get_value()

        self._lang = options.menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(self._lang)
Esempio n. 11
0
    def __init__(self, database, options, user):
        """
        Create the NumberOfAncestorsReport object that produces the report.

        The arguments are:

        database        - the Gramps database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        Menu options:
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        """
        Report.__init__(self, database, options, user)

        stdoptions.run_private_data_option(self, options.menu)
        self.__db = self.database

        pid = options.menu.get_option_by_name('pid').get_value()
        self.__person = self.__db.get_person_from_gramps_id(pid)
        if self.__person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        self.set_locale(options.menu.get_option_by_name('trans').get_value())

        stdoptions.run_name_format_option(self, options.menu)
Esempio n. 12
0
    def __init__(self, database, options_class, user):

        Report.__init__(self, database, options_class, user)

        menu = options_class.menu
        places = menu.get_option_by_name('places').get_value()
        self.reporttype  = menu.get_option_by_name('reporttype').get_value()
        self.incpriv = menu.get_option_by_name('incpriv').get_value()
        #self.incliving = menu.get_option_by_name('incliving').get_value()

        if self.incpriv:
            self.database = database
        else:
            self.database = PrivateProxyDb(database)

        #self.database = LivingProxyDb(database, LivingProxyDb.MODE_EXCLUDE_ALL)

        filter_option = menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()
        self.sort = Sort(self.database)

        if self.filter.get_name() != '':
            # Use the selected filter to provide a list of place handles
            plist = self.database.iter_place_handles()
            self.place_handles = self.filter.apply(self.database, plist)
        else:
            # Use the place handles selected without a filter
            self.place_handles = self.__get_place_handles(places)

        self.place_handles.sort(key=self.sort.by_place_title_key)
Esempio n. 13
0
    def __init__(self, database, options_class, user):

        Report.__init__(self, database, options_class, user)

        menu = options_class.menu
        places = menu.get_option_by_name('places').get_value()
        self.reporttype = menu.get_option_by_name('reporttype').get_value()
        self.incpriv = menu.get_option_by_name('incpriv').get_value()
        #self.incliving = menu.get_option_by_name('incliving').get_value()

        if self.incpriv:
            self.database = database
        else:
            self.database = PrivateProxyDb(database)

        #self.database = LivingProxyDb(database, LivingProxyDb.MODE_EXCLUDE_ALL)

        filter_option = menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()
        self.sort = Sort(self.database)

        if self.filter.get_name() != '':
            # Use the selected filter to provide a list of place handles
            plist = self.database.iter_place_handles()
            self.place_handles = self.filter.apply(self.database, plist)
        else:
            # Use the place handles selected without a filter
            self.place_handles = self.__get_place_handles(places)

        self.place_handles.sort(key=self.sort.by_place_title_key)
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu
        mgobn = lambda name: options.menu.get_option_by_name(name).get_value()

        stdoptions.run_private_data_option(self, menu)
        # (this report has its own "living people" option ("alive") already)

        self.titletext = mgobn('titletext')
        self.relationships = mgobn('relationships')
        self.year = mgobn('year')
        self.country = mgobn('country')
        self.anniversaries = mgobn('anniversaries')
        self.maiden_name = mgobn('maiden_name')
        self.alive = mgobn('alive')
        self.birthdays = mgobn('birthdays')
        self.text1 = mgobn('text1')
        self.text2 = mgobn('text2')
        self.text3 = mgobn('text3')
        self.filter_option = menu.get_option_by_name('filter')
        self.filter = self.filter_option.get_filter()
        pid = mgobn('pid')

        lang = menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(lang)

        stdoptions.run_name_format_option(self, menu)

        self.center_person = self.database.get_person_from_gramps_id(pid)
        if (self.center_person == None):
            raise ReportError(_("Person %s is not in the Database") % pid)
Esempio n. 15
0
    def __init__(self, database, options_class, user):
        """
        Create the Census report.
        
        The arguments are:

        database        - the GRAMPS database instance
        options_class   - instance of the Options class for this report
        user            - a gen.user.User() instance

        The following parameters are defined in the options class:
        
        pid       - Selected person.
        pg_break  - Whether to include page breaks between generations.

        """

        Report.__init__(self, database, options_class, user)

        menu = options_class.menu
        self.pgbrk = menu.get_option_by_name('pg_break').get_value()

        self.report_type = menu.get_option_by_name('report_type').get_value()

        pid = menu.get_option_by_name('pid').get_value()
        self.person = database.get_person_from_gramps_id(pid)
        if (self.person == None) :
            user.notify_error(_("Census Report"),
                              _("Person %s is not in the Database") % pid)

        self.src_handle = menu.get_option_by_name('src_handle').get_value()
Esempio n. 16
0
    def __init__(self, database, options, user):
        """
        Create the Timeline object that produces the report.
        
        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - instance of gen.user.User()

        This report needs the following parameters (class variables)
        that come in the options class.
        
        filter    - Filter to be applied to the people of the database.
                    The option class carries its number, and the function
                    returning the list of filters.
        sortby -    Sorting method to be used.
        """
        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu
        self.filter = menu.get_option_by_name('filter').get_filter()

        self._lang = options.menu.get_option_by_name('trans').get_value()
        self.set_locale(self._lang)

        name_format = menu.get_option_by_name("name_format").get_value()
        if name_format != 0:
            self._name_display.set_default_format(name_format)

        sort_func_num = menu.get_option_by_name('sortby').get_value()
        sort_functions = _get_sort_functions(Sort(database))
        self.sort_name = sort_functions[sort_func_num][0]
        self.sort_func = sort_functions[sort_func_num][1]
        self.calendar = config.get('preferences.calendar-format-report')
Esempio n. 17
0
    def __init__(self, database, options, user):
        """
        Create SimpleBookTitle object that produces the report.

        The arguments are:

        database        - the Gramps database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        title     - Title string.
        subtitle  - Subtitle string.
        imgid     - Gramps ID of the media object to use as an image.
        imgsize   - Size for the image.
        footer    - Footer string.
        """
        Report.__init__(self, database, options, user)
        self._user = user

        menu = options.menu
        self.title_string = menu.get_option_by_name('title').get_value()
        self.image_size = menu.get_option_by_name('imgsize').get_value()
        self.subtitle_string = menu.get_option_by_name('subtitle').get_value()
        self.footer_string = menu.get_option_by_name('footer').get_value()
        self.media_id = menu.get_option_by_name('imgid').get_value()
 def __init__(self, database, options_class, user):
     Report.__init__(self, database, options_class, user)
     menu_option = options_class.menu.get_option_by_name("what_types")
     self.what_types = menu_option.get_selected()
     # TODO: handle an empty selection of what_types
     if len(self.what_types) == 0:
         raise ReportError(_("Last Change Report"), _("You must select at least one type of record."))
Esempio n. 19
0
    def __init__(self, database, options, user):
        """
        This report needs the following parameters (class variables)
        that come in the options class.

        incl_private    - Whether to include private data
        """

        Report.__init__(self, database, options, user)
        menu = options.menu

        stdoptions.run_private_data_option(self, menu)

        self.filter_option =  menu.get_option_by_name('filter')
        self.filter = self.filter_option.get_filter()

        self.top_size = menu.get_option_by_name('top_size').get_value()
        self.callname = menu.get_option_by_name('callname').get_value()

        self.footer = menu.get_option_by_name('footer').get_value()

        self.include = {}
        for (text, varname, default) in RECORDS:
            self.include[varname] = menu.get_option_by_name(varname).get_value()

        self._lang = options.menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(self._lang)

        self._nf = stdoptions.run_name_format_option(self, menu)
Esempio n. 20
0
    def __init__(self, database, options, user):
        """
        Create HourGlass object that produces the report.

        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        incid         - Whether to include IDs.
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        menu = options.menu

        lang = menu.get_option_by_name('trans').get_value()
        locale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, locale)
        self.database = CacheProxyDb(self.database)
        self.__db = self.database

        self.__used_people = []
        self.__family_father = []  # links allocated from family to father
        self.__family_mother = []  # links allocated from family to mother

        self.max_descend = menu.get_option_by_name('maxdescend').get_value()
        self.max_ascend = menu.get_option_by_name('maxascend').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = self.__db.get_person_from_gramps_id(pid)
        if self.center_person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        # Would be nice to get rid of these 2 hard-coded arrays of colours
        # and instead allow the user to pick-and-choose whatever colour they
        # want.  When/if this is done, take a look at the colour-selection
        # widget and code used in the FamilyLines graph.  FIXME
        colored = {
            'male': 'dodgerblue4',
            'female': 'deeppink',
            'unknown': 'black',
            'family': 'darkgreen'
        }
        filled = {
            'male': 'lightblue',
            'female': 'lightpink',
            'unknown': 'lightgray',
            'family': 'lightyellow'
        }

        self.colorize = menu.get_option_by_name('color').get_value()
        if self.colorize == 'colored':
            self.colors = colored
        elif self.colorize == 'filled':
            self.colors = filled
        self.roundcorners = menu.get_option_by_name('roundcorners').get_value()

        self.includeid = menu.get_option_by_name('incid').get_value()

        stdoptions.run_name_format_option(self, menu)
Esempio n. 21
0
    def __init__(self, database, options, user):
        """
        Create the AncestralCollapsibleTree object that produces the
        Ancestral Collapsible Tree report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        max_gen       - Maximum number of generations to include.
        name_format   - Preferred format to display names
        male_bg       - Background color for males
        female_bg     - Background color for females
        exp_male_bg   - Background color for expandable males
        exp_female_bg - Background color for expandable females
        dest_path     - Destination Path
        dest_file     - Destination HTML filename
        """
        Report.__init__(self, database, options, user)

        self.map = {}

        menu = options.menu
        self.max_gen = menu.get_option_by_name('maxgen').get_value()
        self.male_bg = menu.get_option_by_name('male_bg').get_value()
        self.female_bg = menu.get_option_by_name('female_bg').get_value()
        self.exp_male_bg = menu.get_option_by_name('exp_male_bg').get_value()
        self.exp_female_bg = \
            menu.get_option_by_name('exp_female_bg').get_value()
        self.dest_path = conv_to_unicode(
            menu.get_option_by_name('dest_path').get_value(), 'utf8')
        self.dest_file = conv_to_unicode(
            menu.get_option_by_name('dest_file').get_value(), 'utf8')
        self.destprefix, self.destext = \
            os.path.splitext(os.path.basename(self.dest_file))
        self.destjson = conv_to_unicode(
            os.path.join(self.dest_path, "json",
                         "%s.json" % (self.destprefix)))
        self.destjs = conv_to_unicode(
            os.path.join(self.dest_path, "js", "%s.js" % (self.destprefix)))
        self.desthtml = conv_to_unicode(
            os.path.join(self.dest_path, os.path.basename(self.dest_file)))

        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = database.get_person_from_gramps_id(pid)
        if (self.center_person == None):
            raise ReportError(_("Person %s is not in the Database") % pid)

        # Copy the global NameDisplay so that we don't change application
        # defaults.
        self._name_display = copy.deepcopy(global_name_display)
        name_format = menu.get_option_by_name("name_format").get_value()
        if name_format != 0:
            self._name_display.set_default_format(name_format)
Esempio n. 22
0
    def __init__(self, database, options, user):
        """
        Create HourGlass object that produces the report.

        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        incid         - Whether to include IDs.
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        menu = options.menu

        lang = menu.get_option_by_name('trans').get_value()
        locale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, locale)
        self.database = CacheProxyDb(self.database)
        self.__db = self.database

        self.__used_people = []
        self.__family_father = [] # links allocated from family to father
        self.__family_mother = [] # links allocated from family to mother

        self.max_descend = menu.get_option_by_name('maxdescend').get_value()
        self.max_ascend = menu.get_option_by_name('maxascend').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = self.__db.get_person_from_gramps_id(pid)
        if self.center_person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        # Would be nice to get rid of these 2 hard-coded arrays of colours
        # and instead allow the user to pick-and-choose whatever colour they
        # want.  When/if this is done, take a look at the colour-selection
        # widget and code used in the FamilyLines graph.  FIXME
        colored = {
            'male': 'dodgerblue4',
            'female': 'deeppink',
            'unknown': 'black',
            'family': 'darkgreen'
        }
        filled = {
            'male': 'lightblue',
            'female': 'lightpink',
            'unknown': 'lightgray',
            'family': 'lightyellow'
        }

        self.colorize = menu.get_option_by_name('color').get_value()
        if self.colorize == 'colored':
            self.colors = colored
        elif self.colorize == 'filled':
            self.colors = filled
        self.roundcorners = menu.get_option_by_name('roundcorners').get_value()

        self.includeid = menu.get_option_by_name('incid').get_value()

        stdoptions.run_name_format_option(self, menu)
Esempio n. 23
0
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)
        menu = options.menu
        self.db = database
        self.pid_list = {}
        self.pair_list = {}

        # General
        self.root_pid = menu.get_option_by_name('pid').get_value()
        self.root_pid_year = int(
            menu.get_option_by_name('pid_year').get_value()
        )
        dest_path = menu.get_option_by_name('dest_path').get_value()
        dest_file = menu.get_option_by_name('dest_file').get_value()
        self.age_difference = int(
            menu.get_option_by_name('age_diff').get_value()
        )
        self.set_locale(options.menu.get_option_by_name('trans').get_value())
        stdoptions.run_date_format_option(self, menu)
        self.rlocale = self._locale

        # What
        self.show_id = bool(menu.get_option_by_name('show_id').get_value())
        self.opt = bool(menu.get_option_by_name('optimize').get_value())

        # Color
        self.m_bg = menu.get_option_by_name('m_bg').get_value()
        self.w_bg = menu.get_option_by_name('w_bg').get_value()

        # Size
        self.year_to_pixel_factor = int(
            menu.get_option_by_name('year_to_pixel_factor').get_value()
        )
        self.offset_y = int(menu.get_option_by_name('offset_y').get_value())
        self.offset_x = int(menu.get_option_by_name('offset_y').get_value())
        self.box_width = int(menu.get_option_by_name('box_width').get_value())
        self.box_offset_x = int(
            menu.get_option_by_name('box_offset_x').get_value()
        )
        self.vert_length = int(
            menu.get_option_by_name('vert_length').get_value()
        )
        self.scale_x = int(menu.get_option_by_name('scale_x').get_value())

        # File and directory issues
        self.dest_html = os.path.join(dest_path, os.path.basename(dest_file))
        utils_path = os.path.join(USER_PLUGINS, "TimePedigreeHTML", "utils")
        js_source = os.path.join(utils_path, "wz_jsgraphics.js")
        js_target = os.path.join(dest_path, "wz_jsgraphics.js")
        jpg_source = os.path.join(utils_path, "bg.jpg")
        jpg_target = os.path.join(dest_path, "bg.jpg")
        jpg_source = os.path.join(utils_path, "README.txt")
        jpg_target = os.path.join(dest_path, "README.txt")
        if not os.path.isdir(dest_path):
            os.makedirs(dest_path) # create dir if necessary
        if not os.path.isfile(js_target):
            shutil.copyfile(js_source,  js_target)
        if not os.path.isfile(jpg_target):
            shutil.copyfile(jpg_source, jpg_target)
Esempio n. 24
0
 def __init__(self, database, options_class, user):
     Report.__init__(self, database, options_class, user)
     menu_option = options_class.menu.get_option_by_name('what_types')
     self.what_types = menu_option.get_selected()
     # TODO: handle an empty selection of what_types
     if len(self.what_types) == 0:
         raise ReportError(_('Last Change Report'),
                           _('You must select at least one type of record.'))
Esempio n. 25
0
    def __init__(self, database, options, user):
        """
        Create the DescendantReport object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        gen           - Maximum number of generations to include.
        name_format   - Preferred format to display names
        dups          - Whether to include duplicate descendant trees
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """

        Report.__init__(self, database, options, user)

        menu = options.menu

        lang = menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)

        self.max_generations = menu.get_option_by_name('gen').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = self.database.get_person_from_gramps_id(pid)
        if (self.center_person == None):
            raise ReportError(_("Person %s is not in the Database") % pid)

        sort = Sort(self.database)

        #Initialize the Printinfo class
        self._showdups = menu.get_option_by_name('dups').get_value()
        numbering = menu.get_option_by_name('numbering').get_value()
        if numbering == "Simple":
            obj = PrintSimple(self._showdups)
        elif numbering == "de Villiers/Pama":
            obj = PrintVilliers()
        elif numbering == "Meurgey de Tupigny":
            obj = PrintMeurgey()
        else:
            raise AttributeError("no such numbering: '%s'" % self.numbering)

        marrs = menu.get_option_by_name('marrs').get_value()
        divs = menu.get_option_by_name('divs').get_value()

        stdoptions.run_name_format_option(self, menu)

        self.objPrint = Printinfo(self.doc, self.database, obj, marrs, divs,
                                  self._name_display, self._locale)
Esempio n. 26
0
    def __init__(self, database, options, user):
        """
        Create the DescendantReport object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        gen           - Maximum number of generations to include.
        name_format   - Preferred format to display names
        dups          - Whether to include duplicate descendant trees
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """

        Report.__init__(self, database, options, user)

        menu = options.menu

        lang = menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)

        self.max_generations = menu.get_option_by_name('gen').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = self.database.get_person_from_gramps_id(pid)
        if (self.center_person == None) :
            raise ReportError(_("Person %s is not in the Database") % pid )

        sort = Sort(self.database)

        #Initialize the Printinfo class
        self._showdups = menu.get_option_by_name('dups').get_value()
        numbering = menu.get_option_by_name('numbering').get_value()
        if numbering == "Simple":
            obj = PrintSimple(self._showdups)
        elif numbering == "de Villiers/Pama":
            obj = PrintVilliers()
        elif numbering == "Meurgey de Tupigny":
            obj = PrintMeurgey()
        else:
            raise AttributeError("no such numbering: '%s'" % self.numbering)

        marrs = menu.get_option_by_name('marrs').get_value()
        divs = menu.get_option_by_name('divs').get_value()

        stdoptions.run_name_format_option(self, menu)

        self.objPrint = Printinfo(self.doc, self.database, obj, marrs, divs,
                                  self._name_display, self._locale)
    def __init__(self, database, options, user):
        """
        Create the PlaceFamilyReport object produces the PlaceFamily report.
       
        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - instance of a gen.user.User class

        This report needs the following parameters (class variables)
        that come in the options class.

        places          - List of places to report on.
#       placeformat     - Format of Place to display
        incpriv         - Whether to include private data
        showgodparents  - Whether to include and show godparents

        """

        Report.__init__(self, database, options, user)

        self._user = user
        menu = options.menu
        places = menu.get_option_by_name('places').get_value()
        self.pl_format = menu.get_option_by_name('placeformat').get_value()
        #U        self.placeformat  = get_value('placeformat')

        self.incpriv = menu.get_option_by_name('incpriv').get_value()

        self.showgodparents = menu.get_option_by_name(
            'showgodparents').get_value()

        self.set_locale(menu.get_option_by_name('trans').get_value())

        name_format = menu.get_option_by_name("name_format").get_value()
        if name_format != 0:
            self._name_display.set_default_format(name_format)
        self._nd = self._name_display

        if self.incpriv:
            self.database = database
        else:
            self.database = PrivateProxyDb(database)

        filter_option = menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()
        self.sort = Sort(self.database)

        if self.filter.get_name() != '':
            # Use the selected filter to provide a list of place handles
            plist = self.database.iter_place_handles()
            self.place_handles = self.filter.apply(self.database, plist)
        else:
            # Use the place handles selected without a filter
            self.place_handles = self.__get_place_handles(places)

        self.place_handles.sort(key=self.sort.by_place_title_key)
    def __init__(self, database, options, user):
        """
        Create the AncestralCollapsibleTree object that produces the
        Ancestral Collapsible Tree report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        max_gen       - Maximum number of generations to include.
        name_format   - Preferred format to display names
        male_bg       - Background color for males
        female_bg     - Background color for females
        exp_male_bg   - Background color for expandable males
        exp_female_bg - Background color for expandable females
        dest_path     - Destination Path
        dest_file     - Destination HTML filename
        """
        Report.__init__(self, database, options, user)

        self.map = {}

        menu = options.menu
        self.max_gen = menu.get_option_by_name('maxgen').get_value()
        self.male_bg = menu.get_option_by_name('male_bg').get_value()
        self.female_bg = menu.get_option_by_name('female_bg').get_value()
        self.exp_male_bg = menu.get_option_by_name('exp_male_bg').get_value()
        self.exp_female_bg = \
            menu.get_option_by_name('exp_female_bg').get_value()
        self.dest_path = conv_to_unicode(
            menu.get_option_by_name('dest_path').get_value(), 'utf8')
        self.dest_file = conv_to_unicode(
            menu.get_option_by_name('dest_file').get_value(), 'utf8')
        self.destprefix, self.destext = \
            os.path.splitext(os.path.basename(self.dest_file))
        self.destjson = conv_to_unicode(
            os.path.join(self.dest_path, "json", "%s.json" % (self.destprefix)))
        self.destjs = conv_to_unicode(
            os.path.join(self.dest_path, "js", "%s.js" % (self.destprefix)))
        self.desthtml = conv_to_unicode(
            os.path.join(self.dest_path, os.path.basename(self.dest_file)))

        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = database.get_person_from_gramps_id(pid)
        if (self.center_person == None) :
            raise ReportError(_("Person %s is not in the Database") % pid )

        # Copy the global NameDisplay so that we don't change application
        # defaults.
        self._name_display = copy.deepcopy(global_name_display)
        name_format = menu.get_option_by_name("name_format").get_value()
        if name_format != 0:
            self._name_display.set_default_format(name_format)
Esempio n. 29
0
    def __init__(self, database, options, user):
        """
        Create the DescendantBook object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        gen       - Maximum number of generations to include.
        name_format   - Preferred format to display names
        dups    - Whether to include duplicate descendant trees
        filter_option - Specific report filter to use.
        """

        Report.__init__(self, database, options, user)

        menu = options.menu
        self.user = user
        self.title = _('Descendants Report')
        self.max_generations = menu.get_option_by_name('gen').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = database.get_person_from_gramps_id(pid)
        if (self.center_person == None) :
            raise ReportError(_("Person %s is not in the Database") % pid )

        sort = Sort(self.database)
        self.by_birthdate_key = sort.by_birthdate_key

        #Initialize the Printinfo class
        self._showdups = menu.get_option_by_name('dups').get_value()
        numbering = menu.get_option_by_name('numbering').get_value()
        if numbering == "Simple":
            obj = PrintSimple(self._showdups)
        elif numbering == "de Villiers/Pama":
            obj = PrintVilliers()
        elif numbering == "Meurgey de Tupigny":
            obj = PrintMeurgey()
        else:
            raise AttributeError("no such numbering: '%s'" % self.numbering)

        marrs = menu.get_option_by_name('marrs').get_value()
        divs = menu.get_option_by_name('divs').get_value()
        self.filter_option =  menu.get_option_by_name('filter')
        self.filter = self.filter_option.get_filter()

        # Copy the global NameDisplay so that we don't change application defaults.
        self._name_display = copy.deepcopy(global_name_display)
        name_format = menu.get_option_by_name("name_format").get_value()
        if name_format != 0:
            self._name_display.set_default_format(name_format)

        self.objPrint = Printinfo(self.doc, database, obj, marrs, divs,
                                  self._name_display)
Esempio n. 30
0
    def __init__(self, database, options, user):
        """
        Create the DescendantBook object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        gen       - Maximum number of generations to include.
        name_format   - Preferred format to display names
        dups    - Whether to include duplicate descendant trees
        filter_option - Specific report filter to use.
        """

        Report.__init__(self, database, options, user)

        menu = options.menu
        self.user = user
        self.title = _('Descendants Report')
        self.max_generations = menu.get_option_by_name('gen').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = database.get_person_from_gramps_id(pid)
        if (self.center_person == None):
            raise ReportError(_("Person %s is not in the Database") % pid)

        sort = Sort(self.database)
        self.by_birthdate_key = sort.by_birthdate_key

        #Initialize the Printinfo class
        self._showdups = menu.get_option_by_name('dups').get_value()
        numbering = menu.get_option_by_name('numbering').get_value()
        if numbering == "Simple":
            obj = PrintSimple(self._showdups)
        elif numbering == "de Villiers/Pama":
            obj = PrintVilliers()
        elif numbering == "Meurgey de Tupigny":
            obj = PrintMeurgey()
        else:
            raise AttributeError("no such numbering: '%s'" % self.numbering)

        marrs = menu.get_option_by_name('marrs').get_value()
        divs = menu.get_option_by_name('divs').get_value()
        self.filter_option = menu.get_option_by_name('filter')
        self.filter = self.filter_option.get_filter()

        # Copy the global NameDisplay so that we don't change application defaults.
        self._name_display = copy.deepcopy(global_name_display)
        name_format = menu.get_option_by_name("name_format").get_value()
        if name_format != 0:
            self._name_display.set_default_format(name_format)

        self.objPrint = Printinfo(self.doc, database, obj, marrs, divs,
                                  self._name_display)
Esempio n. 31
0
    def __init__(self, database, options, user):
        """
        Create the FanChart object that produces the report.

        The arguments are:

        database     - the Gramps database instance
        options      - instance of the Options class for this report
        user         - a gen.user.User instance

        This report needs the following parameters (class variables)
        that come in the options class.

        maxgen       - Maximum number of generations to include.
        circle       - Draw a full circle, half circle, or quarter circle.
        background   - Background color is generation dependent or white.
        radial       - Print radial texts roundabout or as upright as possible.
        draw_empty   - draw background when there is no information
        same_style   - use the same style for all generation
        incl_private - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """

        Report.__init__(self, database, options, user)

        menu = options.menu

        lang = options.menu.get_option_by_name('trans').get_value()
        rlocale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, rlocale)
        self.database = CacheProxyDb(self.database)

        self.max_generations = menu.get_option_by_name('maxgen').get_value()
        self.circle = menu.get_option_by_name('circle').get_value()
        self.background = menu.get_option_by_name('background').get_value()
        self.radial = menu.get_option_by_name('radial').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.draw_empty = menu.get_option_by_name('draw_empty').get_value()
        self.same_style = menu.get_option_by_name('same_style').get_value()
        self.center_person = self.database.get_person_from_gramps_id(pid)
        if self.center_person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        self.graphic_style = []
        self.text_style = []
        for i in range(0, self.max_generations):
            self.graphic_style.append('FC-Graphic' + '%02d' % i)
            self.text_style.append('FC-Text' + '%02d' % i)

        self.calendar = 0

        self.height = 0
        self.map = [None] * 2**self.max_generations
        self.text = {}
Esempio n. 32
0
    def __init__(self, database, options, user):
        """
        Create the FamilyGroup object that produces the report.

        The arguments are:

        database        - the Gramps database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        filter    - Filter to be applied to the families of the database.
                    The option class carries its number, and the function
                    returning the list of filters.
        incattrs      - Whether to include attributes
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu

        self.set_locale(menu.get_option_by_name('trans').get_value())
        self._ = self._locale.translation.sgettext # needed for English

        stdoptions.run_date_format_option(self, menu)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)
        self.database = CacheProxyDb(self.database)
        self.db = self.database

        self.filter = menu.get_option_by_name('filter').get_filter()

        get_option_by_name = menu.get_option_by_name
        get_value = lambda name: get_option_by_name(name).get_value()
        self.gramps_ids = get_value('inc_id')
        self.recursive = get_value('recursive')
        self.missing_info = get_value('missinginfo')
        self.generations = get_value('generations')
        self.inc_fam_notes = get_value('incFamNotes')
        self.inc_par_events = get_value('incParEvents')
        self.inc_par_addr = get_value('incParAddr')
        self.inc_par_notes = get_value('incParNotes')
        self.inc_par_names = get_value('incParNames')
        self.inc_par_mar = get_value('incParMar')
        self.inc_rel_dates = get_value('incRelDates')
        self.inc_chi_mar = get_value('incChiMar')
        self.include_attrs = get_value('incattrs')

        stdoptions.run_name_format_option(self, menu)

        self.place_format = menu.get_option_by_name("place_format").get_value()
Esempio n. 33
0
    def __init__(self, database, options, user):
        """
        Create the FanChart object that produces the report.

        The arguments are:

        database     - the GRAMPS database instance
        options      - instance of the Options class for this report
        user         - a gen.user.User instance

        This report needs the following parameters (class variables)
        that come in the options class.

        maxgen       - Maximum number of generations to include.
        circle       - Draw a full circle, half circle, or quarter circle.
        background   - Background color is generation dependent or white.
        radial       - Print radial texts roundabout or as upright as possible.
        draw_empty   - draw background when there is no information
        same_style   - use the same style for all generation
        incl_private - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """

        Report.__init__(self, database, options, user)

        menu = options.menu

        lang = options.menu.get_option_by_name("trans").get_value()
        rlocale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, rlocale)
        self.database = CacheProxyDb(self.database)

        self.max_generations = menu.get_option_by_name("maxgen").get_value()
        self.circle = menu.get_option_by_name("circle").get_value()
        self.background = menu.get_option_by_name("background").get_value()
        self.radial = menu.get_option_by_name("radial").get_value()
        pid = menu.get_option_by_name("pid").get_value()
        self.draw_empty = menu.get_option_by_name("draw_empty").get_value()
        self.same_style = menu.get_option_by_name("same_style").get_value()
        self.center_person = self.database.get_person_from_gramps_id(pid)
        if self.center_person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        self.graphic_style = []
        self.text_style = []
        for i in range(0, self.max_generations):
            self.graphic_style.append("FC-Graphic" + "%02d" % i)
            self.text_style.append("FC-Text" + "%02d" % i)

        self.calendar = 0

        self.height = 0
        self.map = [None] * 2 ** self.max_generations
        self.text = {}
Esempio n. 34
0
    def __init__(self, database, options, user):
        """
        Create the FamilyGroup object that produces the report.

        The arguments are:

        database        - the Gramps database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        filter    - Filter to be applied to the families of the database.
                    The option class carries its number, and the function
                    returning the list of filters.
        incattrs      - Whether to include attributes
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu

        self.set_locale(menu.get_option_by_name('trans').get_value())
        self._ = self._locale.translation.sgettext # needed for English

        stdoptions.run_date_format_option(self, menu)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)
        self.database = CacheProxyDb(self.database)
        self.db = self.database

        self.filter = menu.get_option_by_name('filter').get_filter()

        get_option_by_name = menu.get_option_by_name
        get_value = lambda name: get_option_by_name(name).get_value()
        self.gramps_ids = get_value('inc_id')
        self.recursive = get_value('recursive')
        self.missing_info = get_value('missinginfo')
        self.generations = get_value('generations')
        self.inc_fam_notes = get_value('incFamNotes')
        self.inc_par_events = get_value('incParEvents')
        self.inc_par_addr = get_value('incParAddr')
        self.inc_par_notes = get_value('incParNotes')
        self.inc_par_names = get_value('incParNames')
        self.inc_par_mar = get_value('incParMar')
        self.inc_rel_dates = get_value('incRelDates')
        self.inc_chi_mar = get_value('incChiMar')
        self.include_attrs = get_value('incattrs')

        stdoptions.run_name_format_option(self, menu)

        self.place_format = menu.get_option_by_name("place_format").get_value()
Esempio n. 35
0
 def __init__(self, database, options_class, user):
     Report.__init__(self, database, options_class, user)
     self.counter = 0
     menu_option = options_class.menu.get_option_by_name('what_types')
     self.what_types = menu_option.get_selected()
     if not self.what_types:
         raise ReportError(_('Last Change Report'),
                           _('You must select at least one type of'
                             ' record.'))
Esempio n. 36
0
    def __init__(self, database, options, user):
        """
        Create the PlaceFamilyReport object produces the PlaceFamily report.
        
        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - instance of a gen.user.User class

        This report needs the following parameters (class variables)
        that come in the options class.
        
        places          - List of places to report on.
#       placeformat     - Format of Place to display
        incpriv         - Whether to include private data
        showgodparents  - Whether to include and show godparents

        """

        Report.__init__(self, database, options, user)

        self._user = user
        menu = options.menu
        places = menu.get_option_by_name('places').get_value()
        self.pl_format  = menu.get_option_by_name('placeformat').get_value()
#U        self.placeformat  = get_value('placeformat')

        self.incpriv = menu.get_option_by_name('incpriv').get_value()

        self.showgodparents = menu.get_option_by_name('showgodparents').get_value()

        self.set_locale(menu.get_option_by_name('trans').get_value())

        name_format = menu.get_option_by_name("name_format").get_value()
        if name_format != 0:
            self._name_display.set_default_format(name_format)
        self._nd = self._name_display

        if self.incpriv:
            self.database = database
        else:
            self.database = PrivateProxyDb(database)

        filter_option = menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()
        self.sort = Sort(self.database)

        if self.filter.get_name() != '':
            # Use the selected filter to provide a list of place handles
            plist = self.database.iter_place_handles()
            self.place_handles = self.filter.apply(self.database, plist)
        else:
            # Use the place handles selected without a filter
            self.place_handles = self.__get_place_handles(places)

        self.place_handles.sort(key=self.sort.by_place_title_key)
Esempio n. 37
0
 def __init__(self, database, options_class, user):
     Report.__init__(self, database, options_class, user)
     self.counter = 0
     menu_option = options_class.menu.get_option_by_name('what_types')
     self.what_types = menu_option.get_selected()
     if not self.what_types:
         raise ReportError(_('Last Change Report'),
                           _('You must select at least one type of'
                             ' record.'))
Esempio n. 38
0
 def __init__(self, database, options, user):
     Report.__init__(self, database, options, user)
     self._user = user
     menu = options.menu
     mgobn = lambda name:options.menu.get_option_by_name(name).get_value()
     self.filename = mgobn('filename')
     self.show_diff = mgobn('show_diff')
     self.show_missing = mgobn('show_missing')
     self.show_added = mgobn('show_added')
Esempio n. 39
0
 def __init__(self, database, options, user):
     Report.__init__(self, database, options, user)
     self._user = user
     menu = options.menu
     mgobn = lambda name: options.menu.get_option_by_name(name).get_value()
     self.filename = mgobn('filename')
     self.show_diff = mgobn('show_diff')
     self.show_missing = mgobn('show_missing')
     self.show_added = mgobn('show_added')
Esempio n. 40
0
    def __init__(self, database, options, user):
        """
        Create the PlaceReport object produces the Place report.
        
        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - instance of a gen.user.User class

        This report needs the following parameters (class variables)
        that come in the options class.
        
        places          - List of places to report on.
        center          - Center of report, person or event
        incl_private    - Whether to include private data
        name_format     - Preferred format to display names

        """

        Report.__init__(self, database, options, user)

        self._user = user
        menu = options.menu

        stdoptions.run_private_data_option(self, menu)

        places = menu.get_option_by_name('places').get_value()
        self.center = menu.get_option_by_name('center').get_value()

        self.set_locale(menu.get_option_by_name('trans').get_value())

        stdoptions.run_name_format_option(self, menu)
        self._nd = self._name_display

        filter_option = menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()

        self.sort = Sort(self.database)

        self.place_handles = []
        if self.filter.get_name() != '':
            # Use the selected filter to provide a list of place handles
            plist = self.database.iter_place_handles()
            self.place_handles = self.filter.apply(self.database, plist)

        if places:
            # Add places selected individually
            self.place_handles += self.__get_place_handles(places)

        if not self.place_handles:
            raise ReportError(
                _('Place Report'),
                _('Please select at least one place before running this.'))

        self.place_handles.sort(key=self.sort.by_place_title_key)
Esempio n. 41
0
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)

        self.options = options
        self.menu = options.menu
        self.db = database
        self.persons = dict()
        self.double_cousins = set()
        self.get_persons()
        self.search_double_cousins()
 def __init__(self, database, options, user):
     # Inject simplified LaTeX handler
     options.set_document(
         SimpleLaTeXDoc(options.handler.doc.get_style_sheet(),
                        options.handler.doc.paper, []))
     Report.__init__(self, database, options, user)
     menu = options.menu
     self.person_id = menu.get_option_by_name('pid').get_value()
     self._person_id_list = []
     self._person_appearance_list = []
Esempio n. 43
0
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)

        self.menu = options.menu
        self.options = options
        self._db = self.database
        self._opt = self.get_opt_dict()
        self.user = user
        self.window = self.user.uistate.window
        self.filename = None
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)

        menu = options.menu
        pid  = menu.get_option_by_name('pid').get_value()
        self.descendent = database.get_person_from_gramps_id(pid)
        self.descendent_handle = self.descendent.get_handle()
        ancestor = menu.get_option_by_name('ancestor').get_value()
        self.ancestor = database.get_person_from_gramps_id(ancestor)
        if (self.descendent == None) :
            raise ReportError(_("Person %s is not in the Database") % pid )
    def __init__(self, database, options, user):
        Report.__init__(self, database, options, user)

        menu = options.menu
        pid = menu.get_option_by_name('pid').get_value()
        self.descendent = database.get_person_from_gramps_id(pid)
        self.descendent_handle = self.descendent.get_handle()
        ancestor = menu.get_option_by_name('ancestor').get_value()
        self.ancestor = database.get_person_from_gramps_id(ancestor)
        if (self.descendent == None):
            raise ReportError(_("Person %s is not in the Database") % pid)
Esempio n. 46
0
    def __init__(self, database, options, user):
        """
        Create the IndivCompleteReport object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        filter    - Filter to be applied to the people of the database.
                    The option class carries its number, and the function
                    returning the list of filters.
        cites     - Whether or not to include source information.
        sort      - Whether or not to sort events into chronological order.
        images    - Whether or not to include images.
        sections  - Which event groups should be given separate sections.
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """

        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu

        lang = menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)
        self._db = self.database

        self.use_pagebreak = menu.get_option_by_name('pageben').get_value()
        self.use_srcs = menu.get_option_by_name('cites').get_value()
        self.use_srcs_notes = menu.get_option_by_name(
            'incsrcnotes').get_value()

        self.sort = menu.get_option_by_name('sort').get_value()

        self.use_images = menu.get_option_by_name('images').get_value()
        self.use_gramps_id = menu.get_option_by_name('grampsid').get_value()

        filter_option = options.menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()
        self.bibli = None

        self.section_list = menu.get_option_by_name('sections').get_selected()

        stdoptions.run_name_format_option(self, menu)
Esempio n. 47
0
    def __init__(self, database, options, user):
        """
        Create HourGlass object that produces the report.

        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        inc_id        - Whether to include IDs.
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        menu = options.menu

        self.set_locale(menu.get_option_by_name('trans').get_value())

        stdoptions.run_date_format_option(self, menu)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)
        self.database = CacheProxyDb(self.database)
        self.__db = self.database

        self.__used_people = []
        self.__family_father = [] # links allocated from family to father
        self.__family_mother = [] # links allocated from family to mother

        self.max_descend = menu.get_option_by_name('maxdescend').get_value()
        self.max_ascend = menu.get_option_by_name('maxascend').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = self.__db.get_person_from_gramps_id(pid)
        if self.center_person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        self.colorize = menu.get_option_by_name('color').get_value()
        self.colors = {'male': menu.get_option_by_name('colormales').get_value(),
            'female': menu.get_option_by_name('colorfemales').get_value(),
            'unknown': menu.get_option_by_name('colorunknown').get_value(),
            'family': menu.get_option_by_name('colorfamilies').get_value()
        }
        self.roundcorners = menu.get_option_by_name('roundcorners').get_value()

        self.includeid = menu.get_option_by_name('inc_id').get_value()

        arrow_str = menu.get_option_by_name('arrow').get_value()
        if 'o' in arrow_str:
            self.arrowheadstyle = 'normal'
        else:
            self.arrowheadstyle = 'none'
        if 'c' in arrow_str:
            self.arrowtailstyle = 'normal'
        else:
            self.arrowtailstyle = 'none'

        stdoptions.run_name_format_option(self, menu)
Esempio n. 48
0
    def __init__(self, database, options, user):
        """
        Create the Timeline object that produces the report.

        The arguments are:

        database        - the Gramps database instance
        options         - instance of the Options class for this report
        user            - instance of gen.user.User()

        This report needs the following parameters (class variables)
        that come in the options class.

        filter    - Filter to be applied to the people of the database.
                    The option class carries its number, and the function
                    returning the list of filters.
        sortby        - Sorting method to be used.
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu

        self.set_locale(options.menu.get_option_by_name('trans').get_value())

        stdoptions.run_private_data_option(self, menu)
        living_opt = stdoptions.run_living_people_option(
            self, menu, self._locale)
        self.database = CacheProxyDb(self.database)

        self.filter = menu.get_option_by_name('filter').get_filter()
        self.fil_name = "(%s)" % self.filter.get_name(self._locale)

        living_value = menu.get_option_by_name('living_people').get_value()
        for (value, description) in living_opt.get_items(xml_items=True):
            if value == living_value:
                living_desc = self._(description)
                break
        self.living_desc = self._("(Living people: %(option_name)s)") % {
            'option_name': living_desc
        }

        stdoptions.run_name_format_option(self, menu)

        sort_func_num = menu.get_option_by_name('sortby').get_value()
        sort_functions = _get_sort_functions(Sort(self.database))
        self.sort_name = self._(sort_functions[sort_func_num][0])
        self.sort_func = sort_functions[sort_func_num][1]
        self.calendar = config.get('preferences.calendar-format-report')
        self.plist = []
        self.header = 2.6
Esempio n. 49
0
    def __init__(self, database, options, user):
        """
        Create the IndivCompleteReport object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        filter    - Filter to be applied to the people of the database.
                    The option class carries its number, and the function
                    returning the list of filters.
        cites     - Whether or not to include source information.
        sort      - Whether or not to sort events into chronological order.
        images    - Whether or not to include images.
        sections  - Which event groups should be given separate sections.
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """

        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu

        lang = menu.get_option_by_name('trans').get_value()
        self._locale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)
        self._db = self.database

        self.use_pagebreak = menu.get_option_by_name('pageben').get_value()
        self.use_srcs = menu.get_option_by_name('cites').get_value()
        self.use_srcs_notes = menu.get_option_by_name('incsrcnotes').get_value()

        self.sort = menu.get_option_by_name('sort').get_value()

        self.use_images = menu.get_option_by_name('images').get_value()
        self.use_gramps_id = menu.get_option_by_name('grampsid').get_value()

        filter_option = options.menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()
        self.bibli = None

        self.section_list = menu.get_option_by_name('sections').get_selected()

        stdoptions.run_name_format_option(self, menu)
Esempio n. 50
0
    def __init__(self, database, options, user):
        """
        Create the KinshipReport object that produces the report.

        The arguments are:

        database        - the Gramps database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        maxdescend    - Maximum generations of descendants to include.
        maxascend     - Maximum generations of ancestors to include.
        incspouses    - Whether to include spouses.
        inccousins    - Whether to include cousins.
        incaunts      - Whether to include aunts/uncles/nephews/nieces.
        pid           - The Gramps ID of the center person for the report.
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        menu = options.menu

        self.set_locale(menu.get_option_by_name('trans').get_value())

        stdoptions.run_date_format_option(self, menu)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)
        self.database = CacheProxyDb(self.database)
        self.__db = self.database

        self.max_descend = menu.get_option_by_name('maxdescend').get_value()
        self.max_ascend = menu.get_option_by_name('maxascend').get_value()
        self.inc_spouses = menu.get_option_by_name('incspouses').get_value()
        self.inc_cousins = menu.get_option_by_name('inccousins').get_value()
        self.inc_aunts = menu.get_option_by_name('incaunts').get_value()
        pid = menu.get_option_by_name('pid').get_value()
        self.person = self.database.get_person_from_gramps_id(pid)
        if self.person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        stdoptions.run_name_format_option(self, menu)

        self.rel_calc = get_relationship_calculator(reinit=True,
                                                    clocale=self._locale)

        self.kinship_map = {}
        self.spouse_map = {}
Esempio n. 51
0
    def __init__(self, database, options, user):
        """
        Create the RepositoryReport object produces the Repositories report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        incintern    - Whether to include urls for repository.
        incaddres    - Whether to include addresses for repository.
        incauthor    - Whether to include author of source.
        incabbrev    - Whether to include abbreviation of source.
        incpublic    - Whether to include publication information of source.
        incdatamp    - Whether to include data keys and values of source.
        inclunote    - Whether to include notes of source or repository.
        inclmedia    - Whether to include media of source.
        inclcitat    - Whether to include citations of source.
        incprivat    - Whether to include private records.
        incempty     - Whether to include empty lines with keys for filling.
        trans        - Select translation

        """

        Report.__init__(self, database, options, user)

        self.user = user

        menu = options.menu
        get_option_by_name = menu.get_option_by_name
        get_value = lambda name: get_option_by_name(name).get_value()

        self.inc_intern = get_value('incintern')
        self.inc_addres = get_value('incaddres')
        self.inc_author = get_value('incauthor')
        self.inc_abbrev = get_value('incabbrev')
        self.inc_public = get_value('incpublic')
        self.inc_datamp = get_value('incdatamp')
        self.inclu_note = get_value('inclunote')
        self.incl_media = get_value('inclmedia')
        self.incl_citat = get_value('inclcitat')
        self.inc_privat = get_value('incprivat')
        self.incl_empty = get_value('incempty')

        language = get_value('trans')
        locale = self.set_locale(language)

        filter_option = get_option_by_name('filter')
        self.filter = filter_option.get_filter()
Esempio n. 52
0
    def __init__(self, database, options, user):
        """
        Create the PlaceReport object produces the Place report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - instance of a gen.user.User class

        This report needs the following parameters (class variables)
        that come in the options class.

        places          - List of places to report on.
        center          - Center of report, person or event
        incl_private    - Whether to include private data
        name_format     - Preferred format to display names

        """

        Report.__init__(self, database, options, user)

        self._user = user
        menu = options.menu

        stdoptions.run_private_data_option(self, menu)

        places = menu.get_option_by_name('places').get_value()
        self.center  = menu.get_option_by_name('center').get_value()

        self.set_locale(menu.get_option_by_name('trans').get_value())

        stdoptions.run_name_format_option(self, menu)
        self._nd = self._name_display

        filter_option = menu.get_option_by_name('filter')
        self.filter = filter_option.get_filter()

        self.sort = Sort(self.database)

        if self.filter.get_name() != '':
            # Use the selected filter to provide a list of place handles
            plist = self.database.iter_place_handles()
            self.place_handles = self.filter.apply(self.database, plist)
        else:
            # Use the place handles selected without a filter
            self.place_handles = self.__get_place_handles(places)

        if not self.place_handles:
            raise ReportError(_('Place Report'),
                _('Please select at least one place before running this.'))

        self.place_handles.sort(key=self.sort.by_place_title_key)
Esempio n. 53
0
    def __init__(self, database, options, user):
        """
        Create the RepositoryReport object produces the Repositories report.
        
        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.

        incintern    - Whether to include urls for repository.
        incaddres    - Whether to include addresses for repository.
        incauthor    - Whether to include author of source.
        incabbrev    - Whether to include abbreviation of source.
        incpublic    - Whether to include publication information of source.
        incdatamp    - Whether to include data keys and values of source.
        inclunote    - Whether to include notes of source or repository.
        inclmedia    - Whether to include media of source.
        inclcitat    - Whether to include citations of source.
        incprivat    - Whether to include private records.
        incempty     - Whether to include empty lines with keys for filling.
        trans        - Select translation

        """

        Report.__init__(self, database, options, user)

        self.user = user

        menu = options.menu
        get_option_by_name = menu.get_option_by_name
        get_value = lambda name: get_option_by_name(name).get_value()

        self.inc_intern = get_value('incintern')
        self.inc_addres = get_value('incaddres')
        self.inc_author = get_value('incauthor')
        self.inc_abbrev = get_value('incabbrev')
        self.inc_public = get_value('incpublic')
        self.inc_datamp = get_value('incdatamp')
        self.inclu_note = get_value('inclunote')
        self.incl_media = get_value('inclmedia')
        self.incl_citat = get_value('inclcitat')
        self.inc_privat = get_value('incprivat')
        self.incl_empty = get_value('incempty')

        language = get_value('trans')
        locale = self.set_locale(language)

        filter_option = get_option_by_name('filter')
        self.filter = filter_option.get_filter()
Esempio n. 54
0
    def __init__(self, database, options, user):
        """
        Create TableOfContents object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance
        """
        Report.__init__(self, database, options, user)
        self.set_locale(options.menu.get_option_by_name('trans').get_value())
Esempio n. 55
0
    def __init__(self, database, options, user):
        """
        Create the Timeline object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - instance of gen.user.User()

        This report needs the following parameters (class variables)
        that come in the options class.

        filter    - Filter to be applied to the people of the database.
                    The option class carries its number, and the function
                    returning the list of filters.
        sortby        - Sorting method to be used.
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)
        self._user = user
        menu = options.menu

        lang = options.menu.get_option_by_name('trans').get_value()
        rlocale = self.set_locale(lang)

        stdoptions.run_private_data_option(self, menu)
        living_opt = stdoptions.run_living_people_option(self, menu, rlocale)
        self.database = CacheProxyDb(self.database)

        self.filter = menu.get_option_by_name('filter').get_filter()
        self.fil_name = "(%s)" % self.filter.get_name(rlocale)

        living_value = menu.get_option_by_name('living_people').get_value()
        for (value, description) in living_opt.get_items(xml_items=True):
            if value == living_value:
                living_desc = self._(description)
                break
        self.living_desc = self._(
            "(Living people: %(option_name)s)") % {'option_name': living_desc}

        stdoptions.run_name_format_option(self, menu)

        sort_func_num = menu.get_option_by_name('sortby').get_value()
        sort_functions = _get_sort_functions(Sort(self.database))
        self.sort_name = self._(sort_functions[sort_func_num][0])
        self.sort_func = sort_functions[sort_func_num][1]
        self.calendar = config.get('preferences.calendar-format-report')
        self.plist = []
        self.header = 2.6
Esempio n. 56
0
    def __init__(self, database, options, user):
        """
        Create TableOfContents object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance
        """
        Report.__init__(self, database, options, user)
        self.set_locale(options.menu.get_option_by_name('trans').get_value())
Esempio n. 57
0
    def __init__(self, database, options, user):
        """
        Create the FanChart object that produces the report.
        
        The arguments are:

        database     - the GRAMPS database instance
        options      - instance of the Options class for this report
        user         - a gen.user.User instance

        This report needs the following parameters (class variables)
        that come in the options class.
        
        maxgen       - Maximum number of generations to include.
        circle       - Draw a full circle, half circle, or quarter circle.
        background   - Background color is generation dependent or white.
        radial       - Print radial texts roundabout or as upright as possible.
        draw_empty   - draw background when there is no information
        same_style   - use the same style for all generation
        incl_private - Whether to include private data
        """

        Report.__init__(self, database, options, user)

        menu = options.menu

        stdoptions.run_private_data_option(self, menu)

        self.max_generations = menu.get_option_by_name('maxgen').get_value()
        self.circle          = menu.get_option_by_name('circle').get_value()
        self.background      = menu.get_option_by_name('background').get_value()
        self.radial          = menu.get_option_by_name('radial').get_value()
        pid                  = menu.get_option_by_name('pid').get_value()
        self.draw_empty      = menu.get_option_by_name('draw_empty').get_value()
        self.same_style      = menu.get_option_by_name('same_style').get_value()
        self.center_person = self.database.get_person_from_gramps_id(pid)
        if (self.center_person == None) :
            raise ReportError(_("Person %s is not in the Database") % pid )

        self.graphic_style = []
        self.text_style = []
        for i in range (0, self.max_generations):
            self.graphic_style.append('FC-Graphic' + '%02d' % i)
            self.text_style.append('FC-Text' + '%02d' % i)
        
        self.calendar = 0

        self.height = 0
        self.map = [None] * 2**self.max_generations
        self.text = {}

        self.set_locale(menu.get_option_by_name('trans').get_value())
Esempio n. 58
0
    def __init__(self, database, options, user):
        """
        Create the EndOfLineReport object that produces the report.

        The arguments are:

        database        - the Gramps database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance

        This report needs the following parameters (class variables)
        that come in the options class.
        name_format   - Preferred format to display names
        incl_private  - Whether to include private data
        living_people - How to handle living people
        years_past_death - Consider as living this many years after death
        """
        Report.__init__(self, database, options, user)

        menu = options.menu

        self.set_locale(menu.get_option_by_name('trans').get_value())

        stdoptions.run_date_format_option(self, menu)

        stdoptions.run_private_data_option(self, menu)
        stdoptions.run_living_people_option(self, menu, self._locale)
        self.database = CacheProxyDb(self.database)

        pid = menu.get_option_by_name('pid').get_value()
        self.center_person = self.database.get_person_from_gramps_id(pid)
        if self.center_person is None:
            raise ReportError(_("Person %s is not in the Database") % pid)

        stdoptions.run_name_format_option(self, menu)

        # eol_map is a map whose:
        #   keys are the generations of the people
        #   values are a map whose:
        #      keys are person handles
        #      values are an array whose:
        #         elements are an array of ancestor person handles that link
        #         the eol person handle to the person or interest
        # eol_map[generation][person_handle][pedigree_idx][ancestor_handle_idx]
        #
        # There is an array of pedigrees because one person could show up twice
        # in one generation (descendants marrying). Most people only have one
        # pedigree.
        #
        # eol_map is populated by get_eol() which calls itself recursively.
        self.eol_map = {}
        self.get_eol(self.center_person, 1, [])
Esempio n. 59
0
    def __init__(self, database, options, user):
        """
        Create AlphabeticalIndex object that produces the report.

        The arguments are:

        database        - the GRAMPS database instance
        options         - instance of the Options class for this report
        user            - a gen.user.User() instance
        """
        Report.__init__(self, database, options, user)
        self._user = user
        self.set_locale(options.menu.get_option_by_name("trans").get_value())