|
Revision 20, 1.1 KB
(checked in by amirh, 2 years ago)
|
|
|
| Line | |
|---|
| 1 | arch = "virtex5" |
|---|
| 2 | command = "run" |
|---|
| 3 | logfile = open('logfile','r') |
|---|
| 4 | lines = logfile.readlines() |
|---|
| 5 | logfile.close() |
|---|
| 6 | |
|---|
| 7 | expecting_attr = True |
|---|
| 8 | expecting_desc = False |
|---|
| 9 | expecting_opts = False |
|---|
| 10 | buf = "" |
|---|
| 11 | attr = "" |
|---|
| 12 | descr = "" |
|---|
| 13 | opts = () |
|---|
| 14 | Description = {} |
|---|
| 15 | Options = {} |
|---|
| 16 | for line in lines: |
|---|
| 17 | if expecting_attr: |
|---|
| 18 | attr = line.split(":")[0].lstrip('-').rstrip(' ') |
|---|
| 19 | descr = line.split(":")[1].lstrip(' ').rstrip('\r\n') |
|---|
| 20 | Description[attr] = descr |
|---|
| 21 | expecting_attr = False |
|---|
| 22 | expecting_opts = True |
|---|
| 23 | elif expecting_opts: |
|---|
| 24 | Options[attr] = [option.lstrip('\t ').rstrip('\r\n ') for option in line.split('/')] |
|---|
| 25 | expecting_attr = True |
|---|
| 26 | expecting_opts = False |
|---|
| 27 | |
|---|
| 28 | import win32com.client |
|---|
| 29 | Excel = win32com.client.Dispatch("Excel.Applcation") |
|---|
| 30 | XST_Settings = Excel.Workbooks.Add() |
|---|
| 31 | Row = 0 |
|---|
| 32 | |
|---|
| 33 | for attr in Options.iterkeys(): |
|---|
| 34 | XST_Settings.Sheets(1).Cells(Row,1).Value = attr |
|---|
| 35 | XST_Settings.Sheets(1).Cells(Row,2).Value = Description[attr] |
|---|
| 36 | XST_Settings.Sheets(1).Cells(Row,3).Value = repr(Options[attr]) |
|---|
| 37 | Row = Row + 1 |
|---|
| 38 | |
|---|
| 39 | XST_Settings.SaveAs('XST_%s_%s.xlsx'%(arch,command)) |
|---|