Remove the "person" option from reports, report options, and report dialogs. Person is selected by the user for all reports.
svn: r10074
This commit is contained in:
parent
65951d6722
commit
cc6654ddab
37
ChangeLog
37
ChangeLog
@ -1,3 +1,40 @@
|
||||
2008-02-19 Brian Matherly <brian@gramps-project.org>
|
||||
* src/ReportBase/_WebReportDialog.py:
|
||||
* src/ReportBase/_ReportDialog.py:
|
||||
* src/ReportBase/_TextReportDialog.py:
|
||||
* src/ReportBase/_GraphvizReportDialog.py:
|
||||
* src/ReportBase/_DrawReportDialog.py:
|
||||
* src/ReportBase/_Report.py:
|
||||
* src/ReportBase/_DocReportDialog.py:
|
||||
* src/ReportBase/_CommandLineReport.py:
|
||||
* src/ReportBase/_BareReportDialog.py:
|
||||
* src/ReportBase/_ReportOptions.py:
|
||||
* src/plugins/WebCal.py:
|
||||
* src/plugins/KinshipReport.py:
|
||||
* src/plugins/DetDescendantReport.py:
|
||||
* src/plugins/DescendReport.py:
|
||||
* src/plugins/IndivComplete.py:
|
||||
* src/plugins/BookReport.py:
|
||||
* src/plugins/NarrativeWeb.py:
|
||||
* src/plugins/TimeLine.py:
|
||||
* src/plugins/GVFamilyLines.py:
|
||||
* src/plugins/Calendar.py:
|
||||
* src/plugins/AncestorReport.py:
|
||||
* src/plugins/MarkerReport.py:
|
||||
* src/plugins/DescendChart.py:
|
||||
* src/plugins/EndOfLineReport.py:
|
||||
* src/plugins/AncestorChart.py:
|
||||
* src/plugins/DetAncestralReport.py:
|
||||
* src/plugins/SimpleBookTitle.py:
|
||||
* src/plugins/CustomBookText.py:
|
||||
* src/plugins/FamilyGroup.py:
|
||||
* src/plugins/GVRelGraph.py:
|
||||
* src/plugins/GVHourGlass.py:
|
||||
* src/plugins/StatisticsChart.py:
|
||||
* src/plugins/FanChart.py:
|
||||
Remove the "person" option from reports, report options, and report dialogs.
|
||||
Person is selected by the user for all reports.
|
||||
|
||||
2008-02-19 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||
* src/plugins/DefaultGramplets.py: News renders text with styles
|
||||
* src/DataViews/GrampletView.py (GuiGramplet.render_text):
|
||||
|
@ -70,14 +70,13 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
|
||||
border_pad = 6
|
||||
HELP_TOPIC = None
|
||||
|
||||
def __init__(self,dbstate,uistate,person,option_class,
|
||||
name,translated_name,track=[]):
|
||||
def __init__(self, dbstate, uistate, option_class,
|
||||
name, translated_name, track=[]):
|
||||
"""Initialize a dialog to request that the user select options
|
||||
for a basic *bare* report."""
|
||||
self.raw_name = name
|
||||
self.dbstate = dbstate
|
||||
self.db = dbstate.db
|
||||
self.person = person
|
||||
self.report_name = translated_name
|
||||
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, track, self)
|
||||
@ -95,8 +94,6 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
|
||||
|
||||
def build_window_key(self,obj):
|
||||
key = self.raw_name
|
||||
if self.person:
|
||||
key += self.person.get_handle()
|
||||
return key
|
||||
|
||||
def build_menu_names(self,obj):
|
||||
@ -268,10 +265,7 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
|
||||
"""Set up the title bar of the dialog. This function relies
|
||||
on the get_title() customization function for what the title
|
||||
should be."""
|
||||
if self.person:
|
||||
self.name = name_displayer.display(self.person)
|
||||
else:
|
||||
self.name = ''
|
||||
self.name = ''
|
||||
self.window.set_title(self.get_title())
|
||||
|
||||
def setup_header(self):
|
||||
|
@ -229,7 +229,7 @@ def cl_report(database,name,category,report_class,
|
||||
clr.selected_style,
|
||||
BaseDoc.PaperStyle(clr.paper,clr.orien),
|
||||
clr.template_name)
|
||||
MyReport = report_class(database, clr.person, clr.option_class)
|
||||
MyReport = report_class(database, clr.option_class)
|
||||
MyReport.doc.init()
|
||||
MyReport.begin_report()
|
||||
MyReport.write_report()
|
||||
|
@ -57,14 +57,14 @@ class DocReportDialog(ReportDialog):
|
||||
dialogs for docgen derived reports.
|
||||
"""
|
||||
|
||||
def __init__(self,dbstate,uistate,person,option_class,name,trans_name):
|
||||
def __init__(self, dbstate, uistate, option_class, name, trans_name):
|
||||
"""Initialize a dialog to request that the user select options
|
||||
for a basic *stand-alone* report."""
|
||||
|
||||
self.style_name = "default"
|
||||
self.page_html_added = False
|
||||
ReportDialog.__init__(self,dbstate,uistate,person,option_class,
|
||||
name,trans_name)
|
||||
ReportDialog.__init__(self, dbstate, uistate, option_class,
|
||||
name, trans_name)
|
||||
|
||||
# Allow for post processing of the format frame, since the
|
||||
# show_all task calls events that may reset values
|
||||
|
@ -31,13 +31,13 @@ from _DrawFormatComboBox import DrawFormatComboBox
|
||||
#-----------------------------------------------------------------------
|
||||
class DrawReportDialog(DocReportDialog):
|
||||
"""A class of ReportDialog customized for drawing based reports."""
|
||||
def __init__(self,dbstate,uistate,person,opt,name,translated_name):
|
||||
def __init__(self, dbstate, uistate, opt, name, translated_name):
|
||||
"""Initialize a dialog to request that the user select options
|
||||
for a basic drawing report. See the ReportDialog class for
|
||||
more information."""
|
||||
self.category = CATEGORY_DRAW
|
||||
DocReportDialog.__init__(self,dbstate,uistate,person,opt,
|
||||
name,translated_name)
|
||||
DocReportDialog.__init__(self, dbstate, uistate, opt,
|
||||
name, translated_name)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -698,12 +698,12 @@ class GraphvizFormatComboBox(gtk.ComboBox):
|
||||
#-----------------------------------------------------------------------
|
||||
class GraphvizReportDialog(ReportDialog):
|
||||
"""A class of ReportDialog customized for graphviz based reports."""
|
||||
def __init__(self, dbstate, uistate, person, opt, name, translated_name):
|
||||
def __init__(self, dbstate, uistate, opt, name, translated_name):
|
||||
"""Initialize a dialog to request that the user select options
|
||||
for a graphiz report. See the ReportDialog class for
|
||||
more information."""
|
||||
self.category = CATEGORY_GRAPHVIZ
|
||||
ReportDialog.__init__(self, dbstate, uistate, person,opt,
|
||||
ReportDialog.__init__(self, dbstate, uistate, opt,
|
||||
name, translated_name)
|
||||
|
||||
def init_options(self, option_class):
|
||||
|
@ -34,9 +34,8 @@ class Report:
|
||||
sub-classed to create a functional report generator.
|
||||
"""
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
self.database = database
|
||||
self.start_person = person
|
||||
self.options_class = options_class
|
||||
|
||||
self.doc = options_class.get_document()
|
||||
|
@ -66,14 +66,14 @@ class ReportDialog(BareReportDialog):
|
||||
dialog for a stand-alone report.
|
||||
"""
|
||||
|
||||
def __init__(self, dbstate, uistate, person, option_class, name, trans_name,
|
||||
def __init__(self, dbstate, uistate, option_class, name, trans_name,
|
||||
track=[]):
|
||||
"""Initialize a dialog to request that the user select options
|
||||
for a basic *stand-alone* report."""
|
||||
|
||||
self.style_name = "default"
|
||||
self.page_html_added = False
|
||||
BareReportDialog.__init__(self, dbstate, uistate, person, option_class,
|
||||
BareReportDialog.__init__(self, dbstate, uistate, option_class,
|
||||
name, trans_name, track)
|
||||
|
||||
# Allow for post processing of the format frame, since the
|
||||
@ -290,21 +290,21 @@ def report(dbstate,uistate,person,report_class,options_class,
|
||||
dialog_class = WebReportDialog
|
||||
elif category in (CATEGORY_BOOK,CATEGORY_CODE,CATEGORY_VIEW):
|
||||
try:
|
||||
report_class(dbstate,uistate,person)
|
||||
report_class(dbstate,uistate)
|
||||
except Errors.WindowActiveError:
|
||||
pass
|
||||
return
|
||||
else:
|
||||
dialog_class = ReportDialog
|
||||
|
||||
dialog = dialog_class(dbstate,uistate,person,options_class,name,trans_name)
|
||||
dialog = dialog_class(dbstate, uistate, options_class, name, trans_name)
|
||||
|
||||
while True:
|
||||
response = dialog.window.run()
|
||||
if response == gtk.RESPONSE_OK:
|
||||
dialog.close()
|
||||
try:
|
||||
MyReport = report_class(dialog.db,dialog.person,dialog.options)
|
||||
MyReport = report_class(dialog.db, dialog.options)
|
||||
MyReport.doc.init()
|
||||
MyReport.begin_report()
|
||||
MyReport.write_report()
|
||||
|
@ -563,8 +563,8 @@ class OptionHandler(_Options.OptionHandler):
|
||||
"""
|
||||
Implements handling of the options for the plugins.
|
||||
"""
|
||||
def __init__(self,module_name,options_dict,person_id=None):
|
||||
_Options.OptionHandler.__init__(self,module_name,options_dict,person_id)
|
||||
def __init__(self,module_name,options_dict):
|
||||
_Options.OptionHandler.__init__(self, module_name, options_dict, None)
|
||||
|
||||
def init_subclass(self):
|
||||
self.collection_class = OptionListCollection
|
||||
@ -707,21 +707,20 @@ class ReportOptions(_Options.Options):
|
||||
This is a base Options class for the reports. All reports' options
|
||||
classes should derive from it.
|
||||
"""
|
||||
def __init__(self,name,person_id=None):
|
||||
def __init__(self, name, dbase):
|
||||
"""
|
||||
Initializes the class, performing usual house-keeping tasks.
|
||||
Subclasses MUST call this in their __init__() method.
|
||||
"""
|
||||
self.name = name
|
||||
self.person_id = person_id
|
||||
self.options_dict = {}
|
||||
self.options_help = {}
|
||||
self.handler = None
|
||||
|
||||
def load_previous_values(self):
|
||||
self.handler = OptionHandler(self.name,self.options_dict,self.person_id)
|
||||
self.handler = OptionHandler(self.name, self.options_dict)
|
||||
|
||||
def make_default_style(self,default_style):
|
||||
def make_default_style(self, default_style):
|
||||
"""
|
||||
Defines default style for this report.
|
||||
|
||||
@ -803,7 +802,7 @@ class MenuReportOptions(GuiMenuOptions,ReportOptions):
|
||||
|
||||
"""
|
||||
def __init__(self, name, dbase):
|
||||
ReportOptions.__init__(self, name, None)
|
||||
ReportOptions.__init__(self, name, dbase)
|
||||
GuiMenuOptions.__init__(self)
|
||||
|
||||
def load_previous_values(self):
|
||||
|
@ -32,13 +32,13 @@ from _TextFormatComboBox import TextFormatComboBox
|
||||
class TextReportDialog(DocReportDialog):
|
||||
"""A class of ReportDialog customized for text based reports."""
|
||||
|
||||
def __init__(self,dbstate,uistate,person,options,name,translated_name):
|
||||
def __init__(self, dbstate, uistate, options, name, translated_name):
|
||||
"""Initialize a dialog to request that the user select options
|
||||
for a basic text report. See the ReportDialog class for more
|
||||
information."""
|
||||
self.category = CATEGORY_TEXT
|
||||
DocReportDialog.__init__(self,dbstate,uistate,person,options,
|
||||
name,translated_name)
|
||||
DocReportDialog.__init__(self, dbstate, uistate, options,
|
||||
name, translated_name)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -18,7 +18,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
# $Id:$
|
||||
# $Id$
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -39,11 +39,10 @@ class WebReportDialog(ReportDialog):
|
||||
dialogs for web page reports.
|
||||
"""
|
||||
|
||||
def __init__(self, dbstate, uistate, person,
|
||||
option_class, name, trans_name):
|
||||
def __init__(self, dbstate, uistate, option_class, name, trans_name):
|
||||
"""Initialize a dialog"""
|
||||
self.category = CATEGORY_WEB
|
||||
ReportDialog.__init__(self, dbstate, uistate, person, option_class,
|
||||
ReportDialog.__init__(self, dbstate, uistate, option_class,
|
||||
name, trans_name)
|
||||
|
||||
def setup_target_frame(self):
|
||||
|
@ -158,7 +158,7 @@ class GenChart:
|
||||
#------------------------------------------------------------------------
|
||||
class AncestorChart(Report):
|
||||
|
||||
def __init__(self,database,person,options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates AncestorChart object that produces the report.
|
||||
|
||||
@ -178,7 +178,7 @@ class AncestorChart(Report):
|
||||
indblank - Whether to include blank pages.
|
||||
compress - Whether to compress chart.
|
||||
"""
|
||||
Report.__init__(self,database,person,options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
menu = options_class.menu
|
||||
self.display = menu.get_option_by_name('dispf').get_value()
|
||||
|
@ -60,7 +60,7 @@ class AncestorReport(Report):
|
||||
"""
|
||||
Ancestor Report class
|
||||
"""
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the AncestorReport object that produces the Ahnentafel report.
|
||||
|
||||
@ -78,7 +78,7 @@ class AncestorReport(Report):
|
||||
|
||||
"""
|
||||
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
self.map = {}
|
||||
|
||||
|
@ -473,8 +473,6 @@ class BookList:
|
||||
option_type = Utils.type_name(option_value)
|
||||
f.write(' <option name="%s" type="%s" value="%s"/>\n' % (
|
||||
option_name,option_type,option_value) )
|
||||
f.write(' <person gramps_id="%s"/>\n' %
|
||||
option_handler.get_person_id() )
|
||||
f.write(' <style name="%s"/>\n' % item.get_style_name() )
|
||||
f.write(' </item>\n')
|
||||
f.write('</book>\n')
|
||||
@ -521,7 +519,6 @@ class BookParser(handler.ContentHandler):
|
||||
self.an_o_name = None
|
||||
self.an_o_value = None
|
||||
self.s = None
|
||||
self.p = None
|
||||
self.bname = None
|
||||
self.iname = None
|
||||
|
||||
@ -550,8 +547,8 @@ class BookParser(handler.ContentHandler):
|
||||
self.an_o_value.append(converter(attrs['value']))
|
||||
elif tag == "style":
|
||||
self.s = attrs['name']
|
||||
elif tag == "person":
|
||||
self.p = attrs['gramps_id']
|
||||
else:
|
||||
pass
|
||||
|
||||
def endElement(self, tag):
|
||||
"Overridden class that handles the end of a XML element"
|
||||
@ -559,7 +556,6 @@ class BookParser(handler.ContentHandler):
|
||||
self.o[self.an_o_name] = self.an_o_value
|
||||
elif tag == "item":
|
||||
self.i.option_class.handler.options_dict.update(self.o)
|
||||
self.i.option_class.handler.set_person_id(self.p)
|
||||
self.i.set_style_name(self.s)
|
||||
self.b.append_item(self.i)
|
||||
elif tag == "book":
|
||||
@ -665,8 +661,8 @@ class BookOptions(ReportOptions):
|
||||
Defines options and provides handling interface.
|
||||
"""
|
||||
|
||||
def __init__(self, name, person_id=None):
|
||||
ReportOptions.__init__(self, name, person_id)
|
||||
def __init__(self, name, dbase):
|
||||
ReportOptions.__init__(self, name, dbase)
|
||||
|
||||
# Options specific for this report
|
||||
self.options_dict = {
|
||||
@ -691,11 +687,10 @@ class BookReportSelector(ManagedWindow.ManagedWindow):
|
||||
and to clear/load/save/edit whole books.
|
||||
"""
|
||||
|
||||
def __init__(self, dbstate, uistate, person):
|
||||
def __init__(self, dbstate, uistate):
|
||||
self.db = dbstate.db
|
||||
self.dbstate = dbstate
|
||||
self.uistate = uistate
|
||||
self.person = person
|
||||
self.title = _('Book Report')
|
||||
self.file = "books.xml"
|
||||
|
||||
@ -986,7 +981,7 @@ class BookReportSelector(ManagedWindow.ManagedWindow):
|
||||
Run final BookReportDialog with the current book.
|
||||
"""
|
||||
if self.book.item_list:
|
||||
BookReportDialog(self.dbstate, self.uistate, self.person,
|
||||
BookReportDialog(self.dbstate, self.uistate,
|
||||
self.book, BookOptions)
|
||||
self.close()
|
||||
|
||||
@ -1038,7 +1033,7 @@ class BookItemDialog(ReportDialog):
|
||||
self.category = CATEGORY_BOOK
|
||||
self.database = dbstate.db
|
||||
self.option_class = option_class
|
||||
ReportDialog.__init__(self, dbstate, uistate, None,
|
||||
ReportDialog.__init__(self, dbstate, uistate,
|
||||
option_class, name, translated_name, track)
|
||||
|
||||
def on_ok_clicked(self, obj):
|
||||
@ -1071,14 +1066,13 @@ class BookReportDialog(DocReportDialog):
|
||||
Creates a dialog selecting target, format, and paper/HTML options.
|
||||
"""
|
||||
|
||||
def __init__(self, dbstate, uistate, person, book, options):
|
||||
def __init__(self, dbstate, uistate, book, options):
|
||||
self.options = options
|
||||
self.page_html_added = False
|
||||
DocReportDialog.__init__(self, dbstate, uistate, person, options,
|
||||
DocReportDialog.__init__(self, dbstate, uistate, options,
|
||||
'book', _("Book Report"))
|
||||
self.book = book
|
||||
self.database = dbstate.db
|
||||
self.person = person
|
||||
self.selected_style = BaseDoc.StyleSheet()
|
||||
|
||||
for item in self.book.get_item_list():
|
||||
@ -1153,7 +1147,7 @@ class BookReportDialog(DocReportDialog):
|
||||
for item in self.book.get_item_list():
|
||||
item.option_class.set_document(self.doc)
|
||||
report_class = item.get_write_item()
|
||||
obj = write_book_item(self.database, self.person,
|
||||
obj = write_book_item(self.database,
|
||||
report_class, item.option_class)
|
||||
self.rptlist.append(obj)
|
||||
self.doc.open(self.target_path)
|
||||
@ -1219,7 +1213,7 @@ def cl_report(database, name, category, options_str_dict):
|
||||
for item in book.get_item_list():
|
||||
item.option_class.set_document(doc)
|
||||
report_class = item.get_write_item()
|
||||
obj = write_book_item(database, clr.person,
|
||||
obj = write_book_item(database,
|
||||
report_class, item.option_class)
|
||||
rptlist.append(obj)
|
||||
|
||||
@ -1239,14 +1233,11 @@ def cl_report(database, name, category, options_str_dict):
|
||||
# Generic task function for book report
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def write_book_item(database, person, report_class, options_class):
|
||||
def write_book_item(database, report_class, options_class):
|
||||
"""Write the Timeline Graph using options set.
|
||||
All user dialog has already been handled and the output file opened."""
|
||||
try:
|
||||
if options_class.handler.get_person_id():
|
||||
person = database.get_person_from_gramps_id(
|
||||
options_class.handler.get_person_id())
|
||||
return report_class(database, person, options_class)
|
||||
return report_class(database, options_class)
|
||||
except Errors.ReportError, msg:
|
||||
(m1, m2) = msg.messages()
|
||||
ErrorDialog(m1, m2)
|
||||
|
@ -116,8 +116,8 @@ class Calendar(Report):
|
||||
"""
|
||||
Creates the Calendar object that produces the report.
|
||||
"""
|
||||
def __init__(self, database, person, options_class):
|
||||
Report.__init__(self, database, person, options_class)
|
||||
def __init__(self, database, options_class):
|
||||
Report.__init__(self, database, options_class)
|
||||
menu = options_class.menu
|
||||
if 'titletext' in menu.get_all_option_names():
|
||||
# report and graphic share most of the same code
|
||||
|
@ -51,7 +51,7 @@ import BaseDoc
|
||||
#------------------------------------------------------------------------
|
||||
class CustomText(Report):
|
||||
|
||||
def __init__(self,database,person,options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates CustomText object that produces the report.
|
||||
|
||||
@ -68,7 +68,7 @@ class CustomText(Report):
|
||||
mid - Text in the middle.
|
||||
bot - Text on the bottom.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
menu = options_class.menu
|
||||
self.top_text = menu.get_option_by_name('top').get_value()
|
||||
|
@ -101,7 +101,7 @@ class GenChart:
|
||||
#------------------------------------------------------------------------
|
||||
class DescendChart(Report):
|
||||
|
||||
def __init__(self,database,person,options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates DescendChart object that produces the report.
|
||||
|
||||
@ -118,7 +118,7 @@ class DescendChart(Report):
|
||||
singlep - Whether to scale to fit on a single page.
|
||||
maxgen - Maximum number of generations to include.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
menu = options_class.menu
|
||||
self.display = menu.get_option_by_name('dispf').get_value()
|
||||
|
@ -53,7 +53,7 @@ _DIED = _('d.')
|
||||
#------------------------------------------------------------------------
|
||||
class DescendantReport(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the DescendantReport object that produces the report.
|
||||
|
||||
@ -70,7 +70,7 @@ class DescendantReport(Report):
|
||||
|
||||
"""
|
||||
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
menu = options_class.menu
|
||||
self.max_generations = menu.get_option_by_name('gen').get_value()
|
||||
|
@ -60,7 +60,7 @@ EMPTY_ENTRY = "_____________"
|
||||
#------------------------------------------------------------------------
|
||||
class DetAncestorReport(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the DetAncestorReport object that produces the report.
|
||||
|
||||
@ -89,7 +89,7 @@ class DetAncestorReport(Report):
|
||||
addimages - Whether to include images.
|
||||
pid - The Gramps ID of the center person for the report.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
self.map = {}
|
||||
|
||||
|
@ -62,7 +62,7 @@ HENRY = "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
#------------------------------------------------------------------------
|
||||
class DetDescendantReport(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the DetDescendantReport object that produces the report.
|
||||
|
||||
@ -92,7 +92,7 @@ class DetDescendantReport(Report):
|
||||
addimages - Whether to include images.
|
||||
pid - The Gramps ID of the center person for the report.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
self.map = {}
|
||||
|
||||
|
@ -48,7 +48,7 @@ import DateHandler
|
||||
#------------------------------------------------------------------------
|
||||
class EndOfLineReport(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the EndOfLineReport object that produces the report.
|
||||
|
||||
@ -62,7 +62,7 @@ class EndOfLineReport(Report):
|
||||
that come in the options class.
|
||||
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
menu = options_class.menu
|
||||
pid = menu.get_option_by_name('pid').get_value()
|
||||
|
@ -44,7 +44,7 @@ from BasicUtils import name_displayer as _nd
|
||||
#------------------------------------------------------------------------
|
||||
class FamilyGroup(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the DetAncestorReport object that produces the report.
|
||||
|
||||
@ -60,7 +60,7 @@ class FamilyGroup(Report):
|
||||
family_handle - Handle of the family to write report on.
|
||||
includeAttrs - Whether to include attributes
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
menu = options_class.menu
|
||||
|
||||
self.family_handle = None
|
||||
|
@ -64,7 +64,7 @@ pt2cm = ReportUtils.pt2cm
|
||||
#------------------------------------------------------------------------
|
||||
class FanChart(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the FanChart object that produces the report.
|
||||
|
||||
@ -102,7 +102,7 @@ class FanChart(Report):
|
||||
text_style_name = 'text_style' + '%d' % i
|
||||
self.text_style.append(text_style_name)
|
||||
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
self.height = 0
|
||||
self.lines = 0
|
||||
|
@ -234,7 +234,7 @@ class FamilyLinesOptions(MenuReportOptions):
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class FamilyLinesReport(Report):
|
||||
def __init__(self, database, person, options):
|
||||
def __init__(self, database, options):
|
||||
"""
|
||||
Creates FamilyLinesReport object that eventually produces the report.
|
||||
|
||||
@ -244,7 +244,7 @@ class FamilyLinesReport(Report):
|
||||
person - currently selected person
|
||||
options - instance of the FamilyLinesOptions class for this report
|
||||
"""
|
||||
Report.__init__(self,database,person,options)
|
||||
Report.__init__(self, database, options)
|
||||
|
||||
# initialize several convenient variables
|
||||
self.options = options
|
||||
|
@ -50,11 +50,11 @@ class HourGlassReport(Report):
|
||||
"""
|
||||
An hourglass report displays ancestors and descendants of a center person.
|
||||
"""
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates HourGlass object that produces the report.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
self.__db = database
|
||||
|
||||
menu = options_class.menu
|
||||
|
@ -72,7 +72,7 @@ _ARROWS = [ { 'name' : _("Descendants <- Ancestors"), 'value' : 'd' },
|
||||
#------------------------------------------------------------------------
|
||||
class RelGraphReport(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates ComprehensiveAncestorsReport object that produces the report.
|
||||
|
||||
@ -100,7 +100,7 @@ class RelGraphReport(Report):
|
||||
color - Whether to use outline, colored outline or filled color in graph
|
||||
dashed - Whether to use dashed lines for non-birth relationships.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
colored = {
|
||||
'male': 'dodgerblue4',
|
||||
|
@ -53,7 +53,7 @@ from QuestionDialog import WarningDialog
|
||||
#------------------------------------------------------------------------
|
||||
class IndivCompleteReport(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the IndivCompleteReport object that produces the report.
|
||||
|
||||
@ -72,7 +72,7 @@ class IndivCompleteReport(Report):
|
||||
cites - Whether or not to include source informaiton.
|
||||
"""
|
||||
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
menu = options_class.menu
|
||||
self.use_srcs = menu.get_option_by_name('cites').get_value()
|
||||
@ -150,7 +150,7 @@ class IndivCompleteReport(Report):
|
||||
self.doc.end_row()
|
||||
|
||||
def write_note(self):
|
||||
notelist = self.start_person.get_note_list()
|
||||
notelist = self.person.get_note_list()
|
||||
if not notelist:
|
||||
return
|
||||
self.doc.start_table('note','IDS-IndTable')
|
||||
@ -178,7 +178,7 @@ class IndivCompleteReport(Report):
|
||||
|
||||
def write_alt_parents(self):
|
||||
|
||||
if len(self.start_person.get_parent_family_handle_list()) < 2:
|
||||
if len(self.person.get_parent_family_handle_list()) < 2:
|
||||
return
|
||||
|
||||
self.doc.start_table("altparents","IDS-IndTable")
|
||||
@ -190,10 +190,10 @@ class IndivCompleteReport(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
|
||||
family_handle_list = self.start_person.get_parent_family_handle_list()
|
||||
family_handle_list = self.person.get_parent_family_handle_list()
|
||||
for family_handle in family_handle_list:
|
||||
if family_handle == \
|
||||
self.start_person.get_main_parents_family_handle():
|
||||
self.person.get_main_parents_family_handle():
|
||||
continue
|
||||
|
||||
family = self.database.get_family_from_handle(family_handle)
|
||||
@ -201,7 +201,7 @@ class IndivCompleteReport(Report):
|
||||
# Get the mother and father relationships
|
||||
frel = ""
|
||||
mrel = ""
|
||||
child_handle = self.start_person.get_handle()
|
||||
child_handle = self.person.get_handle()
|
||||
child_ref_list = family.get_child_ref_list()
|
||||
for child_ref in child_ref_list:
|
||||
if child_ref.ref == child_handle:
|
||||
@ -232,7 +232,7 @@ class IndivCompleteReport(Report):
|
||||
|
||||
def write_alt_names(self):
|
||||
|
||||
if len(self.start_person.get_alternate_names()) < 1:
|
||||
if len(self.person.get_alternate_names()) < 1:
|
||||
return
|
||||
|
||||
self.doc.start_table("altnames","IDS-IndTable")
|
||||
@ -244,7 +244,7 @@ class IndivCompleteReport(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
|
||||
for name in self.start_person.get_alternate_names():
|
||||
for name in self.person.get_alternate_names():
|
||||
name_type = str( name.get_type() )
|
||||
self.doc.start_row()
|
||||
self.normal_cell(name_type)
|
||||
@ -260,7 +260,7 @@ class IndivCompleteReport(Report):
|
||||
|
||||
def write_addresses(self):
|
||||
|
||||
alist = self.start_person.get_address_list()
|
||||
alist = self.person.get_address_list()
|
||||
|
||||
if len(alist) == 0:
|
||||
return
|
||||
@ -290,7 +290,7 @@ class IndivCompleteReport(Report):
|
||||
|
||||
def write_families(self):
|
||||
|
||||
if not len(self.start_person.get_family_handle_list()):
|
||||
if not len(self.person.get_family_handle_list()):
|
||||
return
|
||||
|
||||
self.doc.start_table("three","IDS-IndTable")
|
||||
@ -302,9 +302,9 @@ class IndivCompleteReport(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
|
||||
for family_handle in self.start_person.get_family_handle_list():
|
||||
for family_handle in self.person.get_family_handle_list():
|
||||
family = self.database.get_family_from_handle(family_handle)
|
||||
if self.start_person.get_handle() == family.get_father_handle():
|
||||
if self.person.get_handle() == family.get_father_handle():
|
||||
spouse_id = family.get_mother_handle()
|
||||
else:
|
||||
spouse_id = family.get_father_handle()
|
||||
@ -357,7 +357,7 @@ class IndivCompleteReport(Report):
|
||||
self.doc.end_cell()
|
||||
self.doc.end_row()
|
||||
|
||||
event_ref_list = self.start_person.get_event_ref_list()
|
||||
event_ref_list = self.person.get_event_ref_list()
|
||||
for event_ref in event_ref_list:
|
||||
if event_ref:
|
||||
self.write_fact(event_ref)
|
||||
@ -385,7 +385,7 @@ class IndivCompleteReport(Report):
|
||||
|
||||
count = 0
|
||||
for person_handle in ind_list:
|
||||
self.start_person = self.database.get_person_from_handle(
|
||||
self.person = self.database.get_person_from_handle(
|
||||
person_handle)
|
||||
self.write_person(count)
|
||||
count = count + 1
|
||||
@ -395,8 +395,8 @@ class IndivCompleteReport(Report):
|
||||
self.doc.page_break()
|
||||
self.bibli = Bibliography(Bibliography.MODE_PAGE)
|
||||
|
||||
media_list = self.start_person.get_media_list()
|
||||
name = _nd.display(self.start_person)
|
||||
media_list = self.person.get_media_list()
|
||||
name = _nd.display(self.person)
|
||||
title = _("Summary of %s") % name
|
||||
mark = BaseDoc.IndexMark(title,BaseDoc.INDEX_TYPE_TOC,1)
|
||||
self.doc.start_paragraph("IDS-Title")
|
||||
@ -424,9 +424,9 @@ class IndivCompleteReport(Report):
|
||||
|
||||
self.doc.start_row()
|
||||
self.normal_cell("%s:" % _("Name"))
|
||||
name = self.start_person.get_primary_name()
|
||||
name = self.person.get_primary_name()
|
||||
text = _nd.display_name(name)
|
||||
mark = ReportUtils.get_person_mark(self.database, self.start_person)
|
||||
mark = ReportUtils.get_person_mark(self.database, self.person)
|
||||
endnotes = ""
|
||||
if self.use_srcs:
|
||||
endnotes = Endnotes.cite_source(self.bibli,name)
|
||||
@ -435,15 +435,15 @@ class IndivCompleteReport(Report):
|
||||
|
||||
self.doc.start_row()
|
||||
self.normal_cell("%s:" % _("Gender"))
|
||||
if self.start_person.get_gender() == gen.lib.Person.MALE:
|
||||
if self.person.get_gender() == gen.lib.Person.MALE:
|
||||
self.normal_cell(_("Male"))
|
||||
elif self.start_person.get_gender() == gen.lib.Person.FEMALE:
|
||||
elif self.person.get_gender() == gen.lib.Person.FEMALE:
|
||||
self.normal_cell(_("Female"))
|
||||
else:
|
||||
self.normal_cell(_("Unknown"))
|
||||
self.doc.end_row()
|
||||
|
||||
family_handle = self.start_person.get_main_parents_family_handle()
|
||||
family_handle = self.person.get_main_parents_family_handle()
|
||||
if family_handle:
|
||||
family = self.database.get_family_from_handle(family_handle)
|
||||
father_inst_id = family.get_father_handle()
|
||||
|
@ -50,7 +50,7 @@ import DateHandler
|
||||
#------------------------------------------------------------------------
|
||||
class KinshipReport(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the KinshipReport object that produces the report.
|
||||
|
||||
@ -70,7 +70,7 @@ class KinshipReport(Report):
|
||||
incaunts - Whether to include aunts/uncles/nephews/nieces.
|
||||
pid - The Gramps ID of the center person for the report.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
menu = options_class.menu
|
||||
self.max_descend = menu.get_option_by_name('maxdescend').get_value()
|
||||
|
@ -50,7 +50,7 @@ import DateHandler
|
||||
#------------------------------------------------------------------------
|
||||
class MarkerReport(Report):
|
||||
|
||||
def __init__(self,database,person,options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the MarkerReport object that produces the report.
|
||||
|
||||
@ -65,7 +65,7 @@ class MarkerReport(Report):
|
||||
|
||||
marker - The marker each object must match to be included.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
menu = options_class.menu
|
||||
self.marker = menu.get_option_by_name('marker').get_value()
|
||||
|
||||
|
@ -2363,7 +2363,7 @@ class IndividualPage(BasePage):
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class NavWebReport(Report):
|
||||
def __init__(self, database, person, options):
|
||||
def __init__(self, database, options):
|
||||
"""
|
||||
Creates WebReport object that produces the report.
|
||||
|
||||
@ -2373,7 +2373,7 @@ class NavWebReport(Report):
|
||||
person - currently selected person
|
||||
options - instance of the Options class for this report
|
||||
"""
|
||||
Report.__init__(self, database, person, options)
|
||||
Report.__init__(self, database, options)
|
||||
menu = options.menu
|
||||
self.opts = {}
|
||||
|
||||
@ -2675,7 +2675,7 @@ class NavWebOptions(MenuReportOptions):
|
||||
"""
|
||||
__INCLUDE_LIVING_VALUE = 99 # Arbitrary number
|
||||
|
||||
def __init__(self, name, dbase, person_id=None):
|
||||
def __init__(self, name, dbase):
|
||||
self.__db = dbase
|
||||
self.__archive = None
|
||||
self.__target = None
|
||||
@ -2685,7 +2685,7 @@ class NavWebOptions(MenuReportOptions):
|
||||
self.__graphgens = None
|
||||
self.__living = None
|
||||
self.__yearsafterdeath = None
|
||||
MenuReportOptions.__init__(self, name, person_id)
|
||||
MenuReportOptions.__init__(self, name, dbase)
|
||||
|
||||
def add_menu_options(self, menu):
|
||||
"""
|
||||
|
@ -55,7 +55,7 @@ import ThumbNails
|
||||
#------------------------------------------------------------------------
|
||||
class SimpleBookTitle(Report):
|
||||
|
||||
def __init__(self,database,person,options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates SimpleBookTitle object that produces the report.
|
||||
|
||||
@ -75,7 +75,7 @@ class SimpleBookTitle(Report):
|
||||
footer - Footer string.
|
||||
"""
|
||||
|
||||
Report.__init__(self,database,person,options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
|
||||
self.title_string = options_class.handler.options_dict['title']
|
||||
self.image_size = options_class.handler.options_dict['imgsize']
|
||||
@ -119,8 +119,8 @@ class SimpleBookTitleOptions(ReportOptions):
|
||||
Defines options and provides handling interface.
|
||||
"""
|
||||
|
||||
def __init__(self,name,person_id=None):
|
||||
ReportOptions.__init__(self,name,person_id)
|
||||
def __init__(self, name, dbase):
|
||||
ReportOptions.__init__(self, name, dbase)
|
||||
|
||||
# Options specific for this report
|
||||
self.options_dict = {
|
||||
|
@ -462,7 +462,7 @@ _Extract = Extract()
|
||||
#------------------------------------------------------------------------
|
||||
class StatisticsChart(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the Statistics object that produces the report.
|
||||
Uses the Extractor class to extract the data from the database.
|
||||
@ -475,7 +475,7 @@ class StatisticsChart(Report):
|
||||
|
||||
To see what the options are, check the options help in the options class.
|
||||
"""
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
menu = options_class.menu
|
||||
|
||||
self.filter_option = menu.get_option_by_name('filter')
|
||||
|
@ -66,7 +66,7 @@ def _get_sort_functions(sort):
|
||||
#------------------------------------------------------------------------
|
||||
class TimeLine(Report):
|
||||
|
||||
def __init__(self, database, person, options_class):
|
||||
def __init__(self, database, options_class):
|
||||
"""
|
||||
Creates the Timeline object that produces the report.
|
||||
|
||||
@ -85,7 +85,7 @@ class TimeLine(Report):
|
||||
sortby - Sorting method to be used.
|
||||
"""
|
||||
|
||||
Report.__init__(self, database, person, options_class)
|
||||
Report.__init__(self, database, options_class)
|
||||
menu = options_class.menu
|
||||
self.filter = menu.get_option_by_name('filter').get_filter()
|
||||
|
||||
|
@ -161,8 +161,8 @@ class WebCalReport(Report):
|
||||
"""
|
||||
Creates WebCalReport object that produces the report.
|
||||
"""
|
||||
def __init__(self, database, person, options):
|
||||
Report.__init__(self, database, person, options)
|
||||
def __init__(self, database, options):
|
||||
Report.__init__(self, database, options)
|
||||
menu = options.menu
|
||||
|
||||
self.database = database
|
||||
|
Loading…
Reference in New Issue
Block a user