From cc6654ddab568267d8e2396e811bea744eacd2b4 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Wed, 20 Feb 2008 04:52:10 +0000 Subject: [PATCH] Remove the "person" option from reports, report options, and report dialogs. Person is selected by the user for all reports. svn: r10074 --- ChangeLog | 37 +++++++++++++++++++++ src/ReportBase/_BareReportDialog.py | 12 ++----- src/ReportBase/_CommandLineReport.py | 2 +- src/ReportBase/_DocReportDialog.py | 6 ++-- src/ReportBase/_DrawReportDialog.py | 6 ++-- src/ReportBase/_GraphvizReportDialog.py | 4 +-- src/ReportBase/_Report.py | 3 +- src/ReportBase/_ReportDialog.py | 10 +++--- src/ReportBase/_ReportOptions.py | 13 ++++---- src/ReportBase/_TextReportDialog.py | 6 ++-- src/ReportBase/_WebReportDialog.py | 7 ++-- src/plugins/AncestorChart.py | 4 +-- src/plugins/AncestorReport.py | 4 +-- src/plugins/BookReport.py | 35 ++++++++------------ src/plugins/Calendar.py | 4 +-- src/plugins/CustomBookText.py | 4 +-- src/plugins/DescendChart.py | 4 +-- src/plugins/DescendReport.py | 4 +-- src/plugins/DetAncestralReport.py | 4 +-- src/plugins/DetDescendantReport.py | 4 +-- src/plugins/EndOfLineReport.py | 4 +-- src/plugins/FamilyGroup.py | 4 +-- src/plugins/FanChart.py | 4 +-- src/plugins/GVFamilyLines.py | 4 +-- src/plugins/GVHourGlass.py | 4 +-- src/plugins/GVRelGraph.py | 4 +-- src/plugins/IndivComplete.py | 44 ++++++++++++------------- src/plugins/KinshipReport.py | 4 +-- src/plugins/MarkerReport.py | 4 +-- src/plugins/NarrativeWeb.py | 8 ++--- src/plugins/SimpleBookTitle.py | 8 ++--- src/plugins/StatisticsChart.py | 4 +-- src/plugins/TimeLine.py | 4 +-- src/plugins/WebCal.py | 4 +-- 34 files changed, 148 insertions(+), 129 deletions(-) diff --git a/ChangeLog b/ChangeLog index febe58db5..7b29e4d2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +2008-02-19 Brian Matherly + * 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 * src/plugins/DefaultGramplets.py: News renders text with styles * src/DataViews/GrampletView.py (GuiGramplet.render_text): diff --git a/src/ReportBase/_BareReportDialog.py b/src/ReportBase/_BareReportDialog.py index 24eb8641f..bf51fbb85 100644 --- a/src/ReportBase/_BareReportDialog.py +++ b/src/ReportBase/_BareReportDialog.py @@ -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): diff --git a/src/ReportBase/_CommandLineReport.py b/src/ReportBase/_CommandLineReport.py index c032db094..2c79f3fb0 100644 --- a/src/ReportBase/_CommandLineReport.py +++ b/src/ReportBase/_CommandLineReport.py @@ -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() diff --git a/src/ReportBase/_DocReportDialog.py b/src/ReportBase/_DocReportDialog.py index 643976258..def0db6bf 100644 --- a/src/ReportBase/_DocReportDialog.py +++ b/src/ReportBase/_DocReportDialog.py @@ -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 diff --git a/src/ReportBase/_DrawReportDialog.py b/src/ReportBase/_DrawReportDialog.py index 5f31e1f22..b9ba0805d 100644 --- a/src/ReportBase/_DrawReportDialog.py +++ b/src/ReportBase/_DrawReportDialog.py @@ -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) #------------------------------------------------------------------------ # diff --git a/src/ReportBase/_GraphvizReportDialog.py b/src/ReportBase/_GraphvizReportDialog.py index 522e77b1e..2d87a68f3 100644 --- a/src/ReportBase/_GraphvizReportDialog.py +++ b/src/ReportBase/_GraphvizReportDialog.py @@ -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): diff --git a/src/ReportBase/_Report.py b/src/ReportBase/_Report.py index e9e8d2bbe..0e4a28639 100644 --- a/src/ReportBase/_Report.py +++ b/src/ReportBase/_Report.py @@ -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() diff --git a/src/ReportBase/_ReportDialog.py b/src/ReportBase/_ReportDialog.py index 22e774de1..af6641e16 100644 --- a/src/ReportBase/_ReportDialog.py +++ b/src/ReportBase/_ReportDialog.py @@ -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() diff --git a/src/ReportBase/_ReportOptions.py b/src/ReportBase/_ReportOptions.py index aa06eb88b..1217f4728 100644 --- a/src/ReportBase/_ReportOptions.py +++ b/src/ReportBase/_ReportOptions.py @@ -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): diff --git a/src/ReportBase/_TextReportDialog.py b/src/ReportBase/_TextReportDialog.py index 8c2cba45d..e835f084e 100644 --- a/src/ReportBase/_TextReportDialog.py +++ b/src/ReportBase/_TextReportDialog.py @@ -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) #------------------------------------------------------------------------ # diff --git a/src/ReportBase/_WebReportDialog.py b/src/ReportBase/_WebReportDialog.py index 01f430706..3f8ed75b8 100644 --- a/src/ReportBase/_WebReportDialog.py +++ b/src/ReportBase/_WebReportDialog.py @@ -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): diff --git a/src/plugins/AncestorChart.py b/src/plugins/AncestorChart.py index 11323a6cc..f122b4ef3 100644 --- a/src/plugins/AncestorChart.py +++ b/src/plugins/AncestorChart.py @@ -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() diff --git a/src/plugins/AncestorReport.py b/src/plugins/AncestorReport.py index f8af891d8..cb4dca5cd 100644 --- a/src/plugins/AncestorReport.py +++ b/src/plugins/AncestorReport.py @@ -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 = {} diff --git a/src/plugins/BookReport.py b/src/plugins/BookReport.py index e24eccb25..029dda072 100644 --- a/src/plugins/BookReport.py +++ b/src/plugins/BookReport.py @@ -473,8 +473,6 @@ class BookList: option_type = Utils.type_name(option_value) f.write('