| 8 |
|
Creates an easy to read report from the issue tracker export of "all issues". |
| 9 |
|
|
| 10 |
|
""" |
| 11 |
+ |
import os |
| 12 |
|
|
| 13 |
< |
|
| 13 |
< |
def CreateBaseReport(outputFile): |
| 13 |
> |
def CreateBaseReport(outputFile,cssLocation="main.css"): |
| 14 |
|
"""Creates the top of the HTML file""" |
| 15 |
|
outputFile.write(""" |
| 16 |
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.5 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 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" /> |
| 22 |
> |
<meta name="author" content="Emanuel Borges">""") |
| 23 |
> |
outputFile.write(' <link rel="stylesheet" type="text/css" href="%s" title="ITO Report" media="all" />'%cssLocation) |
| 24 |
> |
outputFile.write(""" |
| 25 |
|
<title>ITO Report</title> |
| 26 |
|
</head> |
| 27 |
|
|
| 243 |
|
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>") |
| 244 |
|
for x in currentMatrix[section]: |
| 245 |
|
outputFile.write("<tr>\n") |
| 246 |
+ |
count = 0 |
| 247 |
|
for y in x: |
| 248 |
< |
outputFile.write("<td>%s</td>"%y) |
| 248 |
> |
if count == 0: |
| 249 |
> |
outputFile.write('<td><a href="data/%s.html">%s</a></td>'%(y.replace('"',""),y)) |
| 250 |
> |
else: |
| 251 |
> |
outputFile.write("<td>%s</td>"%y) |
| 252 |
> |
count = count + 1 |
| 253 |
|
outputFile.write("</tr>\n") |
| 254 |
|
outputFile.write("</table></center><br><br>\n") |
| 255 |
|
|
| 297 |
|
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>") |
| 298 |
|
for x in currentMatrix[section]: |
| 299 |
|
outputFile.write("<tr>\n") |
| 300 |
+ |
count = 0 |
| 301 |
|
for y in x: |
| 302 |
< |
outputFile.write("<td>%s</td>"%y) |
| 302 |
> |
if count == 0: |
| 303 |
> |
outputFile.write('<td><a href="data/%s.html">%s</a></td>'%(y.replace('"',""),y)) |
| 304 |
> |
else: |
| 305 |
> |
outputFile.write("<td>%s</td>"%y) |
| 306 |
> |
count = count + 1 |
| 307 |
|
outputFile.write("</tr>\n") |
| 308 |
|
outputFile.write("</table></center><br><br>\n") |
| 309 |
|
elif part[:3] == "Clo": |
| 350 |
|
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>") |
| 351 |
|
for x in currentMatrix[section]: |
| 352 |
|
outputFile.write("<tr>\n") |
| 353 |
+ |
count = 0 |
| 354 |
|
for y in x: |
| 355 |
< |
outputFile.write("<td>%s</td>"%y) |
| 355 |
> |
if count == 0: |
| 356 |
> |
outputFile.write('<td><a href="data/%s.html">%s</a></td>'%(y.replace('"',""),y)) |
| 357 |
> |
else: |
| 358 |
> |
outputFile.write("<td>%s</td>"%y) |
| 359 |
> |
count = count + 1 |
| 360 |
|
outputFile.write("</tr>\n") |
| 361 |
|
outputFile.write("</table></center><br><br>\n") |
| 362 |
|
else: |
| 376 |
|
## outputFile.write("</table></center>\n") |
| 377 |
|
outputFile.close() |
| 378 |
|
|
| 379 |
+ |
def CreateDetailPages(dataDir,matrix): |
| 380 |
+ |
"""Creates all of the indv task detail pages""" |
| 381 |
+ |
for i in matrix.keys(): |
| 382 |
+ |
for y in matrix[i]: |
| 383 |
+ |
fileName = "%s.html"%y[0].replace('"','') |
| 384 |
+ |
#fileName = "%s.html"%matrix[i][0][0].replace('"','') |
| 385 |
+ |
outputFile = open(os.path.join(dataDir,fileName),'w') |
| 386 |
+ |
CreateBaseReport(outputFile,"../main.css") |
| 387 |
+ |
|
| 388 |
+ |
outputFile = open(os.path.join(dataDir,fileName),'a') |
| 389 |
+ |
outputFile.write(""" |
| 390 |
+ |
<div id="main"> |
| 391 |
+ |
<div id="sidebar"> |
| 392 |
+ |
<div class="sidebarbox"> |
| 393 |
+ |
<h2>Text box</h2> |
| 394 |
+ |
<p>Important links:</p> |
| 395 |
+ |
<ul> |
| 396 |
+ |
<li><a href="https://fts.shs.us.kpmg.com/vpn/index.html">KPMG Relativity</a></li> |
| 397 |
+ |
<li><a href="#">Another</a></li> |
| 398 |
+ |
</ul> |
| 399 |
+ |
</div> |
| 400 |
+ |
</div> |
| 401 |
+ |
|
| 402 |
+ |
<div id="content"> |
| 403 |
+ |
""") |
| 404 |
+ |
outputFile.write("<form>") |
| 405 |
+ |
outputFile.write('<label for="id">Object ID:</label><input type="text" name="id" value=" %s" disabled="Disabled"><br><br>'%y[0].replace('"','')) |
| 406 |
+ |
outputFile.write('<label for="kpmgStatus">KPMG Status:</label><input type="text" name="kpmgStatus" placeholder=" %s" disabled><br><br>'%y[1].replace('"','')) |
| 407 |
+ |
outputFile.write('<label for="mweStatus">MWE Status:</label><input type="text" name="mweStatus" placeholder=" %s" disabled><br><br>'%y[2].replace('"','')) |
| 408 |
+ |
outputFile.write('<label for="TE_Prefix">Time Entry Prefix:</label><input type="text" name="TE_Prefix" value=" %s" disabled><br><br>'%y[3].replace('"','')) |
| 409 |
+ |
|
| 410 |
+ |
outputFile.write('<label for="Requestor">Requestor:</label><input type="text" name="Requestor" value=" %s" disabled><br><br>'%y[5].replace('"','')) |
| 411 |
+ |
outputFile.write('<label for="assignedTo">Assigned to:</label><input type="text" name="assignedTo" value=" %s" disabled><br><br>'%y[6].replace('"','')) |
| 412 |
+ |
outputFile.write('<label for="Created">Created:</label><input type="text" name="Created" value=" %s" disabled><br><br>'%y[7].replace('"','')) |
| 413 |
+ |
outputFile.write('<label for="Modified">Last Modified:</label><input type="text" name="Modified" value=" %s" disabled><br><br>'%y[8].replace('"','')) |
| 414 |
+ |
outputFile.write('<label for="TE_Descr">Time Entry Description:</label><br><textarea rows="4" cols="50" name="TE_Descr" disabled>%s</textarea><br>'%y[4].replace('"','')) |
| 415 |
+ |
outputFile.write("</form>") |
| 416 |
+ |
outputFile.close() |
| 417 |
+ |
|
| 418 |
+ |
FinishReport(open(os.path.join(dataDir,fileName),'a')) |
| 419 |
+ |
|
| 420 |
+ |
|
| 421 |
|
if __name__ == '__main__': |
| 422 |
< |
#exportFile = "/Users/ninoborges/Dropbox/Misc/export_20140109_011143.csv" |
| 423 |
< |
#indexFile = "/Users/ninoborges/Documents/ITO_Report/index2.html" |
| 424 |
< |
#kpmgFile = "/Users/ninoborges/Documents/ITO_Report/KPMGs_Plate.html" |
| 425 |
< |
#closedFile = "/Users/ninoborges/Documents/ITO_Report/Closed_Items.html" |
| 426 |
< |
#projectViewFile = "/Users/ninoborges/Documents/ITO_Report/Project_View.html" |
| 427 |
< |
exportFile = "T:\honeywell\ITO_Report\Export\export.csv" |
| 428 |
< |
indexFile= "T:\honeywell\ITO_Report\index2.html" |
| 429 |
< |
kpmgFile = "T:\honeywell\ITO_Report\KPMGs_Plate.html" |
| 430 |
< |
closedFile = "T:\honeywell\ITO_Report\Closed_Items.html" |
| 431 |
< |
projectViewFile = "T:\honeywell\ITO_Report\Project_View.html" |
| 422 |
> |
exportFile = "/Users/ninoborges/Dropbox/Misc/export_20140109_011143.csv" |
| 423 |
> |
indexFile = "/Users/ninoborges/Documents/ITO_Report/index2.html" |
| 424 |
> |
kpmgFile = "/Users/ninoborges/Documents/ITO_Report/KPMGs_Plate.html" |
| 425 |
> |
closedFile = "/Users/ninoborges/Documents/ITO_Report/Closed_Items.html" |
| 426 |
> |
projectViewFile = "/Users/ninoborges/Documents/ITO_Report/Project_View.html" |
| 427 |
> |
dataDir = "/Users/ninoborges/Documents/ITO_Report/Data" |
| 428 |
> |
#exportFile = "T:\honeywell\ITO_Report\Export\export.csv" |
| 429 |
> |
#indexFile= "T:\honeywell\ITO_Report\index2.html" |
| 430 |
> |
#kpmgFile = "T:\honeywell\ITO_Report\KPMGs_Plate.html" |
| 431 |
> |
#closedFile = "T:\honeywell\ITO_Report\Closed_Items.html" |
| 432 |
> |
#projectViewFile = "T:\honeywell\ITO_Report\Project_View.html" |
| 433 |
> |
#dataDir = |
| 434 |
|
openMWEList,openKPMGList, closedList = SplitIntoPlates(exportFile) |
| 435 |
|
print "mwe list %s"%len(openMWEList) |
| 436 |
|
print "kpmg list %s"%len(openKPMGList) |
| 441 |
|
|
| 442 |
|
headdingList = ["MWE's Plate (%s items)"%len(openMWEList),"KPMG's Plate (%s items)"%len(openKPMGList),"Closed Requests (%s items)"%len(closedList)] |
| 443 |
|
|
| 444 |
+ |
CreateDetailPages(dataDir,mwePlate) |
| 445 |
+ |
CreateDetailPages(dataDir,kpmgPlate) |
| 446 |
+ |
CreateDetailPages(dataDir,closedPlate) |
| 447 |
+ |
|
| 448 |
|
CreateBaseReport(open(indexFile,'w')) |
| 449 |
|
CreateBaseReport(open(kpmgFile,'w')) |
| 450 |
|
CreateBaseReport(open(closedFile,'w')) |