ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/IssueTrackerReporter.py
(Generate patch)

Comparing Python/NinoCode/Active_prgs/IssueTrackerReporter.py (file contents):
Revision 501 by nino.borges, Tue Jan 7 21:39:14 2014 UTC vs.
Revision 502 by nino.borges, Wed Jan 8 21:39:12 2014 UTC

# Line 12 | Line 12 | Creates an easy to read report from the
12  
13   def CreateBaseReport(outputFile):
14      """Creates the top of the HTML file"""
15 <    outputFile.write("""<html>\n <head>\n  <title> ITO Report</title>\n</head><body>\n
15 >    outputFile.write("""
16 > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.5 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
17 > <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
18 > <head>
19 >  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
20 >  <meta name="description" content="Your description goes here" />
21 >  <meta name="keywords" content="your,keywords,goes,here" />
22 >  <meta name="author" content="Emanuel Borges">
23 >  <link rel="stylesheet" type="text/css" href="main.css" title="ITO Report" media="all" />
24 >  <title>ITO Report</title>
25 > </head>
26 >
27 > <body>
28 >  <div id="containerfull"><!-- Use"containerfull" for 100% width. For fixed width, use "container980", "container760" or "container600" (the number is the layout width in pixels). -->
29 >    <div id="header">
30 >      <h1><a href="index.html">ITO Report</a></h1>
31 >      <h2>Report gathered from Issue Tracking Object.</h2>
32 >    </div>
33      """)
34 +    outputFile.close()
35   def FinishReport(outputFile):
36      """Creates the bottom of the HTML file"""
37 <    outputFile.write("""</body></html>""")
37 >    outputFile.write("""
38 >
39 >  <div class="clear">&nbsp;</div>
40 >  </div>
41 >  <div class="clear">&nbsp;</div>
42 >  </div>
43 >  <div id="footer">
44 >    <div id="footersections">
45 >      <div class="half">
46 >        <h2>Footer area #1</h2>
47 >        <p>manny test.</p>
48 >      </div>
49 >      <div class="quarter">
50 >        <h2>Footer area #2</h2>
51 >        <p>manny test 2.</p>
52 >        <p>Paragraphs and <a href="#">links</a> work here too.</p>
53 >      </div>
54 >      <div class="lastquarter">
55 >        <h2>Footer menu</h2>
56 >        <ul>
57 >          <li><a href="#">Link #1</a></li>
58 >          <li><a href="#">Link #2</a></li>
59 >        </ul>
60 >      </div>
61 >      <div class="clear">&nbsp;</div>
62 >      </div>
63 >    </div>
64 >    <div id="credits">
65 >      <p>&copy; 2014 Emanuel Borges<br />
66 >    </div>
67 >  </div>
68 > </body>
69 > </html>
70 >    """)
71 >    outputFile.close()
72  
73   def SplitIntoPlates(exportFile):
74      openMWEList = []
# Line 57 | Line 109 | def SplitIntoSections(currentList):
109          else:
110              matrix[issueType] = [writeList,]
111      return matrix
112 <        
113 < def ProcessToHTML(currentMatrix,outputFile,headding):
112 >  
113 > def ProcessToHTML(currentMatrix,outputFile,headdingList,part):
114      """Converts the lists into HTML tables"""
115 <    outputFile.write('<h2>%s</h2>\n'% headding)
116 <    outputFile.write('''<hr width="40%">''')
117 <    for section in currentMatrix.keys():
118 <        outputFile.write("<h3>%s</h3>\n"%section)
119 <        outputFile.write("<center><table border=1 cellspacing=0 cellpadding=5 width=90%>\n")
120 <        outputFile.write("<tr><th>ID</th><th>KPMG Status</th><th>MWE Status</th><th>TE Prefix</th><th>TE Description</th><th>Reporter</th><th>Assignee</th><th>Created On</th><th>Modified On</th></tr>")
121 <        for x in currentMatrix[section]:
122 <            outputFile.write("<tr>\n")
123 <            for y in x:
124 <                outputFile.write("<td>%s</td>"%y)
125 <            outputFile.write("</tr>\n")
126 <        outputFile.write("</table></center>\n")
115 >    outputFile.write("""
116 >    <div id="menu">
117 >      <ul>
118 >      """)
119 >    if part[:3] == "MWE":
120 >        outputFile.write('<li><a class="current" href="index2.html">%s</a></li>\n'% headdingList[0])
121 >        outputFile.write("""
122 >            <li><a href="KPMGs_Plate.html">KPMG's Plate (4)</a></li>
123 >            <li><a href="Closed_Items.html">Closed Issues (239)</a></li>
124 >            <li><a href="Project_View.html">Project View</a></li>
125 >          </ul>
126 >        </div>
127 >
128 > <div id="feature">
129 >  <div class="left">
130 >    <h2>About the MWE Plate</h2>
131 >    <p>These are all of the tasks and projects, broken out by Issue type, that are currently assigned to the MWE team.</p>
132 >  </div>
133 >  <div class="clear">&nbsp;</div>
134 >  </div>
135 >  <div id="main">
136 >    <div id="sidebar">
137 >      <div class="sidebarbox">
138 >        <h2>Issue menu</h2>
139 >        <ul class="sidemenu">\n""")
140 >        for section in currentMatrix.keys():
141 >            outputFile.write('          <li><a href="#%s">%s</a></li>\n'%(section,section))
142 >        outputFile.write("""        </ul>
143 >      </div>
144 >
145 >          <div class="sidebarbox">
146 >            <h2>Text box</h2>
147 >            <p>Important links:</p>
148 >            <ul>
149 >              <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
150 >              <li><a href="#">Another</a></li>
151 >            </ul>
152 >          </div>
153 >        </div>
154 >
155 >  <div id="content">
156 >  """)
157 >        for section in currentMatrix.keys():
158 >            outputFile.write('<h3 id="%s">%s</h3>\n'%(section,section))
159 >            outputFile.write("<center><table border=1 cellspacing=0 cellpadding=5 width=95%>\n")
160 >            outputFile.write("<tr><th>ID</th><th>KPMG Status</th><th>MWE Status</th><th>TE Prefix</th><th>TE Description</th><th>Reporter</th><th>Assignee</th><th>Created On</th><th>Modified On</th></tr>")
161 >            for x in currentMatrix[section]:
162 >                outputFile.write("<tr>\n")
163 >                for y in x:
164 >                    outputFile.write("<td>%s</td>"%y)
165 >                outputFile.write("</tr>\n")
166 >            outputFile.write("</table></center><br><br>\n")
167 >        
168 >    elif part[:3] == "KPM":
169 >        outputFile.write('<li><a class="current" href="index2.html">%s</a></li>\n'% headdingList[1])
170 >    elif part[:3] == "Clo":
171 >        outputFile.write('<h2>%s</h2>\n'% headdingList[2])
172 >    else:
173 >        pass
174 > ##    
175 > ##    outputFile.write('<h2>%s</h2>\n'% headdingList[0])
176 > ##    outputFile.write('''<hr width="40%">''')
177 > ##    for section in currentMatrix.keys():
178 > ##        outputFile.write("<h3>%s</h3>\n"%section)
179 > ##        outputFile.write("<center><table border=1 cellspacing=0 cellpadding=5 width=90%>\n")
180 > ##        outputFile.write("<tr><th>ID</th><th>KPMG Status</th><th>MWE Status</th><th>TE Prefix</th><th>TE Description</th><th>Reporter</th><th>Assignee</th><th>Created On</th><th>Modified On</th></tr>")
181 > ##        for x in currentMatrix[section]:
182 > ##            outputFile.write("<tr>\n")
183 > ##            for y in x:
184 > ##                outputFile.write("<td>%s</td>"%y)
185 > ##            outputFile.write("</tr>\n")
186 > ##        outputFile.write("</table></center>\n")
187 >    outputFile.close()
188  
189   if __name__ == '__main__':
190      #exportFile = "/Users/ninoborges/Dropbox/Misc/export_20140106_191259.csv"
191      #htmlFile = "/Users/ninoborges/Documents/ITO_Report.html"
192      exportFile = "T:\honeywell\export_20140106_191259.csv"
193 <    htmlFile = "T:\honeywell\ITO_Report\ITO_Report.html"
193 >    indexFile= "T:\honeywell\ITO_Report\index2.html"
194 >    kpmgFile = "T:\honeywell\ITO_Report\KPMGs_Plate.html"
195 >    closedFile = "T:\honeywell\ITO_Report\Closed_Items.html"
196 >    projectViewFile = "T:\honeywell\ITO_Report\Project_View.html"
197      openMWEList,openKPMGList, closedList = SplitIntoPlates(exportFile)
198      print "mwe list %s"%len(openMWEList)
199      print "kpmg list %s"%len(openKPMGList)
# Line 85 | Line 201 | if __name__ == '__main__':
201      mwePlate = SplitIntoSections(openMWEList)
202      kpmgPlate = SplitIntoSections(openKPMGList)
203      closedPlate = SplitIntoSections(closedList)
88    CreateBaseReport(open(htmlFile,'w'))
89    ProcessToHTML(mwePlate,open(htmlFile,'a'),"MWE's Plate (%s items)"%len(openMWEList))
90    ProcessToHTML(kpmgPlate,open(htmlFile,'a'),"<br><br><br>KPMG's Plate (%s items)"%len(openKPMGList))
91    ProcessToHTML(closedPlate,open(htmlFile,'a'),"<br><br><br>Closed Requests (%s items)"%len(closedList))
204  
205 <    FinishReport(open(htmlFile,'a'))
205 >    headdingList = ["MWE's Plate (%s items)"%len(openMWEList),"KPMG's Plate (%s items)"%len(openKPMGList),"Closed Requests (%s items)"%len(closedList)]
206 >
207 >    CreateBaseReport(open(indexFile,'w'))
208 >    CreateBaseReport(open(kpmgFile,'w'))
209 >    CreateBaseReport(open(closedFile,'w'))
210 >    CreateBaseReport(open(projectViewFile,'w'))
211 >    
212 >    ProcessToHTML(mwePlate,open(indexFile,'a'),headdingList,"MWE's List")
213 >    ProcessToHTML(kpmgPlate,open(kpmgFile,'a'),headdingList,"KPMG's List")
214 >    ProcessToHTML(closedPlate,open(closedFile,'a'),headdingList,"Closed List")
215 >
216 >    FinishReport(open(indexFile,'a'))
217 >    FinishReport(open(kpmgFile,'a'))
218 >    FinishReport(open(closedFile,'a'))
219 >    FinishReport(open(projectViewFile,'a'))

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)