Merge lp:~aelkner/schooltool/workbook_filename_bug into lp:schooltool/1.7

Proposed by Alan Elkner
Status: Merged
Merged at revision: 2739
Proposed branch: lp:~aelkner/schooltool/workbook_filename_bug
Merge into: lp:schooltool/1.7
Diff against target: 14 lines (+2/-2)
1 file modified
src/schooltool/export/export.py (+2/-2)
To merge this branch: bzr merge lp:~aelkner/schooltool/workbook_filename_bug
Reviewer Review Type Date Requested Status
SchoolTool Owners Pending
Review via email: mp+39813@code.launchpad.net

Description of the change

The underlying workbook library simply crashes when the filename is larger than 31 characters, so I truncates the year name at 10 chars and the term at 11 to make sure it never got larger than 31.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/schooltool/export/export.py'
2--- src/schooltool/export/export.py 2009-11-19 02:00:46 +0000
3+++ src/schooltool/export/export.py 2010-11-02 01:51:04 +0000
4@@ -497,8 +497,8 @@
5 for school_year in sorted(school_years, key=lambda i: i.last):
6 for term in sorted(school_year.values(), key=lambda i: i.last):
7 row = 0
8- ws = wb.add_sheet("Sections %s %s" % (school_year.__name__,
9- term.__name__))
10+ ws = wb.add_sheet("Sections %s %s" % (school_year.__name__[:10],
11+ term.__name__[:11]))
12
13 self.write_header(ws, row, 0, "School Year")
14 self.write(ws, row, 1, school_year.__name__)

Subscribers

People subscribed via source and target branches