~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to bin/ivle-cloneworksheets

  • Committer: Matt Giuca
  • Date: 2009-05-12 15:08:45 UTC
  • mto: This revision was merged to the branch mainline in revision 1247.
  • Revision ID: matt.giuca@gmail.com-20090512150845-fg480l1qh7le0ypz
ivle-fetchsubmissions: In a stunningly awful hack, detects pre-Python2.6 and
    changes make_zip to behave correctly for the awful restriction in zipfile
    that you can't add directories.
    (Stops trying to add directories, and hacks in the footer writing if there
    is an empty file).

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
if dst.worksheets.count() > 0:
55
55
    die('%r already has worksheets - doing nothing' % dst)
56
56
 
57
 
dst.clone_worksheets(src)
 
57
for oldws in src.worksheets:
 
58
    newws = Worksheet()
 
59
    newws.seq_no = oldws.seq_no
 
60
    newws.identifier = oldws.identifier
 
61
    newws.name = oldws.name
 
62
    newws.assessable = oldws.assessable
 
63
    newws.data = oldws.data
 
64
    newws.format = oldws.format
 
65
    newws.offering = dst
 
66
    store.add(newws)
 
67
    ivle.worksheet.utils.update_exerciselist(newws)
58
68
 
59
69
print >> sys.stderr, 'copied %d worksheets from %r to %r' \
60
70
                     % (dst.worksheets.count(), src, dst)