Changes

From Gramps

Учебник по написанию отчетов

1,252 bytes added, 07:02, 25 November 2025
Обзор: Translated into Russian
==Обзор==
Before going into detailsПеред тем, it is useful to note that the report should have two basic partsкак углубляться в детали, полезно отметить, что отчет должен состоять из двух основных частей. This is explained on the Как объяснено на странице [[Addons development|Разработка дополнений]] page, that the source code goes into two different filesисходный код распределяется по двум различным файлам:  # the Файл регистрации дополнения Gramps Plugin Registration (''*.gpr.py'') file e.g., как например: <code>report.gpr.py</code># and the main source code file и основной файл исходного кода (''*.py'') e.g., например: <code>report.py</code>
===report.gpr.py===
;Registration statement Код регистрации : This initializes the report by a single call to the Этот код, инициализирующий отчет, состоит из единственного вызова функции <tt>[https://gramps-project.org/docs/gen/gen_plug.html#gramps.gen.plug._pluginreg.register register()]</tt> function. It is trivialЭто простое действие, but without it your report will not become available to без которого отчет, как бы хорош он не был, не будет доступен в Gramps, even if it is otherwise perfectly written.
A report can potentially be generated as a standalone reportЛюбой отчет Gramps может быть выполнен в одном из трех режимов: как автономный отчет, as a как элемент Книги Gramps Book item, and as a command line reportа так же может быть запущен из командной строки. The registration determines which modes are enabled for a given report. The report class does not have to know anything about the modeКод регистрации сообщает Gramps, в каких из этих режимов отчет может быть выполнен. The options class is there to provide options interface for all available modesКласс Report не должен ничего знать о режиме выполнения: класс Options предназначен для реализации соответствующего интерфейса задания параметров отчета для всех режимов запуска.
* [[Report-writing_tutorialУчебник_по_написанию_отчетов#Registering_the_reportРегистрация_отчета]]
===report.py===
;Код класса Report class : This is the code that takes data from the Содержит код, который получает данные из базы данных Gramps database and organizes it into the document structureи организует их в структуру документа. This structure can later be printedЭта структура может быть затем напечатана, viewed, or written into a file in a variety of formatsпросмотрена или записана в файл в различных форматах. This class uses the Этот класс использует интерфейс [https://gramps-project.org/docs/gen/gen_plug.html#module-gramps.gen.plug._docgenplugin docgen] interface to abstract away the output format detailsчтобы абстрагироваться от формата вывода. ;Код класса Options class : This is the code that provides means to obtain options necessary for the report using a variety of available mechanismsСодержит код, дающий возможность задать необходимые для отчёта параметры, используя множество различных механизмов передачи параметров.
==Интерфейс создания документа==
64
edits

Navigation menu