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

« back to all changes in this revision

Viewing changes to bin/ivle-cloneworksheets

  • Committer: David Coles
  • Date: 2010-07-17 11:32:50 UTC
  • Revision ID: coles.david@gmail.com-20100717113250-vi18n50bcjmfmzrt
Show warning for CGI header field-names which contain restricted characters.

Forbidden characters are the separators defined by RFC3875. This is mainly to 
fix an issue where printing a dictionary (with no CGI headers) could be 
assumed to be a CGI header with no warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    sys.exit(1)
31
31
 
32
32
if len(sys.argv) != 7:
33
 
    print >> sys.stderr, "usage: %s <oldsubjectcode> <oldyear> <oldsemestercode> "\
34
 
                         "<newsubjectcode> <newyear> <newsemestercode>" \
 
33
    print >> sys.stderr, "usage: %s <oldsubjectcode> <oldyear> <oldsemester> "\
 
34
                         "<newsubjectcode> <newyear> <newsemester>" \
35
35
                         % os.path.basename(sys.argv[0])
36
36
    sys.exit()
37
37
 
40
40
src = store.find(Offering,
41
41
                 Subject.code == unicode(sys.argv[1]),
42
42
                 Semester.year == unicode(sys.argv[2]),
43
 
                 Semester.code == unicode(sys.argv[3]),
 
43
                 Semester.semester == unicode(sys.argv[3]),
44
44
                 Offering.subject_id == Subject.id,
45
45
                 Offering.semester_id == Semester.id).one()
46
46
 
47
47
dst = store.find(Offering,
48
48
                 Subject.code == unicode(sys.argv[4]),
49
49
                 Semester.year == unicode(sys.argv[5]),
50
 
                 Semester.code == unicode(sys.argv[6]),
 
50
                 Semester.semester == unicode(sys.argv[6]),
51
51
                 Offering.subject_id == Subject.id,
52
52
                 Offering.semester_id == Semester.id).one()
53
53