ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/ITO_Report/trunk/IssueTrackerReporter.py
Revision: 524
Committed: Thu Feb 20 19:22:35 2014 UTC (12 years, 1 month ago) by nino.borges
Content type: text/x-python
File size: 22863 byte(s)
Log Message:
Added section where it detects mac or windows, so that I dont need to keep editing the same location info.

File Contents

# User Rev Content
1 nino.borges 499 """
2     IssueTrackerReporter
3    
4     Created by
5     Emanuel Borges
6     01.06.2014
7    
8     Creates an easy to read report from the issue tracker export of "all issues".
9    
10 nino.borges 521 export should contain the following fields:
11     'Artifact ID' 'Issue Type' 'Status KPMG or Manny' 'Status MWE Resolution'
12    
13     'Time Entry Description Prefix' 'Time Entry Description' 'Reporter' 'Assignee Individual'
14    
15     'System Created On' 'System Last Modified On' 'Time KPMG Billed' 'Time KPMG Estimated'
16    
17     'KPMG or Manny Status Comments/Notes'
18    
19    
20 nino.borges 499 """
21 nino.borges 524 import os,sys
22 nino.borges 499
23 nino.borges 514 def CreateBaseReport(outputFile,cssLocation="main.css"):
24 nino.borges 499 """Creates the top of the HTML file"""
25 nino.borges 502 outputFile.write("""
26     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.5 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
27     <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
28     <head>
29     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
30     <meta name="description" content="Your description goes here" />
31     <meta name="keywords" content="your,keywords,goes,here" />
32 nino.borges 514 <meta name="author" content="Emanuel Borges">""")
33     outputFile.write(' <link rel="stylesheet" type="text/css" href="%s" title="ITO Report" media="all" />'%cssLocation)
34     outputFile.write("""
35 nino.borges 502 <title>ITO Report</title>
36     </head>
37    
38     <body>
39     <div id="containerfull"><!-- Use"containerfull" for 100% width. For fixed width, use "container980", "container760" or "container600" (the number is the layout width in pixels). -->
40     <div id="header">
41     <h1><a href="index.html">ITO Report</a></h1>
42     <h2>Report gathered from Issue Tracking Object.</h2>
43     </div>
44 nino.borges 499 """)
45 nino.borges 502 outputFile.close()
46 nino.borges 499 def FinishReport(outputFile):
47     """Creates the bottom of the HTML file"""
48 nino.borges 502 outputFile.write("""
49 nino.borges 499
50 nino.borges 502 <div class="clear">&nbsp;</div>
51     </div>
52     <div class="clear">&nbsp;</div>
53     </div>
54     <div id="footer">
55     <div id="footersections">
56     <div class="half">
57     <h2>Footer area #1</h2>
58     <p>manny test.</p>
59     </div>
60     <div class="quarter">
61     <h2>Footer area #2</h2>
62     <p>manny test 2.</p>
63     <p>Paragraphs and <a href="#">links</a> work here too.</p>
64     </div>
65     <div class="lastquarter">
66     <h2>Footer menu</h2>
67     <ul>
68     <li><a href="#">Link #1</a></li>
69     <li><a href="#">Link #2</a></li>
70     </ul>
71     </div>
72     <div class="clear">&nbsp;</div>
73     </div>
74     </div>
75     <div id="credits">
76     <p>&copy; 2014 Emanuel Borges<br />
77     </div>
78     </div>
79     </body>
80     </html>
81     """)
82     outputFile.close()
83    
84 nino.borges 505 def GetProjectList(mwePlate,kpmgPlate,closedPlate,outputFile,headdingList):
85 nino.borges 504 """Combines the plates (not lists) into the project list, so that you can populate the project view"""
86     ## cycle through the 2 open lists and only pull from the closed list, if the proj exists in the first two.
87     ## Everything should already be in a matrix by catagory.
88     projectMatrix = {}
89     for i in mwePlate.keys():
90 nino.borges 505 for p in mwePlate[i]:
91     project = p[3]
92     if project == '""':
93     project = "Tasks"
94     if project in projectMatrix.keys():
95     projectMatrix[project].append(["MWE",p])
96     else:
97     projectMatrix[project] = [["MWE",p],]
98 nino.borges 504 for i in kpmgPlate.keys():
99 nino.borges 505 for p in kpmgPlate[i]:
100     project = p[3]
101     if project=='""':
102     project = "Tasks"
103     if project in projectMatrix.keys():
104     projectMatrix[project].append(["KPMG",p])
105     else:
106     projectMatrix[project] = [["KPMG",p],]
107     for i in closedPlate.keys():
108     for p in closedPlate[i]:
109     project = p[3]
110     if project in projectMatrix.keys():
111     projectMatrix[project].append(["Closed",p])
112     outputFile.write("""
113     <div id="menu">
114     <ul>
115     """)
116     outputFile.write('<li><a href="index2.html">%s</a></li>\n'% headdingList[0])
117     outputFile.write('<li><a href="KPMGs_Plate.html">%s</a></li>\n'% headdingList[1])
118     outputFile.write('<li><a href="Closed_Items.html">%s</a></li>\n'% headdingList[2])
119     outputFile.write("""
120     <li><a class="current" href="Project_View.html">Project View</a></li>
121     </ul>
122     </div>
123    
124     <div id="feature">
125     <div class="left">
126     <h2>About the Project View</h2>
127     <p>The project view takes the open items and formats them as a "project".</p>
128     </div>
129     <div class="clear">&nbsp;</div>
130     </div>
131     <div id="main">
132 nino.borges 506 <div id="sidebar">
133     <div class="sidebarbox">
134 nino.borges 507 <h2>Project Menu</h2>
135 nino.borges 506 <ul class="sidemenu">\n""")
136 nino.borges 507 for p in projectMatrix.keys():
137     prj = p.replace('"','')
138     outputFile.write(' <li><a href="#%s">%s</a></li>\n'%(prj,prj))
139 nino.borges 506 outputFile.write(""" </ul>
140     </div>
141    
142     <div class="sidebarbox">
143     <h2>Text box</h2>
144     <p>Important links:</p>
145     <ul>
146     <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
147     <li><a href="#">Another</a></li>
148     </ul>
149     </div>
150     </div>
151    
152 nino.borges 505 <div id="content">""")
153 nino.borges 504 for p in projectMatrix.keys():
154 nino.borges 507 prj = p.replace('"','')
155 nino.borges 523 outputFile.write('<ul><h3><li id="%s">%s</h3>\n'%(prj,prj))
156 nino.borges 521 projTotal = 0.0
157 nino.borges 523 preI = ""
158     firstI = False
159 nino.borges 505 for i in projectMatrix[p]:
160 nino.borges 521 projInt = i[1][10]
161 nino.borges 523 #print projInt
162     #print p
163 nino.borges 521 projInt = projInt.split(" ")
164     if len(projInt) >1:
165     projTotal = projTotal + float(projInt[0])
166 nino.borges 523 if preI == i[0]:
167     ## same section, keep going
168     pass
169     else:
170     if firstI:
171     outputFile.write('</table></ul>\n')
172     outputFile.write('<ul><li> <b>%s</b><table border="1" style="cellpadding:10px">\n'%i[0])
173     firstI = True
174     preI = i[0]
175 nino.borges 505 if i[0] == "Closed":
176 nino.borges 523 outputFile.write('<tr><td><strike><a href="data/%s.html"> %s </a></strike></td><td><strike> %s </strike></td><td><strike> %s </strike></td></tr>\n'% (i[1][0].replace('"',""),i[1][0],i[1][4],i[1][10]))
177 nino.borges 505 else:
178 nino.borges 523 outputFile.write('<tr><td><a href="data/%s.html">%s</a></td><td>%s</td><td>%s</td></tr>\n'% (i[1][0].replace('"',""),i[1][0],i[1][4],i[1][10]))
179     outputFile.write('</table></ul>\n')
180     outputFile.write("</ul></li></ul><p>Total Project Time: %s hrs</p>\n"%str(projTotal))
181     outputFile.write("<hr 40%>\n")
182 nino.borges 505 outputFile.write("""</div></div>""")
183     outputFile.close()
184 nino.borges 504
185    
186 nino.borges 499 def SplitIntoPlates(exportFile):
187     openMWEList = []
188     openKPMGList = []
189     closedList = []
190    
191     contents = open(exportFile).readlines()
192     contents = contents[1:]
193    
194     for line in contents:
195     line = line.replace("\n","")
196 nino.borges 523 ID = line.split("|")[0]
197 nino.borges 499 ID = ID.replace('"',"")
198     if ID.isalpha():
199     pass
200     else:
201 nino.borges 523 KPMGStatus = line.split("|")[2]
202     MWEStatus = line.split("|")[3]
203 nino.borges 501 if KPMGStatus in ['"Resolved"', '"Sent to MWE"','"Closed"','"Transmit to Counsel"'] :
204     if MWEStatus in ['"Resolved"','"Closed"']:
205 nino.borges 499 closedList.append(line)
206     else:
207     openMWEList.append(line)
208     else:
209     openKPMGList.append(line)
210     return openMWEList,openKPMGList, closedList
211    
212     def SplitIntoSections(currentList):
213     """Splits into sections and returns matrix"""
214     matrix = {}
215     for i in currentList:
216 nino.borges 523 i = i.split("|")
217 nino.borges 521 if i[10] == '""':
218     estimatedkpmg = "tbd"
219     else:
220     estimatedkpmg = i[10].replace('"','')+' hrs'
221     if i[11] == '""':
222     actualkpmg = 'tbd'
223     else:
224     actualkpmg = i[11].replace('"','')+' hrs'
225    
226     writeList = [i[0],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],estimatedkpmg,actualkpmg]
227 nino.borges 499 issueType = i[1]
228     issueType = issueType.replace('"',"")
229     if issueType in matrix.keys():
230     matrix[issueType].append(writeList)
231     else:
232     matrix[issueType] = [writeList,]
233     return matrix
234 nino.borges 502
235     def ProcessToHTML(currentMatrix,outputFile,headdingList,part):
236 nino.borges 499 """Converts the lists into HTML tables"""
237 nino.borges 502 outputFile.write("""
238     <div id="menu">
239     <ul>
240     """)
241     if part[:3] == "MWE":
242     outputFile.write('<li><a class="current" href="index2.html">%s</a></li>\n'% headdingList[0])
243 nino.borges 503 outputFile.write('<li><a href="KPMGs_Plate.html">%s</a></li>\n'% headdingList[1])
244     outputFile.write('<li><a href="Closed_Items.html">%s</a></li>\n'% headdingList[2])
245 nino.borges 502 outputFile.write("""
246     <li><a href="Project_View.html">Project View</a></li>
247     </ul>
248     </div>
249 nino.borges 499
250 nino.borges 502 <div id="feature">
251     <div class="left">
252     <h2>About the MWE Plate</h2>
253     <p>These are all of the tasks and projects, broken out by Issue type, that are currently assigned to the MWE team.</p>
254     </div>
255     <div class="clear">&nbsp;</div>
256     </div>
257     <div id="main">
258     <div id="sidebar">
259     <div class="sidebarbox">
260     <h2>Issue menu</h2>
261     <ul class="sidemenu">\n""")
262     for section in currentMatrix.keys():
263     outputFile.write(' <li><a href="#%s">%s</a></li>\n'%(section,section))
264     outputFile.write(""" </ul>
265     </div>
266    
267 nino.borges 505 <div class="sidebarbox">
268     <h2>Text box</h2>
269     <p>Important links:</p>
270     <ul>
271     <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
272     <li><a href="#">Another</a></li>
273     </ul>
274     </div>
275     </div>
276 nino.borges 502
277     <div id="content">
278     """)
279     for section in currentMatrix.keys():
280     outputFile.write('<h3 id="%s">%s</h3>\n'%(section,section))
281     outputFile.write("<center><table border=1 cellspacing=0 cellpadding=5 width=95%>\n")
282     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>")
283     for x in currentMatrix[section]:
284     outputFile.write("<tr>\n")
285 nino.borges 514 count = 0
286 nino.borges 521 for y in x[:9]:
287 nino.borges 514 if count == 0:
288     outputFile.write('<td><a href="data/%s.html">%s</a></td>'%(y.replace('"',""),y))
289     else:
290     outputFile.write("<td>%s</td>"%y)
291     count = count + 1
292 nino.borges 502 outputFile.write("</tr>\n")
293     outputFile.write("</table></center><br><br>\n")
294    
295     elif part[:3] == "KPM":
296 nino.borges 503 outputFile.write('<li><a href="index2.html">%s</a></li>\n'% headdingList[0])
297     outputFile.write('<li><a class="current" href="KPMGs_Plate.html">%s</a></li>\n'% headdingList[1])
298     outputFile.write('<li><a href="Closed_Items.html">%s</a></li>\n'% headdingList[2])
299     outputFile.write("""
300     <li><a href="Project_View.html">Project View</a></li>
301     </ul>
302     </div>
303    
304     <div id="feature">
305     <div class="left">
306     <h2>About the KPMG Plate</h2>
307     <p>These are all of the tasks and projects, broken out by Issue type, that are currently assigned to the KPMG team.</p>
308     </div>
309     <div class="clear">&nbsp;</div>
310     </div>
311     <div id="main">
312     <div id="sidebar">
313     <div class="sidebarbox">
314     <h2>Issue menu</h2>
315     <ul class="sidemenu">\n""")
316     for section in currentMatrix.keys():
317     outputFile.write(' <li><a href="#%s">%s</a></li>\n'%(section,section))
318     outputFile.write(""" </ul>
319     </div>
320    
321 nino.borges 505 <div class="sidebarbox">
322     <h2>Text box</h2>
323     <p>Important links:</p>
324     <ul>
325     <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
326     <li><a href="#">Another</a></li>
327     </ul>
328     </div>
329     </div>
330 nino.borges 503
331     <div id="content">
332     """)
333     for section in currentMatrix.keys():
334     outputFile.write('<h3 id="%s">%s</h3>\n'%(section,section))
335     outputFile.write("<center><table border=1 cellspacing=0 cellpadding=5 width=95%>\n")
336     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>")
337     for x in currentMatrix[section]:
338     outputFile.write("<tr>\n")
339 nino.borges 514 count = 0
340 nino.borges 521 for y in x[:9]:
341 nino.borges 514 if count == 0:
342     outputFile.write('<td><a href="data/%s.html">%s</a></td>'%(y.replace('"',""),y))
343     else:
344     outputFile.write("<td>%s</td>"%y)
345     count = count + 1
346 nino.borges 503 outputFile.write("</tr>\n")
347     outputFile.write("</table></center><br><br>\n")
348 nino.borges 502 elif part[:3] == "Clo":
349 nino.borges 503 outputFile.write('<li><a href="index2.html">%s</a></li>\n'% headdingList[0])
350     outputFile.write('<li><a href="KPMGs_Plate.html">%s</a></li>\n'% headdingList[1])
351     outputFile.write('<li><a class="current" href="Closed_Items.html">%s</a></li>\n'% headdingList[2])
352     outputFile.write("""
353     <li><a href="Project_View.html">Project View</a></li>
354     </ul>
355     </div>
356    
357     <div id="feature">
358     <div class="left">
359     <h2>About the Closed Items page</h2>
360     <p>These are all of the tasks and projects, broken out by Issue type, that are currently closed and marked complete.</p>
361     </div>
362     <div class="clear">&nbsp;</div>
363     </div>
364     <div id="main">
365     <div id="sidebar">
366     <div class="sidebarbox">
367     <h2>Issue menu</h2>
368     <ul class="sidemenu">\n""")
369     for section in currentMatrix.keys():
370     outputFile.write(' <li><a href="#%s">%s</a></li>\n'%(section,section))
371     outputFile.write(""" </ul>
372     </div>
373    
374 nino.borges 505 <div class="sidebarbox">
375     <h2>Text box</h2>
376     <p>Important links:</p>
377     <ul>
378     <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
379     <li><a href="#">Another</a></li>
380     </ul>
381     </div>
382     </div>
383 nino.borges 503
384     <div id="content">
385     """)
386     for section in currentMatrix.keys():
387     outputFile.write('<h3 id="%s">%s</h3>\n'%(section,section))
388     outputFile.write("<center><table border=1 cellspacing=0 cellpadding=5 width=95%>\n")
389     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>")
390     for x in currentMatrix[section]:
391     outputFile.write("<tr>\n")
392 nino.borges 514 count = 0
393 nino.borges 521 for y in x[:9]:
394 nino.borges 514 if count == 0:
395     outputFile.write('<td><a href="data/%s.html">%s</a></td>'%(y.replace('"',""),y))
396     else:
397     outputFile.write("<td>%s</td>"%y)
398     count = count + 1
399 nino.borges 503 outputFile.write("</tr>\n")
400     outputFile.write("</table></center><br><br>\n")
401 nino.borges 502 else:
402     pass
403     ##
404     ## outputFile.write('<h2>%s</h2>\n'% headdingList[0])
405     ## outputFile.write('''<hr width="40%">''')
406     ## for section in currentMatrix.keys():
407     ## outputFile.write("<h3>%s</h3>\n"%section)
408     ## outputFile.write("<center><table border=1 cellspacing=0 cellpadding=5 width=90%>\n")
409     ## 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>")
410     ## for x in currentMatrix[section]:
411     ## outputFile.write("<tr>\n")
412     ## for y in x:
413     ## outputFile.write("<td>%s</td>"%y)
414     ## outputFile.write("</tr>\n")
415     ## outputFile.write("</table></center>\n")
416     outputFile.close()
417    
418 nino.borges 514 def CreateDetailPages(dataDir,matrix):
419     """Creates all of the indv task detail pages"""
420     for i in matrix.keys():
421     for y in matrix[i]:
422     fileName = "%s.html"%y[0].replace('"','')
423     #fileName = "%s.html"%matrix[i][0][0].replace('"','')
424     outputFile = open(os.path.join(dataDir,fileName),'w')
425     CreateBaseReport(outputFile,"../main.css")
426    
427     outputFile = open(os.path.join(dataDir,fileName),'a')
428     outputFile.write("""
429     <div id="main">
430     <div id="sidebar">
431     <div class="sidebarbox">
432 nino.borges 521 <h2>Realization</h2>
433     <table>""")
434     outputFile.write(' <tr><td>Estimated:</td><td>%s</td>\n <tr></tr><tr><td>Actual:</td><td>%s</td>'%(y[10],y[9]))
435     outputFile.write("""
436     </table>
437     <center>
438     <hr "3%">
439     </center>
440     </div>
441    
442    
443     """)
444     outputFile.write("""
445    
446     <div class="sidebarbox">
447 nino.borges 514 <h2>Text box</h2>
448     <p>Important links:</p>
449     <ul>
450     <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
451     <li><a href="#">Another</a></li>
452     </ul>
453     </div>
454     </div>
455    
456     <div id="content">
457     """)
458 nino.borges 521 outputFile.write("<br><br><br><br><table>\n<form>")
459     outputFile.write('<tr><td><label for="id">Object ID:</label></td><td><input type="text" name="id" size="30" value=" %s" disabled="Disabled"></td></tr>\n'%y[0].replace('"',''))
460     outputFile.write('<tr><td><label for="kpmgStatus">KPMG Status:</label></td><td><input type="text" size="30" name="kpmgStatus" placeholder=" %s" disabled></td></tr>\n'%y[1].replace('"',''))
461     outputFile.write('<tr><td><label for="mweStatus">MWE Status:</label></td><td><input type="text" size="30" name="mweStatus" placeholder=" %s" disabled></td></tr>\n'%y[2].replace('"',''))
462     outputFile.write('<tr><td><label for="TE_Prefix">Time Entry Prefix:</label></td><td><input type="text" size="30" name="TE_Prefix" value=" %s" disabled></td></tr>\n'%y[3].replace('"',''))
463 nino.borges 514
464 nino.borges 521 outputFile.write('<tr><td><label for="Requestor">Requestor:</label></td><td><input type="text" size="30" name="Requestor" value=" %s" disabled></td></tr>\n'%y[5].replace('"',''))
465     outputFile.write('<tr><td><label for="assignedTo">Assigned to:</label></td><td><input type="text" size="30" name="assignedTo" value=" %s" disabled></td></tr>\n'%y[6].replace('"',''))
466     outputFile.write('<tr><td><label for="Created">Created:</label></td><td><input type="text" size="30" name="Created" value=" %s" disabled></td></tr>\n'%y[7].replace('"',''))
467     outputFile.write('<tr><td><label for="Modified">Last Modified:</label></td><td><input type="text" size="30" name="Modified" value=" %s" disabled></td></tr></table>\n<br><br>\n'%y[8].replace('"',''))
468     outputFile.write('<label for="TE_Descr">Time Entry Description:</label><br><textarea rows="4" cols="50" name="TE_Descr" disabled> %s</textarea><br>\n'%y[4].replace('"',''))
469 nino.borges 519 outputFile.write("</form>\n")
470 nino.borges 514 outputFile.close()
471    
472     FinishReport(open(os.path.join(dataDir,fileName),'a'))
473    
474    
475 nino.borges 499 if __name__ == '__main__':
476 nino.borges 524 if sys.platform == "darwin":
477     #macStuff()
478     print("--OSX workstion detected--")
479     exportFile = "/Users/ninoborges/Dropbox/Misc/export.csv"
480     indexFile = "/Users/ninoborges/Documents/ITO_Report/index2.html"
481     kpmgFile = "/Users/ninoborges/Documents/ITO_Report/KPMGs_Plate.html"
482     closedFile = "/Users/ninoborges/Documents/ITO_Report/Closed_Items.html"
483     projectViewFile = "/Users/ninoborges/Documents/ITO_Report/Project_View.html"
484     dataDir = "/Users/ninoborges/Documents/ITO_Report/Data"
485     elif sys.platform == "win32":
486     #winStuff()
487     print("--Windows workstion detected--")
488     exportFile = r"T:\honeywell\ITO_Report\Export\export.csv"
489     indexFile= r"\\nykads01\data\CLI\_Manny_Borges_BOS\ITO_Report\index2.html"
490     kpmgFile = r"\\nykads01\data\CLI\_Manny_Borges_BOS\ITO_Report\KPMGs_Plate.html"
491     closedFile = r"\\nykads01\data\CLI\_Manny_Borges_BOS\ITO_Report\Closed_Items.html"
492     projectViewFile = r"\\nykads01\data\CLI\_Manny_Borges_BOS\ITO_Report\Project_View.html"
493     dataDir = r"\\nykads01\data\CLI\_Manny_Borges_BOS\ITO_Report\Data"
494     # Devstuff.
495 nino.borges 514 #exportFile = "T:\honeywell\ITO_Report\Export\export.csv"
496     #indexFile= "T:\honeywell\ITO_Report\index2.html"
497     #kpmgFile = "T:\honeywell\ITO_Report\KPMGs_Plate.html"
498     #closedFile = "T:\honeywell\ITO_Report\Closed_Items.html"
499     #projectViewFile = "T:\honeywell\ITO_Report\Project_View.html"
500 nino.borges 519 #dataDir =
501 nino.borges 523
502 nino.borges 524
503 nino.borges 523 print "Fixing export file..."
504     rawContents = open(exportFile).readlines()
505     fixedFile = open(exportFile,'w')
506     for ri in rawContents:
507     fixedFile.write(ri.replace('","','"|"'))
508     fixedFile.close()
509     print "File fixed."
510    
511 nino.borges 499 openMWEList,openKPMGList, closedList = SplitIntoPlates(exportFile)
512     print "mwe list %s"%len(openMWEList)
513     print "kpmg list %s"%len(openKPMGList)
514     print "closed list %s"%len(closedList)
515     mwePlate = SplitIntoSections(openMWEList)
516     kpmgPlate = SplitIntoSections(openKPMGList)
517     closedPlate = SplitIntoSections(closedList)
518    
519 nino.borges 502 headdingList = ["MWE's Plate (%s items)"%len(openMWEList),"KPMG's Plate (%s items)"%len(openKPMGList),"Closed Requests (%s items)"%len(closedList)]
520    
521 nino.borges 514 CreateDetailPages(dataDir,mwePlate)
522     CreateDetailPages(dataDir,kpmgPlate)
523     CreateDetailPages(dataDir,closedPlate)
524    
525 nino.borges 502 CreateBaseReport(open(indexFile,'w'))
526     CreateBaseReport(open(kpmgFile,'w'))
527     CreateBaseReport(open(closedFile,'w'))
528     CreateBaseReport(open(projectViewFile,'w'))
529    
530     ProcessToHTML(mwePlate,open(indexFile,'a'),headdingList,"MWE's List")
531     ProcessToHTML(kpmgPlate,open(kpmgFile,'a'),headdingList,"KPMG's List")
532     ProcessToHTML(closedPlate,open(closedFile,'a'),headdingList,"Closed List")
533 nino.borges 505 GetProjectList(mwePlate,kpmgPlate,closedPlate,open(projectViewFile,'a'),headdingList)
534 nino.borges 502
535     FinishReport(open(indexFile,'a'))
536     FinishReport(open(kpmgFile,'a'))
537     FinishReport(open(closedFile,'a'))
538 nino.borges 504 FinishReport(open(projectViewFile,'a'))
539 nino.borges 505