~tom-hoffman/+junk/cando-archiver

« back to all changes in this revision

Viewing changes to cando-archiver.py

  • Committer: Tom Hoffman
  • Date: 2011-06-03 16:40:32 UTC
  • Revision ID: tom.hoffman@gmail.com-20110603164032-068pzrla7cvmca4l
Added url quoting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
# then download all the section records from the year you designate.
11
11
 
12
12
import os
 
13
import urllib
13
14
 
14
15
import argparse
15
16
import xlrd
29
30
    for row_index in range(sections_sheet.nrows):
30
31
        if sections_sheet.cell(row_index, 0).value == u'ID':
31
32
            section_id = sections_sheet.cell(row_index, 1).value
32
 
            path = "%s/schoolyears/%s/%s/sections/%s/gradeCompetencies/scr_archive" % (server, year_id, term_id, section_id)
 
33
            esc = urllib.quote("/schoolyears/%s/%s/sections/%s/gradeCompetencies/scr_archive" % (year_id, term_id, section_id))
 
34
            path = server + esc
33
35
            pdfName = '%s-%s-%s.pdf' % (year_id, term_id, section_id)
34
36
            pdfPath = "%s/%s/%s/%s" % (output, year_id, term_id, pdfName)
35
37
            if os.access(pdfPath, os.R_OK):