* 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.


svn: r3834
This commit is contained in:
Alex Roitman 2004-12-23 17:39:47 +00:00
parent 61b53ebb14
commit a4662dc4b7
9 changed files with 62 additions and 28 deletions

View File

@ -1,3 +1,13 @@
2004-12-23 Alex Roitman <shura@alex.neuro.umn.edu>
* 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 <shura@alex.neuro.umn.edu> 2004-12-22 Alex Roitman <shura@alex.neuro.umn.edu>
* src/ReportOptions.py (ReportOptions): Add base Options class. * src/ReportOptions.py (ReportOptions): Add base Options class.
* src/plugins/BookReport.py (BookOptions): Derive from base class. * src/plugins/BookReport.py (BookOptions): Derive from base class.

View File

@ -751,3 +751,27 @@ class ReportOptions:
in the add_user_options() method above. in the add_user_options() method above.
""" """
pass 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()

View File

@ -85,11 +85,11 @@ class AncestorReport(Report.Report):
self.map = {} self.map = {}
(self.max_generations,self.pgbrk) \ (self.max_generations,self.pgbrk) \
= options_class.handler.get_report_generations() = options_class.get_report_generations()
self.doc = options_class.handler.doc self.doc = options_class.get_document()
output = options_class.handler.output output = options_class.get_output()
self.newpage = options_class.handler.newpage self.newpage = options_class.get_newpage()
if output: if output:
self.standalone = 1 self.standalone = 1

View File

@ -1012,8 +1012,8 @@ class BookReportDialog(Report.ReportDialog):
self.rptlist = [] self.rptlist = []
newpage = 0 newpage = 0
for item in self.book.get_item_list(): for item in self.book.get_item_list():
item.option_class.handler.doc = self.doc item.option_class.set_document(self.doc)
item.option_class.handler.newpage = newpage item.option_class.set_newpage(newpage)
report_class = item.get_write_item() report_class = item.get_write_item()
obj = Report.write_book_item(self.database,self.person, obj = Report.write_book_item(self.database,self.person,
report_class,item.option_class) report_class,item.option_class)
@ -1072,14 +1072,14 @@ def cl_report(database,name,category,options_str_dict):
rptlist = [] rptlist = []
newpage = 0 newpage = 0
for item in book.get_item_list(): for item in book.get_item_list():
item.option_class.handler.doc = doc item.option_class.set_document(doc)
item.option_class.handler.newpage = newpage item.option_class.set_newpage(newpage)
report_class = item.get_write_item() report_class = item.get_write_item()
obj = Report.write_book_item(database,clr.person, obj = Report.write_book_item(database,clr.person,
report_class,item.option_class) report_class,item.option_class)
rptlist.append(obj) rptlist.append(obj)
newpage = 1 newpage = 1
doc.open(clr.option_class.handler.output) doc.open(clr.option_class.get_output())
doc.init() doc.init()
for item in rptlist: for item in rptlist:
item.write_report() item.write_report()

View File

@ -90,11 +90,11 @@ class DescendantReport:
self.options_class = options_class self.options_class = options_class
(self.max_generations,self.pgbrk) \ (self.max_generations,self.pgbrk) \
= options_class.handler.get_report_generations() = options_class.get_report_generations()
self.doc = options_class.handler.doc self.doc = options_class.get_document()
output = options_class.handler.output output = options_class.get_output()
self.newpage = options_class.handler.newpage self.newpage = options_class.get_newpage()
if output: if output:
self.standalone = 1 self.standalone = 1

View File

@ -88,11 +88,11 @@ class FtmAncestorReport(Report.Report):
self.map = {} self.map = {}
(self.max_generations,self.pgbrk) \ (self.max_generations,self.pgbrk) \
= options_class.handler.get_report_generations() = options_class.get_report_generations()
self.doc = options_class.handler.doc self.doc = options_class.get_document()
output = options_class.handler.output output = options_class.get_output()
self.newpage = options_class.handler.newpage self.newpage = options_class.get_newpage()
if output: if output:
self.standalone = 1 self.standalone = 1

View File

@ -94,11 +94,11 @@ class FtmDescendantReport(Report.Report):
self.gen_map = {} self.gen_map = {}
(self.max_generations,self.pgbrk) \ (self.max_generations,self.pgbrk) \
= options_class.handler.get_report_generations() = options_class.get_report_generations()
self.doc = options_class.handler.doc self.doc = options_class.get_document()
output = options_class.handler.output output = options_class.get_output()
self.newpage = options_class.handler.newpage self.newpage = options_class.get_newpage()
self.setup() self.setup()

View File

@ -86,9 +86,9 @@ class IndivSummary(Report.Report):
self.options_class = options_class self.options_class = options_class
self.d = options_class.handler.doc self.d = options_class.get_document()
self.output = options_class.handler.output self.output = options_class.get_output()
self.newpage = options_class.handler.newpage self.newpage = options_class.get_newpage()
c = database.get_researcher().get_name() c = database.get_researcher().get_name()
self.d.creator(c) self.d.creator(c)

View File

@ -97,7 +97,7 @@ class TimeLine:
self.person = person self.person = person
self.options_class = options_class 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) filters = options_class.get_report_filters(person)
self.filter = filters[filter_num] self.filter = filters[filter_num]
@ -107,9 +107,9 @@ class TimeLine:
sort_functions = options_class.get_sort_functions(Sort.Sort(database)) sort_functions = options_class.get_sort_functions(Sort.Sort(database))
self.sort_func = sort_functions[sort_func_num][1] self.sort_func = sort_functions[sort_func_num][1]
self.d = options_class.handler.doc self.d = options_class.get_document()
self.output = options_class.handler.output self.output = options_class.get_output()
self.newpage = options_class.handler.newpage self.newpage = options_class.get_newpage()
self.setup() self.setup()
if self.output: if self.output: