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 504 by nino.borges, Thu Jan 9 21:43:30 2014 UTC vs.
Revision 505 by nino.borges, Fri Jan 10 15:24:14 2014 UTC

# Line 70 | Line 70 | def FinishReport(outputFile):
70      """)
71      outputFile.close()
72  
73 < def GetProjectList(mwePlate,kpmgPlate,closedPlate):
73 > def GetProjectList(mwePlate,kpmgPlate,closedPlate,outputFile,headdingList):
74      """Combines the plates (not lists) into the project list, so that you can populate the project view"""
75      ## cycle through the 2 open lists and only pull from the closed list, if the proj exists in the first two.
76      ## Everything should already be in a matrix by catagory.
77      projectMatrix = {}
78      for i in mwePlate.keys():
79 <        for p in mwePlate[i]:
80 <            project = p[3]
81 <            if project in projectMatrix.keys():
82 <                projectMatrix[project].append(p)
83 <            else:
84 <                projectMatrix[project] = [p]
79 >        for p in mwePlate[i]:
80 >            project = p[3]
81 >            if project == '""':
82 >                project = "Tasks"
83 >            if project in projectMatrix.keys():
84 >                projectMatrix[project].append(["MWE",p])
85 >            else:
86 >                projectMatrix[project] = [["MWE",p],]
87      for i in kpmgPlate.keys():
88 <        for p in kpmgPlate[i]:
89 <            project = p[3]
90 <            if project in projectMatrix.keys():
91 <                projectMatrix[project].append(p)
92 <            else:
93 <                projectMatrix[project] = [p,]
88 >        for p in kpmgPlate[i]:
89 >            project = p[3]
90 >            if project=='""':
91 >                project = "Tasks"
92 >            if project in projectMatrix.keys():
93 >                projectMatrix[project].append(["KPMG",p])
94 >            else:
95 >                projectMatrix[project] = [["KPMG",p],]
96 >    for i in closedPlate.keys():
97 >        for p in closedPlate[i]:
98 >            project = p[3]
99 >            if project in projectMatrix.keys():
100 >                projectMatrix[project].append(["Closed",p])
101 >    outputFile.write("""
102 >    <div id="menu">
103 >      <ul>
104 >      """)
105 >    outputFile.write('<li><a href="index2.html">%s</a></li>\n'% headdingList[0])
106 >    outputFile.write('<li><a href="KPMGs_Plate.html">%s</a></li>\n'% headdingList[1])
107 >    outputFile.write('<li><a href="Closed_Items.html">%s</a></li>\n'% headdingList[2])
108 >    outputFile.write("""
109 >            <li><a class="current" href="Project_View.html">Project View</a></li>
110 >          </ul>
111 >        </div>
112 >
113 > <div id="feature">
114 >  <div class="left">
115 >    <h2>About the Project View</h2>
116 >    <p>The project view takes the open items and formats them as a "project".</p>
117 >  </div>
118 >  <div class="clear">&nbsp;</div>
119 >  </div>
120 >  <div id="main">
121 >  <div id="content">""")
122      for p in projectMatrix.keys():
123 <        print p
124 <        print str(projectMatrix[p])
125 <        print "---------------"
123 >        outputFile.write("<ul><li>%s<ul>"% p)
124 >        for i in projectMatrix[p]:
125 >            if i[0] == "Closed":
126 >                outputFile.write('<li><table border="1"><tr><td><strike>%s</strike></td><td><strike>%s</strike></td><td><strike>%s</strike></td></tr></table> --- %s</li>'% (i[1][0],i[1][1],i[1][4],i[0]))
127 >            else:
128 >                outputFile.write('<li> %s<table border="1"><tr><td>%s</td><td>%s</td><td>%s</td></tr></table></li>'% (i[0],i[1][0],i[1][1],i[1][4]))
129 >        outputFile.write("</ul></li></ul><hr 40%>")
130 >    outputFile.write("""</div></div>""")
131 >    outputFile.close()
132  
133  
134   def SplitIntoPlates(exportFile):
# Line 167 | Line 203 | def ProcessToHTML(currentMatrix,outputFi
203          outputFile.write("""        </ul>
204        </div>
205  
206 <          <div class="sidebarbox">
207 <            <h2>Text box</h2>
208 <            <p>Important links:</p>
209 <            <ul>
210 <              <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
211 <              <li><a href="#">Another</a></li>
212 <            </ul>
213 <          </div>
214 <        </div>
206 >          <div class="sidebarbox">
207 >            <h2>Text box</h2>
208 >            <p>Important links:</p>
209 >            <ul>
210 >              <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
211 >              <li><a href="#">Another</a></li>
212 >            </ul>
213 >          </div>
214 >        </div>
215  
216    <div id="content">
217    """)
# Line 216 | Line 252 | def ProcessToHTML(currentMatrix,outputFi
252          outputFile.write("""        </ul>
253        </div>
254  
255 <          <div class="sidebarbox">
256 <            <h2>Text box</h2>
257 <            <p>Important links:</p>
258 <            <ul>
259 <              <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
260 <              <li><a href="#">Another</a></li>
261 <            </ul>
262 <          </div>
263 <        </div>
255 >          <div class="sidebarbox">
256 >            <h2>Text box</h2>
257 >            <p>Important links:</p>
258 >            <ul>
259 >              <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
260 >              <li><a href="#">Another</a></li>
261 >            </ul>
262 >          </div>
263 >        </div>
264  
265    <div id="content">
266    """)
# Line 264 | Line 300 | def ProcessToHTML(currentMatrix,outputFi
300          outputFile.write("""        </ul>
301        </div>
302  
303 <          <div class="sidebarbox">
304 <            <h2>Text box</h2>
305 <            <p>Important links:</p>
306 <            <ul>
307 <              <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
308 <              <li><a href="#">Another</a></li>
309 <            </ul>
310 <          </div>
311 <        </div>
303 >          <div class="sidebarbox">
304 >            <h2>Text box</h2>
305 >            <p>Important links:</p>
306 >            <ul>
307 >              <li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li>
308 >              <li><a href="#">Another</a></li>
309 >            </ul>
310 >          </div>
311 >        </div>
312  
313    <div id="content">
314    """)
# Line 304 | Line 340 | def ProcessToHTML(currentMatrix,outputFi
340      outputFile.close()
341  
342   if __name__ == '__main__':
343 <    #exportFile = "/Users/ninoborges/Dropbox/Misc/export_20140109_011143.csv"
344 <    #indexFile = "/Users/ninoborges/Documents/ITO_Report/index2.html"
345 <    #kpmgFile = "/Users/ninoborges/Documents/ITO_Report/KPMGs_Plate.html"
346 <    #closedFile = "/Users/ninoborges/Documents/ITO_Report/Closed_Items.html"
347 <    #projectViewFile = "/Users/ninoborges/Documents/ITO_Report/Project_View.html"
348 <    exportFile = "T:\honeywell\ITO_Report\Export\export.csv"
349 <    indexFile= "T:\honeywell\ITO_Report\index2.html"
350 <    kpmgFile = "T:\honeywell\ITO_Report\KPMGs_Plate.html"
351 <    closedFile = "T:\honeywell\ITO_Report\Closed_Items.html"
352 <    projectViewFile = "T:\honeywell\ITO_Report\Project_View.html"
343 >    exportFile = "/Users/ninoborges/Dropbox/Misc/export_20140109_011143.csv"
344 >    indexFile = "/Users/ninoborges/Documents/ITO_Report/index2.html"
345 >    kpmgFile = "/Users/ninoborges/Documents/ITO_Report/KPMGs_Plate.html"
346 >    closedFile = "/Users/ninoborges/Documents/ITO_Report/Closed_Items.html"
347 >    projectViewFile = "/Users/ninoborges/Documents/ITO_Report/Project_View.html"
348 >    #exportFile = "T:\honeywell\ITO_Report\Export\export.csv"
349 >    #indexFile= "T:\honeywell\ITO_Report\index2.html"
350 >    #kpmgFile = "T:\honeywell\ITO_Report\KPMGs_Plate.html"
351 >    #closedFile = "T:\honeywell\ITO_Report\Closed_Items.html"
352 >    #projectViewFile = "T:\honeywell\ITO_Report\Project_View.html"
353      openMWEList,openKPMGList, closedList = SplitIntoPlates(exportFile)
354      print "mwe list %s"%len(openMWEList)
355      print "kpmg list %s"%len(openKPMGList)
# Line 332 | Line 368 | if __name__ == '__main__':
368      ProcessToHTML(mwePlate,open(indexFile,'a'),headdingList,"MWE's List")
369      ProcessToHTML(kpmgPlate,open(kpmgFile,'a'),headdingList,"KPMG's List")
370      ProcessToHTML(closedPlate,open(closedFile,'a'),headdingList,"Closed List")
371 +    GetProjectList(mwePlate,kpmgPlate,closedPlate,open(projectViewFile,'a'),headdingList)
372  
373      FinishReport(open(indexFile,'a'))
374      FinishReport(open(kpmgFile,'a'))
375      FinishReport(open(closedFile,'a'))
376      FinishReport(open(projectViewFile,'a'))
377 <    GetProjectList(mwePlate,kpmgPlate,closedPlate)
377 >    

Diff Legend

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