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)
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)
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()
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()
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)
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 = {}
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 = {}
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, [])
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, [])
def __init__(self, database, options, user): """ Create the AncestorReport object that produces the Ahnentafel 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. pagebbg - Whether to include page breaks between generations. name_format - Preferred format to display names incl_private - Whether to include private data namebrk - Whether a line break should follow the name inc_id - Whether to include Gramps 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) self.map = {} 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.max_generations = menu.get_option_by_name('maxgen').get_value() self.pgbrk = menu.get_option_by_name('pagebbg').get_value() self.opt_namebrk = menu.get_option_by_name('namebrk').get_value() self.want_ids = menu.get_option_by_name('inc_id').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 is None: raise ReportError(_("Person %s is not in the Database") % pid) stdoptions.run_name_format_option(self, menu) self.__narrator = Narrator(self.database, use_fulldate=True, nlocale=self._locale)
def __init__(self, database, options, user): """ Create the AncestorReport object that produces the Ahnentafel 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. pagebbg - Whether to include page breaks between generations. name_format - Preferred format to display names incl_private - Whether to include private data namebrk - Whether a line break should follow the name inc_id - Whether to include Gramps 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) self.map = {} 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.max_generations = menu.get_option_by_name('maxgen').get_value() self.pgbrk = menu.get_option_by_name('pagebbg').get_value() self.opt_namebrk = menu.get_option_by_name('namebrk').get_value() self.want_ids = menu.get_option_by_name('inc_id').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 is None: raise ReportError(_("Person %s is not in the Database") % pid) stdoptions.run_name_format_option(self, menu) self.__narrator = Narrator(self.database, use_fulldate=True, nlocale=self._locale)
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 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) living_opt = stdoptions.run_living_people_option( self, menu, self._locale) self.database = CacheProxyDb(self.database) self._lv = menu.get_option_by_name('living_people').get_value() for (value, description) in living_opt.get_items(xml_items=True): if value == self._lv: living_desc = self._(description) break self.living_desc = self._("(Living people: %(option_name)s)") % { 'option_name': living_desc } 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.')) stdoptions.run_name_format_option(self, menu) self.place_format = menu.get_option_by_name("place_format").get_value()
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 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) living_opt = stdoptions.run_living_people_option(self, menu, self._locale) self.database = CacheProxyDb(self.database) self._lv = menu.get_option_by_name('living_people').get_value() for (value, description) in living_opt.get_items(xml_items=True): if value == self._lv: living_desc = self._(description) break self.living_desc = self._("(Living people: %(option_name)s)" ) % {'option_name' : living_desc} 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.')) stdoptions.run_name_format_option(self, menu) self.place_format = menu.get_option_by_name("place_format").get_value()
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.set_locale(menu.get_option_by_name('trans').get_value()) stdoptions.run_date_format_option(self, menu) self.showperson = menu.get_option_by_name('showperson').get_value() filter_option = menu.get_option_by_name('filter') self.filter = filter_option.get_filter() # self.sort = Sort.Sort(self.database) 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 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.set_locale(menu.get_option_by_name('trans').get_value()) stdoptions.run_date_format_option(self, menu) self.showperson = menu.get_option_by_name('showperson').get_value() filter_option = menu.get_option_by_name('filter') self.filter = filter_option.get_filter() # self.sort = Sort.Sort(self.database) 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 AncestorTree 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.options = options self._user = user self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_date_format_option(self, options.menu) stdoptions.run_private_data_option(self, options.menu) stdoptions.run_living_people_option(self, options.menu, self._locale) self.database = CacheProxyDb(self.database) stdoptions.run_name_format_option(self, options.menu) self._nd = self._name_display
def __init__(self, database, options, user): """ Initialize the report. @param database: the Gramps database instance @param options: instance of the Options class for this report @param user: a gramps.gen.user.User() instance """ Report.__init__(self, database, options, user) self.user = user menu = options.menu self.citation_handles = set() self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_date_format_option(self, menu) self.rlocale = self._locale self.person_id = menu.get_option_by_name('pid').get_value() self.document_class = 'memoir' self.styleName = 'default' self.language = 'russian'
def __init__(self, database, options, user): """ Create AncestorTree 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.options = options self._user = user self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_date_format_option(self, options.menu) stdoptions.run_private_data_option(self, options.menu) stdoptions.run_living_people_option(self, options.menu, self._locale) self.database = CacheProxyDb(self.database) stdoptions.run_name_format_option(self, options.menu) self._nd = self._name_display
def __init__(self, database, options, user): """ Create FamilyLinesReport object that eventually produces the report. The arguments are: database - the Gramps database instance options - instance of the FamilyLinesOptions class for this report user - a gen.user.User() instance 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 get_option_by_name = menu.get_option_by_name get_value = lambda name: get_option_by_name(name).get_value() 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 # initialize several convenient variables self._people = set() # handle of people we need in the report self._families = set() # handle of families we need in the report self._deleted_people = 0 self._deleted_families = 0 self._user = user self._followpar = get_value('followpar') self._followchild = get_value('followchild') self._removeextra = get_value('removeextra') self._gidlist = get_value('gidlist') self._colormales = get_value('colormales') self._colorfemales = get_value('colorfemales') self._colorunknown = get_value('colorunknown') self._colorfamilies = get_value('colorfamilies') self._limitparents = get_value('limitparents') self._maxparents = get_value('maxparents') self._limitchildren = get_value('limitchildren') self._maxchildren = get_value('maxchildren') self._incimages = get_value('incimages') self._imageonside = get_value('imageonside') self._imagesize = get_value('imagesize') self._useroundedcorners = get_value('useroundedcorners') self._usesubgraphs = get_value('usesubgraphs') self._incdates = get_value('incdates') self._just_years = get_value('justyears') self._incplaces = get_value('incplaces') self._incchildcount = get_value('incchildcnt') self.includeid = get_value('inc_id') arrow_str = get_value('arrow') if 'd' in arrow_str: self._arrowheadstyle = 'normal' else: self._arrowheadstyle = 'none' if 'a' in arrow_str: self._arrowtailstyle = 'normal' else: self._arrowtailstyle = 'none' # the gidlist is annoying for us to use since we always have to convert # the GIDs to either Person or to handles, so we may as well convert the # entire list right now and not have to deal with it ever again self._interest_set = set() if not self._gidlist: raise ReportError(_('Empty report'), _('You did not specify anybody')) for gid in self._gidlist.split(): person = self._db.get_person_from_gramps_id(gid) if person: #option can be from another family tree, so person can be None self._interest_set.add(person.get_handle()) stdoptions.run_name_format_option(self, menu) # convert the 'surnamecolors' string to a dictionary of names and colors self._surnamecolors = {} tmp = get_value('surnamecolors') if tmp.find('\xb0') >= 0: # new style delimiter (see bug report #2162) tmp = tmp.split('\xb0') else: # old style delimiter tmp = tmp.split(' ') while len(tmp) > 1: surname = tmp.pop(0).encode('iso-8859-1', 'xmlcharrefreplace') colour = tmp.pop(0) self._surnamecolors[surname] = colour self._colorize = get_value('color')
def __init__(self, database, options, user): """ Create RelGraphReport 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. arrow - Arrow styles for heads and tails. showfamily - Whether to show family nodes. inc_id - Whether to include IDs. url - Whether to include URLs. inclimg - Include images or not imgpos - Image position, above/beside name color - Whether to use outline, colored outline or filled color in graph color_males - Colour to apply to males color_females - Colour to apply to females color_unknown - Colour to apply to unknown genders color_families - Colour to apply to families dashed - Whether to use dashed lines for non-birth relationships use_roundedcorners - Whether to use rounded corners for females name_format - Preferred format to display names incl_private - Whether to include private data event_choice - Whether to include dates and/or places occupation - Whether to include occupations 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 get_option_by_name = options.menu.get_option_by_name get_value = lambda name: get_option_by_name(name).get_value() 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.includeid = get_value('inc_id') self.includeurl = get_value('url') self.includeimg = get_value('includeImages') self.imgpos = get_value('imageOnTheSide') self.use_roundedcorners = get_value('useroundedcorners') self.adoptionsdashed = get_value('dashed') self.show_families = get_value('showfamily') self.use_subgraphs = get_value('usesubgraphs') self.event_choice = get_value('event_choice') self.occupation = get_value('occupation') self.use_html_output = False self.colorize = get_value('color') color_males = get_value('colormales') color_females = get_value('colorfemales') color_unknown = get_value('colorunknown') color_families = get_value('colorfamilies') self.colors = { 'male': color_males, 'female': color_females, 'unknown': color_unknown, 'family': color_families } arrow_str = get_value('arrow') if 'd' in arrow_str: self.arrowheadstyle = 'normal' else: self.arrowheadstyle = 'none' if 'a' in arrow_str: self.arrowtailstyle = 'normal' else: self.arrowtailstyle = 'none' filter_option = get_option_by_name('filter') self._filter = filter_option.get_filter() stdoptions.run_name_format_option(self, menu) pid = get_value('pid') 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.increlname = get_value('increlname') if self.increlname: self.rel_calc = get_relationship_calculator(reinit=True, clocale=self._locale) if __debug__: self.advrelinfo = get_value('advrelinfo') else: self.advrelinfo = False
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 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()) stdoptions.run_date_format_option(self, menu) stdoptions.run_private_data_option(self, menu) living_opt = stdoptions.run_living_people_option(self, menu, self._locale) self.database = CacheProxyDb(self.database) self._db = self.database self._lv = menu.get_option_by_name('living_people').get_value() for (value, description) in living_opt.get_items(xml_items=True): if value == self._lv: living_desc = self._(description) break self.living_desc = self._("(Living people: %(option_name)s)" ) % {'option_name': living_desc} places = menu.get_option_by_name('places').get_value() self.center = menu.get_option_by_name('center').get_value() stdoptions.run_name_format_option(self, menu) self._nd = self._name_display self.place_format = menu.get_option_by_name("place_format").get_value() filter_option = menu.get_option_by_name('filter') self.filter = filter_option.get_filter() self.sort = Sort(self._db) self.place_handles = [] if self.filter.get_name() != '': # Use the selected filter to provide a list of place handles plist = self._db.iter_place_handles() self.place_handles = self.filter.apply(self._db, plist, user=self._user) 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)
def __init__(self, database, options, user): Report.__init__(self, database, options, user) self.set_locale(options.menu.get_option_by_name('trans').get_value()) stdoptions.run_date_format_option(self, options.menu) stdoptions.run_name_format_option(self, options.menu) self.database = database self._gidlist = options.menu.get_option_by_name( 'gidlist').get_value().split() self._withparents = options.menu.get_option_by_name( 'withparents').get_value() self._withchildren = options.menu.get_option_by_name( 'withchildren').get_value() self._withspouses = options.menu.get_option_by_name( 'withspouses').get_value() self._usesubgraphs = options.menu.get_option_by_name( 'usesubgraphs').get_value() self.fillcolor = { Person.MALE: options.menu.get_option_by_name('colormales').get_value(), Person.FEMALE: options.menu.get_option_by_name('colorfemales').get_value(), Person.UNKNOWN: options.menu.get_option_by_name('colorunknown').get_value() } self.nodestyle = { Person.MALE: 'solid', Person.FEMALE: 'rounded', Person.UNKNOWN: 'solid' } self.nodeshape = { Person.MALE: 'box', Person.FEMALE: 'box', Person.UNKNOWN: 'hexagon' } symbols = Symbols() self.symbols = { Person.FEMALE: symbols.get_symbol_for_string(symbols.SYMBOL_FEMALE), Person.MALE: symbols.get_symbol_for_string(symbols.SYMBOL_MALE), Person.UNKNOWN: symbols.get_symbol_for_string(symbols.SYMBOL_ASEXUAL_SEXLESS), 'birth': symbols.get_symbol_for_string(symbols.SYMBOL_BIRTH), 'death': symbols.get_death_symbol_for_char( symbols.DEATH_SYMBOL_LATIN_CROSS), 'illegitimate': symbols.get_symbol_for_string(symbols.SYMBOL_ILLEGITIM), 'kia': symbols.get_symbol_for_string(symbols.SYMBOL_KILLED_IN_ACTION), # marriage symbols display with extra linebreaks in Graphviz family nodes # todo: using fallbacks for now 'engaged': symbols.get_symbol_fallback(symbols.SYMBOL_ENGAGED), 'married': symbols.get_symbol_fallback(symbols.SYMBOL_MARRIAGE), 'unmarried': symbols.get_symbol_fallback(symbols.SYMBOL_UNMARRIED_PARTNERSHIP), 'divorced': symbols.get_symbol_fallback(symbols.SYMBOL_DIVORCE) }
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 inc_id - Whether to include Gramps IDs """ 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.max_generations = menu.get_option_by_name('gen').get_value() self.want_ids = menu.get_option_by_name('inc_id').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 is None: raise ReportError(_("Person %s is not in the Database") % pid) #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 == "Henry": obj = PrintHenry() elif numbering == "Modified Henry": obj = PrintHenry(modified=True) elif numbering == "d'Aboville": obj = PrintDAboville() elif numbering == "de Villiers/Pama": obj = PrintVilliers() elif numbering == "Meurgey de Tupigny": obj = PrintMeurgey() else: raise AttributeError("no such numbering: '%s'" % 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.obj_print = Printinfo(self.doc, self.database, obj, marrs, divs, self._name_display, self._locale, self.want_ids)
def __init__(self, database, options, user): """ Create the DetAncestorReport 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. inc_id - Whether to include Gramps IDs pagebgg - Whether to include page breaks between generations. pageben - Whether to include page break before End Notes. firstName - Whether to use first names instead of pronouns. fulldate - Whether to use full dates instead of just year. listchildren - Whether to list children. list_children_spouses - Whether to list the spouses of the children includenotes - Whether to include notes. incattrs - Whether to include attributes blankplace - Whether to replace missing Places with ___________. blankDate - Whether to replace missing Dates with ___________. calcageflag - Whether to compute age. dupperson - Whether to omit duplicate ancestors (e.g. when distant cousins marry). verbose - Whether to use complete sentences childref - Whether to add descendant references in child list. addimages - Whether to include images. pid - The Gramps ID of the center person for the report. name_format - Preferred format to display names other_events - Whether to include other events. 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.map = {} 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.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_generations = get_value('gen') self.pgbrk = get_value('pagebbg') self.pgbrkenotes = get_value('pageben') self.fulldate = get_value('fulldates') use_fulldate = self.fulldate self.listchildren = get_value('listc') self.list_children_spouses = get_value('listc_spouses') self.includenotes = get_value('incnotes') use_call = get_value('usecall') blankplace = get_value('repplace') blankdate = get_value('repdate') self.calcageflag = get_value('computeage') self.dupperson = get_value('omitda') self.verbose = get_value('verbose') self.childref = get_value('desref') self.addimages = get_value('incphotos') self.inc_names = get_value('incnames') self.inc_events = get_value('incevents') self.inc_addr = get_value('incaddresses') self.inc_sources = get_value('incsources') self.inc_srcnotes = get_value('incsrcnotes') self.inc_attrs = get_value('incattrs') self.initial_sosa = get_value('initial_sosa') self.want_ids = get_value('inc_id') pid = get_value('pid') self.other_events = get_value('incotherevents') 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) stdoptions.run_name_format_option(self, menu) self._nd = self._name_display self.place_format = menu.get_option_by_name("place_format").get_value() self.gen_handles = {} self.prev_gen_handles = {} if blankdate: empty_date = EMPTY_ENTRY else: empty_date = "" if blankplace: empty_place = EMPTY_ENTRY else: empty_place = "" self.__narrator = Narrator(self._db, self.verbose, use_call, use_fulldate, empty_date, empty_place, nlocale=self._locale, place_format=self.place_format, get_endnote_numbers=self.endnotes) self.bibli = Bibliography(Bibliography.MODE_DATE | Bibliography.MODE_PAGE)
def __init__(self, database, options, user): """ Create RelGraphReport 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. arrow - Arrow styles for heads and tails. showfamily - Whether to show family nodes. inc_id - Whether to include IDs. url - Whether to include URLs. inclimg - Include images or not imgpos - Image position, above/beside name color - Whether to use outline, colored outline or filled color in graph color_males - Colour to apply to males color_females - Colour to apply to females color_unknown - Colour to apply to unknown genders color_families - Colour to apply to families dashed - Whether to use dashed lines for non-birth relationships use_roundedcorners - Whether to use rounded corners for females name_format - Preferred format to display names incl_private - Whether to include private data event_choice - Whether to include dates and/or places occupation - Whether to include occupations 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 get_option_by_name = options.menu.get_option_by_name get_value = lambda name: get_option_by_name(name).get_value() 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.includeid = get_value('inc_id') self.includeurl = get_value('url') self.includeimg = get_value('includeImages') self.imgpos = get_value('imageOnTheSide') self.use_roundedcorners = get_value('useroundedcorners') self.adoptionsdashed = get_value('dashed') self.show_families = get_value('showfamily') self.use_subgraphs = get_value('usesubgraphs') self.event_choice = get_value('event_choice') self.occupation = get_value('occupation') self.use_html_output = False self.colorize = get_value('color') color_males = get_value('colormales') color_females = get_value('colorfemales') color_unknown = get_value('colorunknown') color_families = get_value('colorfamilies') self.colors = { 'male': color_males, 'female': color_females, 'unknown': color_unknown, 'family': color_families } arrow_str = get_value('arrow') if 'd' in arrow_str: self.arrowheadstyle = 'normal' else: self.arrowheadstyle = 'none' if 'a' in arrow_str: self.arrowtailstyle = 'normal' else: self.arrowtailstyle = 'none' filter_option = get_option_by_name('filter') self._filter = filter_option.get_filter() stdoptions.run_name_format_option(self, menu) pid = get_value('pid') 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.increlname = get_value('increlname') if self.increlname: self.rel_calc = get_relationship_calculator(reinit=True, clocale=self._locale) if __debug__: self.advrelinfo = get_value('advrelinfo') else: self.advrelinfo = False
def __init__(self, database, options, user): """ Create the DetAncestorReport 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. inc_id - Whether to include Gramps IDs pagebgg - Whether to include page breaks between generations. pageben - Whether to include page break before End Notes. firstName - Whether to use first names instead of pronouns. fulldate - Whether to use full dates instead of just year. listchildren - Whether to list children. list_children_spouses - Whether to list the spouses of the children includenotes - Whether to include notes. incattrs - Whether to include attributes blankplace - Whether to replace missing Places with ___________. blankDate - Whether to replace missing Dates with ___________. calcageflag - Whether to compute age. dupperson - Whether to omit duplicate ancestors (e.g. when distant cousins marry). verbose - Whether to use complete sentences childref - Whether to add descendant references in child list. addimages - Whether to include images. pid - The Gramps ID of the center person for the report. name_format - Preferred format to display names other_events - Whether to include other events. 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.map = {} 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.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_generations = get_value('gen') self.pgbrk = get_value('pagebbg') self.pgbrkenotes = get_value('pageben') self.fulldate = get_value('fulldates') use_fulldate = self.fulldate self.listchildren = get_value('listc') self.list_children_spouses = get_value('listc_spouses') self.includenotes = get_value('incnotes') use_call = get_value('usecall') blankplace = get_value('repplace') blankdate = get_value('repdate') self.calcageflag = get_value('computeage') self.dupperson = get_value('omitda') self.verbose = get_value('verbose') self.childref = get_value('desref') self.addimages = get_value('incphotos') self.inc_names = get_value('incnames') self.inc_events = get_value('incevents') self.inc_addr = get_value('incaddresses') self.inc_sources = get_value('incsources') self.inc_srcnotes = get_value('incsrcnotes') self.inc_attrs = get_value('incattrs') self.initial_sosa = get_value('initial_sosa') self.want_ids = get_value('inc_id') pid = get_value('pid') self.other_events = get_value('incotherevents') 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) stdoptions.run_name_format_option(self, menu) self._nd = self._name_display self.gen_handles = {} self.prev_gen_handles = {} if blankdate: empty_date = EMPTY_ENTRY else: empty_date = "" if blankplace: empty_place = EMPTY_ENTRY else: empty_place = "" self.__narrator = Narrator(self._db, self.verbose, use_call, use_fulldate, empty_date, empty_place, nlocale=self._locale, get_endnote_numbers=self.endnotes) self.bibli = Bibliography(Bibliography.MODE_DATE|Bibliography.MODE_PAGE)
def __init__(self, database, options, user): """ Create the DetDescendantReport 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. inc_id - Whether to include Gramps IDs pagebgg - Whether to include page breaks between generations. pageben - Whether to include page break before End Notes. fulldates - Whether to use full dates instead of just year. listc - Whether to list children. list_children_spouses - Whether to list the spouses of the children incnotes - Whether to include notes. usecall - Whether to use the call name as the first name. repplace - Whether to replace missing Places with ___________. repdate - Whether to replace missing Dates with ___________. computeage - Whether to compute age. verbose - Whether to use complete sentences. numbering - The descendancy numbering system to be utilized. desref - Whether to add descendant references in child list. incphotos - Whether to include images. incnames - Whether to include other names. incevents - Whether to include events. incaddresses - Whether to include addresses. incsrcnotes - Whether to include source notes in the Endnotes section. Only works if Include sources is selected. incmates - Whether to include information about spouses incattrs - Whether to include attributes incpaths - Whether to include the path of descendancy from the start-person to each descendant. incssign - Whether to include a sign ('+') before the descendant number in the child-list to indicate a child has succession. pid - The Gramps ID of the center person for the report. name_format - Preferred format to display names incmateref - Whether to print mate information or reference 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 structure - How to structure the report """ Report.__init__(self, database, options, user) self.map = {} 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.set_locale(get_value('trans')) 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_generations = get_value('gen') self.pgbrk = get_value('pagebbg') self.pgbrkenotes = get_value('pageben') self.fulldate = get_value('fulldates') use_fulldate = self.fulldate self.listchildren = get_value('listc') self.list_children_spouses = get_value('listc_spouses') self.inc_notes = get_value('incnotes') use_call = get_value('usecall') blankplace = get_value('repplace') blankdate = get_value('repdate') self.calcageflag = get_value('computeage') self.verbose = get_value('verbose') self.numbering = get_value('numbering') self.childref = get_value('desref') self.addimages = get_value('incphotos') self.structure = get_value('structure') self.inc_names = get_value('incnames') self.inc_events = get_value('incevents') self.inc_addr = get_value('incaddresses') self.inc_sources = get_value('incsources') self.inc_srcnotes = get_value('incsrcnotes') self.inc_mates = get_value('incmates') self.inc_attrs = get_value('incattrs') self.inc_paths = get_value('incpaths') self.inc_ssign = get_value('incssign') self.inc_materef = get_value('incmateref') self.want_ids = get_value('inc_id') pid = get_value('pid') 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.gen_handles = {} self.prev_gen_handles = {} self.gen_keys = [] self.dnumber = {} self.dmates = {} self.numbers_printed = list() if blankdate: empty_date = EMPTY_ENTRY else: empty_date = "" if blankplace: empty_place = EMPTY_ENTRY else: empty_place = "" stdoptions.run_name_format_option(self, menu) self.__narrator = Narrator(self._db, self.verbose, use_call, use_fulldate, empty_date, empty_place, nlocale=self._locale, get_endnote_numbers=self.endnotes) self.bibli = Bibliography(Bibliography.MODE_DATE|Bibliography.MODE_PAGE)
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 inc_id - Whether to include Gramps IDs """ 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.max_generations = menu.get_option_by_name('gen').get_value() self.want_ids = menu.get_option_by_name('inc_id').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 is None: raise ReportError(_("Person %s is not in the Database") % pid) #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 == "Henry": obj = PrintHenry() elif numbering == "Modified Henry": obj = PrintHenry(modified=True) elif numbering == "d'Aboville": obj = PrintDAboville() elif numbering == "de Villiers/Pama": obj = PrintVilliers() elif numbering == "Meurgey de Tupigny": obj = PrintMeurgey() else: raise AttributeError("no such numbering: '%s'" % 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) pformat = menu.get_option_by_name("place_format").get_value() self.obj_print = Printinfo(self.doc, self.database, obj, marrs, divs, self._name_display, self._locale, self.want_ids, pformat)