===Определение класса отчета===
The actual implemention of the Фактическая реализация отчета <ttcode>DbSummaryDbSummaryReport</ttcode> report is rather simpleдовольно проста. No additional work needs to be done to initialize the classКакая-либо дополнительная работа для инициализации класса не требуется, so the parent так что просто вызваем метод <ttcode>__init__</ttcode> routine is calledбазового класса.
All the work is done in the Вся работа делается в методе <ttcode>write_report()</ttcode> function. This function uses a Он использует итератор [https://www.gramps-project.org/docs/gen/gen_db.html#gramps.gen.db.generic.DbGeneric.iter_people <ttcode>GrampsCursorself.database.iter_people()</ttcode> to iterate through the map of ] для последовательного перебора всех объектов класса [https://www.gramps-project.org/docs/gen/gen_lib.html#module-gramps.gen.lib.person <ttcode>Person</ttcode> objects and gathers some simple statistics] и сбора некоторой простой статистики. Единственная вещь, которая может рассматриваться как некоторое затруднение, это определение наиболее часто встречающейся фамилии. Для подсчета количества использований каждой фамилии используется словарь Питон. Всякий раз, когда некоторая фамилия встречается, счетчик значений для неё в словаре увеличивается. Результаты затем загружаются в список и сортируются, что позволяет нам найти наиболее часто встречающуюся фамилию просто посмотрев в конец списка.
The only thing of any complication is the determination of the most common surname. A python dictionary is used to store the number of times each surname is used. Each time a surname is encountered, the value in the dictionary is incremented. The results are then loaded into a list and sorted, allowing us to find the most common name by looking at the last entry in the list.
<pre>
class DbSummaryReport(Report):
</pre>
Append the above code to the Добавьте код выше в файл '''report.py''' file.
===Регистрация отчета===