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

« back to all changes in this revision

Viewing changes to ivle/fileservice_lib/__init__.py

  • Committer: William Grant
  • Date: 2009-02-23 23:47:02 UTC
  • mfrom: (1099.1.211 new-dispatch)
  • Revision ID: grantw@unimelb.edu.au-20090223234702-db4b1llly46ignwo
Merge from lp:~ivle-dev/ivle/new-dispatch.

Pretty much everything changes. Reread the setup docs. Backup your databases.
Every file is now in a different installed location, the configuration system
is rewritten, the dispatch system is rewritten, URLs are different, the
database is different, worksheets and exercises are no longer on the
filesystem, we use a templating engine, jail service protocols are rewritten,
we don't repeat ourselves, we have authorization rewritten, phpBB is gone,
and probably lots of other things that I cannot remember.

This is certainly the biggest commit I have ever made, and hopefully
the largest I ever will.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
# See listing.py for a full description of the output format of the directory
79
79
# listing.
80
80
 
81
 
import os
82
 
import shutil
83
 
import stat
84
 
import time
85
 
import mimetypes
86
81
import urllib
87
82
 
88
 
import cjson
89
 
import pysvn
90
 
 
91
 
from ivle import (util, studpath)
92
 
 
93
 
import action, listing
 
83
import ivle.fileservice_lib.action
 
84
import ivle.fileservice_lib.listing
94
85
 
95
86
# Mime types
96
87
# application/json is the "best" content type but is not good for
100
91
 
101
92
def handle(req):
102
93
    """Handler for the File Services application."""
103
 
    # Make sure the logged in user has permission to see this file
104
 
    # FIXME: Still need to authorize subpaths in actions
105
 
    #studpath.authorize(req)
106
 
 
107
 
    # Set request attributes
108
 
    req.write_html_head_foot = False     # No HTML
109
94
 
110
95
    # We really, really don't want the responses to be cached.
111
96
    req.headers_out['Cache-Control'] = 'no-store, must-revalidate'
120
105
    
121
106
    if act is not None:
122
107
        try:
123
 
            action.handle_action(req, act, fields)
 
108
            ivle.fileservice_lib.action.handle_action(req, act, fields)
124
109
        except action.ActionError, message:
125
110
            req.headers_out['X-IVLE-Action-Error'] = urllib.quote(str(message))
126
111
 
127
112
    return_type = fields.getfirst('return')
128
 
    listing.handle_return(req, return_type == "contents")
 
113
    ivle.fileservice_lib.listing.handle_return(req, return_type == "contents")