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

« back to all changes in this revision

Viewing changes to ivle/cgirequest.py

  • Committer: Matt Giuca
  • Date: 2009-02-24 02:02:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: matt.giuca@gmail.com-20090224020203-aqdcjnsj6y7wl32o
Added a new look to the IVLE header bar. Mmmm... Web 2.0.
Added top-level directory image-source, containing SVG and script files for
    generating the images.
ivle/webapp/coremedia/images: Added 'chrome' directory containing the rendered
    images.
Modified ivle/webapp/base/ivle-headings.html and
    ivle/webapp/coremedia/ivle.css to support the new images.
    Note that the H1 and H2 at the top of the page are no longer displayed
    (and their custom styles have been removed). There is a heading image
    instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
import sys
29
29
import os
30
 
import os.path
31
30
import cgi
32
31
import urllib
33
32
import traceback
138
137
        self.uri = os.environ['SCRIPT_NAME'] + os.environ['PATH_INFO']
139
138
        # Split the given path into the app (top-level dir) and sub-path
140
139
        # (after first stripping away the root directory)
141
 
        path = self.unmake_path(self.uri)
 
140
        path = ivle.util.unmake_path(self.uri)
142
141
        if self.publicmode:
143
142
            self.app = None
144
143
            (_, self.path) = (ivle.util.split_path(path))
273
272
        self.flush()
274
273
        sys.exit(self.status)
275
274
 
276
 
    def unmake_path(self, path):
277
 
        """Strip the IVLE URL prefix from the given path, if present.
278
 
 
279
 
        Also normalises the path.
280
 
        """
281
 
        path = os.path.normpath(path)
282
 
        root = os.path.normpath(ivle.conf.root_dir)
283
 
 
284
 
        if path.startswith(root):
285
 
            path = path[len(root):]
286
 
            # Take out the slash as well
287
 
            if len(path) > 0 and path[0] == os.sep:
288
 
                path = path[1:]
289
 
 
290
 
        return path
291
 
 
292
275
    def get_session(self):
293
276
        """Returns a mod_python Session object for this request.
294
277
        Note that this is dependent on mod_python and may need to change