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

« back to all changes in this revision

Viewing changes to ivle/fileservice_lib/listing.py

  • Committer: William Grant
  • Date: 2009-01-22 04:02:36 UTC
  • mfrom: (1089)
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: grantw@unimelb.edu.au-20090122040236-nm0lby0aymmzk5d7
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
    # Currently goes to 403 Forbidden.
147
147
    urlpath = urlparse.urlparse(path)
148
148
    path = urlpath[2]
 
149
    json = None
149
150
    if path is None:
150
151
        req.status = req.HTTP_FORBIDDEN
151
152
        req.headers_out['X-IVLE-Return-Error'] = 'Forbidden'
158
159
        # It's a directory. Return the directory listing.
159
160
        req.content_type = mime_dirlisting
160
161
        req.headers_out['X-IVLE-Return'] = 'Dir'
161
 
        req.write(cjson.encode(get_dirlisting(req, svnclient, path)))
 
162
        # TODO: Fix this dirty, dirty hack
 
163
        newjson = get_dirlisting(req, svnclient, path)
 
164
        if ("X-IVLE-Action-Error" in req.headers_out):
 
165
            newjson["Error"] = req.headers_out["X-IVLE-Action-Error"]
 
166
        req.write(cjson.encode(newjson))
162
167
    elif return_contents:
163
168
        # It's a file. Return the file contents.
164
169
        # First get the mime type of this file