diff --git a/ChangeLog b/ChangeLog index 88c02e8a4..c29164b63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-12-23 Alex Roitman + * src/ReportOptions.py (ReportOptions): Add wrappers to hide handler. + * src/plugins/BookReport.py: Use wrappers. + * src/plugins/TimeLine.py: Use wrappers. + * src/plugins/FtmStyleDescendants.py: Use wrappers. + * src/plugins/FtmStyleAncestors.py: Use wrappers. + * src/plugins/AncestorReport.py: Use wrappers. + * src/plugins/DescendReport.py: Use wrappers. + * src/plugins/IndivSummary.py: Use wrappers. + 2004-12-22 Alex Roitman * src/ReportOptions.py (ReportOptions): Add base Options class. * src/plugins/BookReport.py (BookOptions): Derive from base class. diff --git a/src/ReportOptions.py b/src/ReportOptions.py index 33f802b92..cdcf43f72 100644 --- a/src/ReportOptions.py +++ b/src/ReportOptions.py @@ -751,3 +751,27 @@ class ReportOptions: in the add_user_options() method above. """ pass + + def get_document(self): + return self.handler.doc + + def set_document(self,val): + self.handler.doc = val + + def get_output(self): + return self.handler.output + + def set_output(self,val): + self.handler.output = val + + def get_newpage(self): + return self.handler.newpage + + def set_newpage(self,val): + self.handler.newpage = val + + def get_report_generations(self): + return self.handler.get_report_generations() + + def get_filter_number(self): + return self.handler.get_filter_number() diff --git a/src/plugins/AncestorReport.py b/src/plugins/AncestorReport.py index 699e57ce3..1fdd1244e 100644 --- a/src/plugins/AncestorReport.py +++ b/src/plugins/AncestorReport.py @@ -85,11 +85,11 @@ class AncestorReport(Report.Report): self.map = {} (self.max_generations,self.pgbrk) \ - = options_class.handler.get_report_generations() + = options_class.get_report_generations() - self.doc = options_class.handler.doc - output = options_class.handler.output - self.newpage = options_class.handler.newpage + self.doc = options_class.get_document() + output = options_class.get_output() + self.newpage = options_class.get_newpage() if output: self.standalone = 1 diff --git a/src/plugins/BookReport.py b/src/plugins/BookReport.py index 65fd1915f..d4fa4b71a 100644 --- a/src/plugins/BookReport.py +++ b/src/plugins/BookReport.py @@ -1012,8 +1012,8 @@ class BookReportDialog(Report.ReportDialog): self.rptlist = [] newpage = 0 for item in self.book.get_item_list(): - item.option_class.handler.doc = self.doc - item.option_class.handler.newpage = newpage + item.option_class.set_document(self.doc) + item.option_class.set_newpage(newpage) report_class = item.get_write_item() obj = Report.write_book_item(self.database,self.person, report_class,item.option_class) @@ -1072,14 +1072,14 @@ def cl_report(database,name,category,options_str_dict): rptlist = [] newpage = 0 for item in book.get_item_list(): - item.option_class.handler.doc = doc - item.option_class.handler.newpage = newpage + item.option_class.set_document(doc) + item.option_class.set_newpage(newpage) report_class = item.get_write_item() obj = Report.write_book_item(database,clr.person, report_class,item.option_class) rptlist.append(obj) newpage = 1 - doc.open(clr.option_class.handler.output) + doc.open(clr.option_class.get_output()) doc.init() for item in rptlist: item.write_report() diff --git a/src/plugins/DescendReport.py b/src/plugins/DescendReport.py index 2e0394218..9d87bb7a0 100644 --- a/src/plugins/DescendReport.py +++ b/src/plugins/DescendReport.py @@ -90,11 +90,11 @@ class DescendantReport: self.options_class = options_class (self.max_generations,self.pgbrk) \ - = options_class.handler.get_report_generations() + = options_class.get_report_generations() - self.doc = options_class.handler.doc - output = options_class.handler.output - self.newpage = options_class.handler.newpage + self.doc = options_class.get_document() + output = options_class.get_output() + self.newpage = options_class.get_newpage() if output: self.standalone = 1 diff --git a/src/plugins/FtmStyleAncestors.py b/src/plugins/FtmStyleAncestors.py index 8905eec31..e69bb6c63 100644 --- a/src/plugins/FtmStyleAncestors.py +++ b/src/plugins/FtmStyleAncestors.py @@ -88,11 +88,11 @@ class FtmAncestorReport(Report.Report): self.map = {} (self.max_generations,self.pgbrk) \ - = options_class.handler.get_report_generations() + = options_class.get_report_generations() - self.doc = options_class.handler.doc - output = options_class.handler.output - self.newpage = options_class.handler.newpage + self.doc = options_class.get_document() + output = options_class.get_output() + self.newpage = options_class.get_newpage() if output: self.standalone = 1 diff --git a/src/plugins/FtmStyleDescendants.py b/src/plugins/FtmStyleDescendants.py index 39d82f38a..51fcef441 100644 --- a/src/plugins/FtmStyleDescendants.py +++ b/src/plugins/FtmStyleDescendants.py @@ -94,11 +94,11 @@ class FtmDescendantReport(Report.Report): self.gen_map = {} (self.max_generations,self.pgbrk) \ - = options_class.handler.get_report_generations() + = options_class.get_report_generations() - self.doc = options_class.handler.doc - output = options_class.handler.output - self.newpage = options_class.handler.newpage + self.doc = options_class.get_document() + output = options_class.get_output() + self.newpage = options_class.get_newpage() self.setup() diff --git a/src/plugins/IndivSummary.py b/src/plugins/IndivSummary.py index 100a73b69..1167487cd 100644 --- a/src/plugins/IndivSummary.py +++ b/src/plugins/IndivSummary.py @@ -86,9 +86,9 @@ class IndivSummary(Report.Report): self.options_class = options_class - self.d = options_class.handler.doc - self.output = options_class.handler.output - self.newpage = options_class.handler.newpage + self.d = options_class.get_document() + self.output = options_class.get_output() + self.newpage = options_class.get_newpage() c = database.get_researcher().get_name() self.d.creator(c) diff --git a/src/plugins/TimeLine.py b/src/plugins/TimeLine.py index 69f854d97..c72f8b689 100644 --- a/src/plugins/TimeLine.py +++ b/src/plugins/TimeLine.py @@ -97,7 +97,7 @@ class TimeLine: self.person = person self.options_class = options_class - filter_num = options_class.handler.get_filter_number() + filter_num = options_class.get_filter_number() filters = options_class.get_report_filters(person) self.filter = filters[filter_num] @@ -107,9 +107,9 @@ class TimeLine: sort_functions = options_class.get_sort_functions(Sort.Sort(database)) self.sort_func = sort_functions[sort_func_num][1] - self.d = options_class.handler.doc - self.output = options_class.handler.output - self.newpage = options_class.handler.newpage + self.d = options_class.get_document() + self.output = options_class.get_output() + self.newpage = options_class.get_newpage() self.setup() if self.output: