Changeset 3094

Show
Ignore:
Timestamp:
01/18/08 06:18:46 (10 months ago)
Author:
msbrogli
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • chartreportgeneratorplugin/trunk/reportGenerator.py

    r3093 r3094  
    2121        def __init__(self, title): 
    2222                self.tpl_index = self.readTemplate('template_index.tpl') 
     23                self.tpl_index = self.readTemplate('template_contents.tpl') 
    2324                self.tpl_report = self.readTemplate('template_report.tpl') 
    2425                self.tpl_details = self.readTemplate('template_details.tpl') 
    2526                self.index_body = '' 
     27                self.contents = '' 
    2628                self.title = title 
    2729        def readTemplate(self, filename): 
     
    3133                return str 
    3234        def openReport(self, title, description): 
     35                self.report_id = len(self.contents) 
    3336                self.report_title = title 
    3437                self.report_description = description 
    3538                self.report_details = '' 
     39                t = Template(self.tpl_contents) 
     40                self.contents += t.substitute(id=self.report_id, title=self.report_title) 
    3641        def closeReport(self): 
    3742                t = Template(self.tpl_report) 
     
    4348        def write(self, filename): 
    4449                t = Template(self.tpl_index) 
    45                 contents = t.substitute(title=self.title, body=self.index_body) 
    4650                fp = open(filename, 'w') 
    47                 fp.write(contents
     51                fp.write(t.substitute(title=self.title, contents=self.contents, body=self.index_body)
    4852                fp.close() 
    4953 
  • chartreportgeneratorplugin/trunk/template_index.tpl

    r3093 r3094  
    1919<body> 
    2020        <h1>${title}</h1> 
     21        <div id='contents'><ul>${contents}</ul></div> 
    2122        <div id='main'>${body}</div> 
    2223</body>