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

« back to all changes in this revision

Viewing changes to ivle/fileservice_lib/action.py

  • Committer: William Grant
  • Date: 2009-04-28 08:35:40 UTC
  • Revision ID: grantw@unimelb.edu.au-20090428083540-0mjpvly46rbt8o8l
Drop another unneeded ivle.conf import, from ivle.webapp.help.

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
    except KeyError:
198
198
        # Default, just send an error but then continue
199
199
        raise ActionError("Unknown action")
200
 
    action(req, fields)
 
200
    return action(req, fields)
201
201
 
202
202
def actionpath_to_urlpath(req, path):
203
203
    """Determines the URL path (relative to the student home) upon which the
738
738
def action_svnrepostat(req, fields):
739
739
    """Discovers whether a path exists in a repo under the IVLE SVN root.
740
740
 
 
741
    If it does exist, returns a dict containing its metadata.
 
742
 
741
743
    Reads fields: 'path'
742
744
    """
743
745
    path = fields.getfirst('path')
744
746
    url = ivle.conf.svn_addr + "/" + path
745
 
    svnclient.exception_style = 1 
 
747
    svnclient.exception_style = 1
746
748
 
747
749
    try:
748
750
        svnclient.callback_get_login = get_login
749
 
        svnclient.info2(url)
 
751
        info = svnclient.info2(url,
 
752
            revision=pysvn.Revision(pysvn.opt_revision_kind.head))[0][1]
 
753
        return {'svnrevision': info['rev'].number
 
754
                  if info['rev'] and
 
755
                     info['rev'].kind == pysvn.opt_revision_kind.number
 
756
                  else None}
750
757
    except pysvn.ClientError, e:
751
758
        # Error code 170000 means ENOENT in this revision.
752
759
        if e[1][0][1] == 170000: