| 81 | |
| 82 | |
| 83 | def draw_stats(workbook): |
| 84 | stats_sheet = excel.sheet(workbook, 'Stats') |
| 85 | if not stats_sheet: |
| 86 | stats_sheet = workbook.create_sheet('Stats') |
| 87 | |
| 88 | data_col = 2 # the starting distance data column |
| 89 | for ws in workbook.worksheets: |
| 90 | if ws.title == 'Stats': |
| 91 | continue |
| 92 | |
| 93 | alphas, stats = calc_stats(ws) |
| 94 | |
| 95 | # Sets or checks the alpha column. |
| 96 | if data_col == 2: |
| 97 | excel.fillout(stats_sheet, (1, 1), alphas) |
| 98 | else: |
| 99 | a = excel.fillin(stats_sheet, (1, 1), len(alphas), 1) |
| 100 | assert a == alphas |
| 101 | |
| 102 | # Sets the distance column(s) for the current worksheet. |
| 103 | excel.fillout(stats_sheet, (1, data_col), stats) |
| 104 | |
| 105 | data_col += len(stats[0]) |
| 106 | |
| 107 | |
| 108 | def main(): |