示例#1
0
    def write_report(self):
        """
        The routine that actually creates the report.
        At this point, the document is opened and ready for writing.
        """
        pname = self._name_display.display(self.center_person)

        self.doc.start_paragraph("EOL-Title")
        # feature request 2356: avoid genitive form
        title = self._("End of Line Report for %s") % pname
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.doc.start_paragraph("EOL-Subtitle")
        # feature request 2356: avoid genitive form
        title = self._(
            "All the ancestors of %s who are missing a parent") % pname
        self.doc.write_text(title)
        self.doc.end_paragraph()

        self.doc.start_table('EolTable', 'EOL-Table')
        for generation, handles in self.eol_map.items():
            self.write_generation_row(generation)
            for person_handle, pedigrees in handles.items():
                self.write_person_row(person_handle)
                list(map(self.write_pedigree_row, pedigrees))
        self.doc.end_table()
示例#2
0
    def write_report(self):
        """
        Overridden function to generate the report.
        """
        Dict_list = []

        PrintDate = datetime.datetime.now().strftime("%Y-%m-%d")
        PrintTime = datetime.datetime.now().strftime("%H:%M")

        self.doc.start_paragraph("SR-Title")
        title = self._("Database Summary Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.doc.start_paragraph("SR-Normal")
        self.doc.write_text(
            self._("Date: %s") % f"{datetime.datetime.now(): %d.%m.%Y}")
        self.doc.end_paragraph()

        self.read_csv(Dict_list)

        self.summarize_people()
        #Dict_list.append(sorted(peC))
        #self.write_csv(Dict_list)
        self.summarize_families()
示例#3
0
 def cite_sources(self, obj):
     """
     Cite any sources for the object and add them to the bibliography.
     
     @param bibliography: The bibliography to contain the citations.
     @type bibliography: L{Bibliography}
     @param obj: An object with source references.
     @type obj: L{gramps.gen.lib.CitationBase}
     """
     txt = ""
     slist = obj.get_citation_list()
     if slist:
         self.doc.start_superscript()
         first = 1
         for ref in slist:
             if not first:
                 txt += ', '
                 self.doc.write_text(", ")
             first = 0
             self.citation_list += [ref]
             self.cindex += 1
             text = "%d" % (self.cindex)
             mark = IndexMark("#endnote" + text, LOCAL_HYPERLINK)
             self.doc.write_text(text, mark=mark)
         self.doc.end_superscript()
     return txt
    def write_report(self):
        """
        The routine that actually creates the report.
        At this point, the document is opened and ready for writing.
        """

        # Write the title line. Set in INDEX marker so that this section will be
        # identified as a major category if this is included in a Book report.

        title = self._("all persons Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)        
        self.doc.start_paragraph("PLC-ReportTitle")
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.doc.start_table("PersonTable", "PLC-EventTable")
        column_titles = [_("LNr"), _("handle"), _("Person")] 
                    
        self.doc.start_row()
        for title in column_titles:
            self.doc.start_cell("PLC-Details")
            self.doc.start_paragraph("PLC-Details")
            self.doc.write_text(title)
            self.doc.end_paragraph()
            self.doc.end_cell()
        self.doc.end_row()     

        self.__write_all_persons()
示例#5
0
    def write_report(self):
        mark_text = _("Custom Text")
        if self.top_text[0]:
            mark_text = "%s (%s)" % (_("Custom Text"), self.top_text[0])
        elif self.middle_text[0]:
            mark_text = "%s (%s)" % (_("Custom Text"), self.middle_text[0])
        elif self.bottom_text[0]:
            mark_text = "%s (%s)" % (_("Custom Text"), self.bottom_text[0])
        mark = IndexMark(mark_text, INDEX_TYPE_TOC, 1)
        self.doc.start_paragraph('CBT-Initial')
        for line in self.top_text:
            self.doc.write_text(line, mark)
            self.doc.write_text("\n")
        self.doc.end_paragraph()

        self.doc.start_paragraph('CBT-Middle')
        for line in self.middle_text:
            self.doc.write_text(line)
            self.doc.write_text("\n")
        self.doc.end_paragraph()

        self.doc.start_paragraph('CBT-Final')
        for line in self.bottom_text:
            self.doc.write_text(line)
            self.doc.write_text("\n")
        self.doc.end_paragraph()
示例#6
0
    def write_report(self):
        """
        The routine that actually creates the report.
        At this point, the document is opened and ready for writing.
        """

        # Write the title line. Set in INDEX marker so that this section will be
        # identified as a major category if this is included in a Book report.

        title = self._("Ledigenquote und Verheiratetenanteile ")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)        
        self.doc.start_paragraph("PLC-ReportTitle")
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.doc.start_paragraph("PLC-Section")
        self.doc.write_text("Enthält alle Personen, die in diesem Ort geboren oder getauft wurden")
        self.doc.end_paragraph()
        self.doc.start_table("LEQUODETTable", "SRC-LEQUODETTable")
        column_titles = [_("person"), _("name"), _("ID"), _("m/w"), _("birth"), _("death"),("marriage"), _("place")] 
        i = 0
        self.doc.start_row()
        for title in column_titles:
            self.doc.start_cell("SRC-TableColumn")
            self.doc.start_paragraph("SRC-ColumnTitle")
            self.doc.write_text(title)
            self.doc.end_paragraph()
            self.doc.end_cell()
        self.doc.end_row()

        self.__write_data()

        self.doc.end_table()
示例#7
0
    def write_report(self):
        self.bibli = Bibliography(self.database, self.doc)
        self.print_citations = False

        level = 1

        # ------------------------------------------------------------------
        self.doc.start_paragraph("PE-Title")
        name = self._name_display.display(self.center_person)
        title = _("All information about %s") % name
        mark = IndexMark(title, INDEX_TYPE_TOC)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()
        self.print_person_summary(level, self.center_person)
        self.print_person_details(level, self.center_person)
        # ------------------------------------------------------------------
        self.doc.page_break()
        self.doc.start_paragraph("PE-Title")
        self.doc.write_text(_("Person Events"))
        self.doc.end_paragraph()
        self.print_events(level, self.center_person)
        # ------------------------------------------------------------------
        self.doc.page_break()
        self.doc.start_paragraph("PE-Title")
        self.doc.write_text(_("Families"))
        self.doc.end_paragraph()
        self.print_families(level, self.center_person)
        # ------------------------------------------------------------------
        self.doc.page_break()
        self.doc.start_paragraph("PE-Title")
        self.doc.write_text(_("Endnotes"))
        self.doc.end_paragraph()
        self.bibli.write_endnotes(self.print_header, self.print_object)
    def write_report(self):
        """
        Overridden function to generate the report.
        """
        self.doc.start_paragraph("SRC-ReportTitle")
        title = self.title_string
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.doc.start_paragraph("SRC-ReportTitle")
        title = self.subtitle_string
        mark = IndexMark(title, INDEX_TYPE_TOC, 2)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.listeventref()
示例#9
0
 def write_report(self):
     """ Generate the contents of the report """
     mark = IndexMark(self._("Table Of Contents"), INDEX_TYPE_TOC, 1)
     self.doc.start_paragraph("TOC-Title")
     self.doc.write_text('', mark)
     self.doc.end_paragraph()
     self.doc.toc_title = self._('Contents')
     self.doc.insert_toc()
示例#10
0
 def write_report(self):
     """ Generate the contents of the report """
     mark = IndexMark(self._("Alphabetical Index"), INDEX_TYPE_TOC, 1)
     self.doc.start_paragraph("IDX-Title")
     self.doc.write_text('', mark)
     self.doc.end_paragraph()
     self.doc.index_title = self._('Index')
     self.doc.insert_index()
示例#11
0
 def write_report(self):
     """
     The short method that runs through each month and creates a page.
     """
     # initialize the dict to fill:
     self.calendar = {}
     # get the information, first from holidays:
     if self.country != 0:
         self.__get_holidays()
     # get data from database:
     self.collect_data()
     # generate the report:
     self.doc.start_paragraph('BIR-Title')
     if self.titletext == _(_TITLE0):
         title = self._("%(str1)s: %(str2)s") % {
             'str1': self._(_TITLE0),
             'str2': self._get_date(Date(self.year))
         }  # localized year
     else:
         title = self._("%(str1)s: %(str2)s") % {
             'str1': str(self.titletext),
             'str2': self._get_date(Date(self.year))
         }
     mark = IndexMark(title, INDEX_TYPE_TOC, 1)
     self.doc.write_text(title, mark)
     self.doc.end_paragraph()
     if self.text1.strip() != "":
         self.doc.start_paragraph('BIR-Text1style')
         text1 = str(self.text1)
         if text1 == _(_TITLE1):
             text1 = self._(_TITLE1)
         self.doc.write_text(text1)
         self.doc.end_paragraph()
     if self.text2.strip() != "":
         self.doc.start_paragraph('BIR-Text2style')
         text2 = str(self.text2)
         if text2 == _(_TITLE2):
             text2 = self._(_TITLE2)
         self.doc.write_text(text2)
         self.doc.end_paragraph()
     if self.text3.strip() != "":
         self.doc.start_paragraph('BIR-Text3style')
         self.doc.write_text(str(self.text3))
         self.doc.end_paragraph()
     if self.relationships:
         name = self.center_person.get_primary_name()
         self.doc.start_paragraph('BIR-Text3style')
         mark = utils.get_person_mark(self.database, self.center_person)
         # feature request 2356: avoid genitive form
         self.doc.write_text(
             self._("Relationships shown are to %s") %
             self._name_display.display_name(name), mark)
         self.doc.end_paragraph()
     with self._user.progress(_('Birthday and Anniversary Report'),
                              _('Formatting months...'), 12) as step:
         for month in range(1, 13):
             step()
             self.print_page(month)
    def __write_all_places(self, pl_format):
        """
        This procedure writes out each of the selected places.
        """
        place_nbr = 1

        with self._user.progress(_("PlaceFamily Report"),
                                 _("Generating report"),
                                 len(self.place_handles)) as step:

            subtitle = self._("Places")
            mark = IndexMark(subtitle, INDEX_TYPE_TOC, 2)
            self.doc.start_paragraph("PLC-ReportSubtitle")
            self.doc.write_text(subtitle, mark)
            self.doc.end_paragraph()

            self.doc.start_paragraph("PLC-Section")
            self.doc.write_text(
                "Enthält alle Familien mit Hochzeitsereignis in diesem Ort")
            self.doc.end_paragraph()

            for handle in self.place_handles:
                if handle:
                    self.doc.start_paragraph("PLC-Section")
                    printplace = self.database.get_place_from_handle(
                        handle).get_title()

                    indexplace = printplace + " L_INDEX"
                    #                    indexplace = printplace+" ' \f 'O'"
                    mark = IndexMark(indexplace, INDEX_TYPE_ALP)
                    #mark = IndexMark(indexplace, INDEX_TYPE_ALP, iname="HUHUHU")
                    print(mark.key, mark.type, mark.level)
                    self.doc.write_text(printplace, mark)
                    #                    self.doc.write_text(self.database.get_place_from_handle(handle).get_title(),mark)
                    self.doc.end_paragraph()
                place_nbr += 1
                # increment progress bar
                step()

            subtitle = self._("Families")
            mark = IndexMark(subtitle, INDEX_TYPE_TOC, 2)
            self.doc.start_paragraph("PLC-ReportSubtitle")
            self.doc.write_text(subtitle, mark)
            self.doc.end_paragraph()
示例#13
0
    def output_barchart(self, title1, typename, data, lookup):

        pt2cm = utils.pt2cm
        style_sheet = self.doc.get_style_sheet()
        pstyle = style_sheet.get_paragraph_style('SC-Text')
        font = pstyle.get_font()

        # set layout variables
        width = self.doc.get_usable_width()
        row_h = pt2cm(font.get_size())
        max_y = self.doc.get_usable_height() - row_h
        pad = row_h * 0.5

        # check maximum value
        max_value = max(data[k] for k in lookup) if lookup else 0
        # horizontal area for the gfx bars
        margin = 1.0
        middle = width/2.0
        textx = middle + margin/2.0
        stopx = middle - margin/2.0
        maxsize = stopx - margin

        # start output
        pstyle = style_sheet.get_paragraph_style('SC-Title')
        mark = IndexMark(title1, INDEX_TYPE_TOC, 2)
        self.doc.center_text('SC-title', title1, middle, 0, mark)
        yoffset = pt2cm(pstyle.get_font().get_size())
        self.doc.center_text('SC-title', self.fil_name, middle, yoffset)
        yoffset = 2 * pt2cm(pstyle.get_font().get_size())
        self.doc.center_text('SC-title', self.living_desc, middle, yoffset)
        yoffset = 3 * pt2cm(pstyle.get_font().get_size())

        # header
        yoffset += (row_h + pad)
        text = self._("%s (persons):") % self._(typename)
        self.doc.draw_text('SC-text', text, textx, yoffset)

        for key in lookup:
            yoffset += (row_h + pad)
            if yoffset > max_y:
            # for graphical report, page_break() doesn't seem to work
                self.doc.end_page()
                self.doc.start_page()
                yoffset = 0

            # right align bar to the text
            value = data[key]
            startx = stopx - (maxsize * value / max_value)
            self.doc.draw_box('SC-bar', "",
                              startx, yoffset, stopx-startx, row_h)
            # text after bar
            text = "%s (%d)" % (self._(key), data[key])
            self.doc.draw_text('SC-text', text, textx, yoffset)

        return
示例#14
0
    def write_report(self):
        """
        Build the actual report.
        """

        records = find_records(self.database,
                               self.filter,
                               self.top_size,
                               self.callname,
                               trans_text=self._,
                               name_format=self._nf)

        self.doc.start_paragraph('REC-Title')
        title = self._("Records")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.doc.start_paragraph('REC-Subtitle')
        self.doc.write_text(self.filter.get_name(self._locale))
        self.doc.end_paragraph()

        for (text, varname, top) in records:
            if not self.include[varname]:
                continue

            self.doc.start_paragraph('REC-Heading')
            self.doc.write_text(self._(text))
            self.doc.end_paragraph()

            last_value = None
            rank = 0
            for (number, (sort, value, name, handletype,
                          handle)) in enumerate(top):
                # FIXME check whether person or family, if a family mark BOTH
                person = self.database.get_person_from_handle(handle)
                mark = ReportUtils.get_person_mark(self.database, person)
                if value != last_value:
                    last_value = value
                    rank = number
                self.doc.start_paragraph('REC-Normal')
                # FIXME this won't work for RTL languages:
                self.doc.write_text(
                    self._("%(number)s. ") % {'number': rank + 1})
                self.doc.write_markup(str(name), name.get_tags(), mark)
                if isinstance(value, Span):
                    tvalue = value.get_repr(dlocale=self._locale)
                else:
                    tvalue = value
                self.doc.write_text(" (%s)" % tvalue)
                self.doc.end_paragraph()

        self.doc.start_paragraph('REC-Footer')
        self.doc.write_text(self.footer)
        self.doc.end_paragraph()
示例#15
0
    def display(self):
        """ display the title box.  """
        if self.page.y_page_num or self.boxstr == "None":
            return

        #Set up the Table of Contents here
        mark = IndexMark(self.text, INDEX_TYPE_TOC, 1)

        if self.text:
            self.doc.center_text(self.boxstr, self.text, self.width / 2,
                                 self.y_cm, mark)
示例#16
0
 def write_people(self, title, people_handles):
     """
     Write information about a group of people - including the title.
     """
     cap_title = title[0].upper() + title[1:]
     subtitle = "%s (%d)" % (cap_title, len(people_handles))
     self.doc.start_paragraph("KIN-Subtitle")
     mark = IndexMark(cap_title, INDEX_TYPE_TOC, 2)
     self.doc.write_text(subtitle, mark)
     self.doc.end_paragraph()
     list(map(self.write_person, people_handles))
示例#17
0
    def write_report(self):
        self.doc.start_paragraph("DR-Title")
        name = self._name_display.display(self.center_person)
        # feature request 2356: avoid genitive form
        title = self._("Descendants of %s") % name
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        recurse = RecurseDown(self.max_generations, self.database,
                              self.objPrint, self._showdups, self._locale)
        recurse.recurse(1, self.center_person, None)
示例#18
0
    def write_report(self):
        """
        Overridden function to generate the report.
        """
        self.doc.start_paragraph("SR-Title")
        title = self._("Database Summary Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.summarize_people()
        self.summarize_families()
        self.summarize_media()
示例#19
0
    def write_report(self):
        """
        The routine the actually creates the report. At this point, the document
        is opened and ready for writing.
        """
        # Write the title line. Set in INDEX marker so that this section will be
        # identified as a major category if this is included in a Book report.

        title = _("Repositories Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.start_paragraph("REPO-ReportTitle")
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()
        self.__write_all_repositories()
示例#20
0
 def write_report(self):
     """
     Overridden function to generate the report.
     """
     self.progress = ProgressMeter(_("PUK Export"), '')
     self.doc.start_paragraph("SRC-ReportTitle")
     title = self.title_string
     mark = IndexMark(title, INDEX_TYPE_TOC, 1)  
     self.doc.write_text(title, mark)
     self.doc.end_paragraph()
     
     self.doc.start_paragraph("SRC-ReportTitle")
     title = self.subtitle_string
     mark = IndexMark(title, INDEX_TYPE_TOC, 1)  
     self.doc.write_text(title, mark)
     self.doc.end_paragraph()
     
     self.listpersonref()
     
     self.doc.start_paragraph('SRC-Footer')
     self.doc.write_text(self.footer_string)
     self.doc.end_paragraph()
     self.progress.close()
示例#21
0
    def write_report(self):
        """
        Overridden function to generate the report.
        """
        self._user.begin_progress(_('PeopleCitationsEventRoleRelationReport'),
                                  _('printing...'), 0)
        self.doc.start_paragraph("SRC-ReportTitle")
        title = self.title_string
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.doc.start_paragraph("SRC-ReportTitle")
        title = self.subtitle_string
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.listpersonref()

        self.doc.start_paragraph('SRC-Footer')
        self.doc.write_text(self.footer_string)
        self.doc.end_paragraph()
        self._user.end_progress()
示例#22
0
    def write_report(self):
        """
        The routine the actually creates the report. At this point, the document
        is opened and ready for writing.
        """
        pname = self._name_display.display(self.person)
        
        self.doc.start_paragraph("KIN-Title")
        # feature request 2356: avoid genitive form
        title = self._("Kinship Report for %s") % pname
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        if self.inc_spouses:
            spouse_handles = self.get_spouse_handles(self.person.get_handle())
            if spouse_handles:
                self.write_people(self._("Spouses"), spouse_handles)

        # Collect all descendants of the person
        self.traverse_down(self.person.get_handle(), 0, 1)
        
        # Collect all ancestors/aunts/uncles/nephews/cousins of the person
        self.traverse_up(self.person.get_handle(), 1, 0)
                
        # Write Kin
        for Ga, Gbs in self.kinship_map.items():
            for Gb in Gbs:
                # To understand these calculations, see: 
                # http://en.wikipedia.org/wiki/Cousin#Mathematical_definitions
                x = min (Ga, Gb)
                y = abs(Ga-Gb)
                # Skip unrequested people
                if x == 1 and y > 0 and not self.inc_aunts:
                    continue
                elif x > 1 and not self.inc_cousins:
                    continue
                
                get_rel_str = self.rel_calc.get_plural_relationship_string
                
                title = get_rel_str(Ga, Gb, in_law_b=False)
                self.write_people(self._(title), self.kinship_map[Ga][Gb])
                
                if (self.inc_spouses and
                   Ga in self.spouse_map and
                   Gb in self.spouse_map[Ga]):
                    title = get_rel_str(Ga, Gb, in_law_b=True)
                    self.write_people(self._(title), self.spouse_map[Ga][Gb])
示例#23
0
    def dump_family(self, family_handle, generation):
        self.doc.start_paragraph('FGR-Title')
        if self.recursive and self.generations:
            title = self._("Family Group Report - Generation %d") % generation
        else:
            title = self._("Family Group Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        family = self.database.get_family_from_handle(family_handle)

        self.dump_parent(self._("Husband"), family.get_father_handle())
        self.doc.start_paragraph("FGR-blank")
        self.doc.end_paragraph()

        if self.incParMar:
            self.dump_marriage(family)
            self.doc.start_paragraph("FGR-blank")
            self.doc.end_paragraph()

        self.dump_parent(self._("Wife"), family.get_mother_handle())

        length = len(family.get_child_ref_list())
        if length > 0:
            self.doc.start_paragraph("FGR-blank")
            self.doc.end_paragraph()
            self.doc.start_table('FGR-Children', 'FGR-ChildTable')
            self.doc.start_row()
            self.doc.start_cell('FGR-ParentHead', 4)
            self.doc.start_paragraph('FGR-ParentName')
            self.doc.write_text(self._("Children"))
            self.doc.end_paragraph()
            self.doc.end_cell()
            self.doc.end_row()
            index = 1
            for child_ref in family.get_child_ref_list():
                self.dump_child(index, child_ref.ref)
                index += 1
            self.doc.end_table()

        if self.recursive:
            for child_ref in family.get_child_ref_list():
                child = self.database.get_person_from_handle(child_ref.ref)
                for child_family_handle in child.get_family_handle_list():
                    if child_family_handle != family_handle:
                        self.doc.page_break()
                        self.dump_family(child_family_handle, (generation + 1))
示例#24
0
    def write_report(self):

        if len(report_titles) > 0:
            report_titles.clear()

        if len(report_person_ref) > 0:
            report_person_ref.clear()

        self.ca = CollectAscendants(self.database, self.user, self.title)
        self.ascendants = self.ca.collect_data(self.filter, self.center_person)

        if len(self.ascendants) > 1:
            self.user.begin_progress(self.title,
                                 _('Writing %s reports...') % \
                                 (len(self.ascendants)), len(self.ascendants))

            # If there is only one item, then no need for a table
            # of contents, however if we have more than one lets generate one
            self.write_toc()

        report_count = 0
        for person_handle in self.ascendants:
            if len(self.ascendants) > 1:
                self.user.step_progress()

            person = self.database.get_person_from_handle(person_handle)

            self.doc.start_paragraph("DR-Title")
            name = self._name_display.display(person)
            if len(self.ascendants) > 1:
                report_count = report_count + 1
                report_titles[report_count] = \
                    _("%s. Descendants of %s") % (report_count, name)
            else:
                report_titles[report_count] = _("Descendants of %s") % name
            mark = IndexMark(report_titles[report_count], INDEX_TYPE_TOC, 1)
            self.doc.write_text(report_titles[report_count], mark)
            self.doc.end_paragraph()

            recurse = RecurseDown(self.max_generations, self.database,
                                self.objPrint, self._showdups, report_count)
            recurse.recurse(1, person, None)

            self.doc.page_break()


        if len(self.ascendants) > 1:
            self.user.end_progress()
示例#25
0
    def write_report(self):
        """
        Overridden function to generate the report.
        """
        self.doc.start_paragraph("SR-Title")
        title = self._("Database Summary Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()
		
		
        self.doc.start_paragraph("SR-Normal")
        self.doc.write_text(self._("Date: %s") % f"{datetime.datetime.now(): %d.%m.%Y}")
        self.doc.end_paragraph()
		
        self.summarize_people()
        self.summarize_families()
示例#26
0
 def write_report(self):
     self.doc.start_paragraph("TR-Title")
     # feature request 2356: avoid genitive form
     title = self._("Tag Report for %s Items") % self.tag
     mark = IndexMark(title, INDEX_TYPE_TOC, 1)
     self.doc.write_text(title, mark)
     self.doc.end_paragraph()
     
     self.write_people()
     self.write_families()
     self.write_events()
     self.write_places()
     self.write_notes()
     self.write_media()
     self.write_repositories()
     self.write_sources()
     self.write_citations()
示例#27
0
文件: timeline.py 项目: oluul/gramps
 def draw_title(self, toc):
     """
     Draws the title for the page.
     """
     width = self.doc.get_usable_width()
     title_one = self._("Timeline Chart")
     title_two = "%(str1)s -- %(str2)s" % {
                     'str1' : self.filter.get_name(self._locale),
                     # feature request 2356: avoid genitive form
                     'str2' : self._("Sorted by %s") % self.sort_name }
     mark = None
     if toc:
         mark = IndexMark(title_one, INDEX_TYPE_TOC, 1)
     self.doc.center_text('TLG-title', title_one, width / 2.0, 0, mark)
     style_sheet = self.doc.get_style_sheet()
     title_font = style_sheet.get_paragraph_style('TLG-Title').get_font()
     title_y = 1.2 - (pt2cm(title_font.get_size()) * 1.2)
     self.doc.center_text('TLG-title', title_two, width / 2.0, title_y)
示例#28
0
    def write_report(self):
        "output the selected statistics..."

        mark = IndexMark(self._('Statistics Charts'), INDEX_TYPE_TOC, 1)
        self._user.begin_progress(_('Statistics Charts'),
                                  _('Saving charts...'), len(self.data))
        for data in sorted(self.data):
            self.doc.start_page()
            if mark:
                self.doc.draw_text('SC-title', '', 0, 0, mark) # put it in TOC
                mark = None # crock, but we only want one of them
            if len(data[3]) < self.bar_items:
                self.output_piechart(*data[:4])
            else:
                self.output_barchart(*data[:4])
            self.doc.end_page()
            self._user.step_progress()
        self._user.end_progress()
    def write_report(self):
        """
        The routine that actually creates the report.
        At this point, the document is opened and ready for writing.
        """

        # Write the title line. Set in INDEX marker so that this section will be
        # identified as a major category if this is included in a Book report.

        pl_format = self.pl_format
        title = self._("PlaceFamily Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.start_paragraph("PLC-ReportTitle")
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()

        self.__write_all_places(pl_format)
        self.__write_referenced_families(pl_format)
示例#30
0
    def write_report(self):
        """
        The routine the actually creates the report. At this point, the document
        is opened and ready for writing.
        """

        # Write the title line. Set in INDEX marker so that this section will be
        # identified as a major category if this is included in a Book report.

        if not self.inc_privat:
            self.database = gramps.gen.proxy.PrivateProxyDb(self.database)

        title = self._('Repositories Report')
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.start_paragraph('REPO-ReportTitle')
        self.doc.write_text(title, mark)
        self.doc.end_paragraph()
        self.__write_all_repositories()