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

« back to all changes in this revision

Viewing changes to ivle/dispatch/__init__.py

  • Committer: chadnickbok
  • Date: 2009-01-19 22:56:46 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1170
This commit fixes issue #10 and part of issue #9

There are now two options for moving files with their
svn history intact; svn move and svn copy. These
use the svn commands to move the files, allowing students
to move and rename files without their histories being
lost.

This commit also shows the svn status of a dir, if it is
the 'head' of an svn repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
        httpcode = None
194
194
        req.status = apache.HTTP_INTERNAL_SERVER_ERROR
195
195
    try:
196
 
        publicmode = req.publicmode
197
 
    except AttributeError:
198
 
        publicmode = True
199
 
    try:
200
196
        login = req.user.login
201
197
    except AttributeError:
202
198
        login = None
203
 
    try:
204
 
        role = req.user.role
205
 
    except AttributeError:
206
 
        role = None
207
199
 
208
200
    # Log File
209
201
    try:
299
291
 
300
292
        # Logging
301
293
        logging.error('%s\n%s'%(str(msg), tb))
302
 
        # Error messages are only displayed is the user is NOT a student,
303
 
        # or if there has been a problem logging the error message
304
 
        show_errors = (not publicmode) and (not login or \
305
 
                            (not str(role) == "student") or logfail)
 
294
 
306
295
        req.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"                 
307
296
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">                                      
308
297
<html xmlns="http://www.w3.org/1999/xhtml">
309
298
<head><title>IVLE Internal Server Error</title></head>
310
299
<body>
311
300
<h1>IVLE Internal Server Error""")
312
 
        if (show_errors):
313
 
            if (codename is not None
314
 
                        and httpcode != apache.HTTP_INTERNAL_SERVER_ERROR):
315
 
                req.write(": %s" % cgi.escape(codename))
316
 
        
 
301
        if (codename is not None
 
302
            and httpcode != apache.HTTP_INTERNAL_SERVER_ERROR):
 
303
            req.write(": %s" % cgi.escape(codename))
317
304
        req.write("""</h1>
318
305
<p>An error has occured which is the fault of the IVLE developers or
319
 
administration. The developers have been notified.</p>
 
306
administration.</p>
320
307
""")
321
 
        if (show_errors):
322
 
            if msg is not None:
323
 
                req.write("<p>%s</p>\n" % cgi.escape(msg))
324
 
            if httpcode is not None:
325
 
                req.write("<p>(HTTP error code %d)</p>\n" % httpcode)
326
 
            req.write("""
327
 
    <p>Please report this to <a href="mailto:%s">%s</a> (the system
328
 
    administrator). Include the following information:</p>
329
 
    """ % (cgi.escape(admin_email), cgi.escape(admin_email)))
 
308
        if msg is not None:
 
309
            req.write("<p>%s</p>\n" % cgi.escape(msg))
 
310
        if httpcode is not None:
 
311
            req.write("<p>(HTTP error code %d)</p>\n" % httpcode)
 
312
        req.write("""
 
313
<p>Please report this to <a href="mailto:%s">%s</a> (the system
 
314
administrator). Include the following information:</p>
 
315
""" % (cgi.escape(admin_email), cgi.escape(admin_email)))
330
316
 
331
 
            req.write("<pre>\n%s\n</pre>\n"%cgi.escape(tb))
332
 
            if logfail:
333
 
                req.write("<p>Warning: Could not open Error Log: '%s'</p>\n"
334
 
                    %cgi.escape(logfile))
 
317
        req.write("<pre>\n%s\n</pre>\n"%cgi.escape(tb))
 
318
        if logfail:
 
319
            req.write("<p>Warning: Could not open Error Log: '%s'</p>\n"
 
320
                %cgi.escape(logfile))
335
321
        req.write("</body></html>")