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

« back to all changes in this revision

Viewing changes to ivle/fileservice_lib/action.py

Fixed an oversight in the tutorial code which was printing <worksheet>
and <exercise> tags into the output

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
import os
132
132
import cStringIO
133
133
import shutil
134
 
import urllib
135
134
 
136
135
import pysvn
137
136
 
198
197
    except KeyError:
199
198
        # Default, just send an error but then continue
200
199
        raise ActionError("Unknown action")
201
 
    return action(req, fields)
 
200
    action(req, fields)
202
201
 
203
202
def actionpath_to_urlpath(req, path):
204
203
    """Determines the URL path (relative to the student home) upon which the
714
713
    paths = fields.getlist('path')
715
714
    if len(paths) != 2:
716
715
        raise ActionError("usage: svncheckout url local-path")
717
 
    url = ivle.conf.svn_addr + "/" + urllib.quote(paths[0])
 
716
    url = ivle.conf.svn_addr + "/" + paths[0]
718
717
    local_path = actionpath_to_local(req, str(paths[1]))
719
718
    try:
720
719
        svnclient.callback_get_login = get_login
739
738
def action_svnrepostat(req, fields):
740
739
    """Discovers whether a path exists in a repo under the IVLE SVN root.
741
740
 
742
 
    If it does exist, returns a dict containing its metadata.
743
 
 
744
741
    Reads fields: 'path'
745
742
    """
746
743
    path = fields.getfirst('path')
747
744
    url = ivle.conf.svn_addr + "/" + path
748
 
    svnclient.exception_style = 1
 
745
    svnclient.exception_style = 1 
749
746
 
750
747
    try:
751
748
        svnclient.callback_get_login = get_login
752
 
        info = svnclient.info2(url,
753
 
            revision=pysvn.Revision(pysvn.opt_revision_kind.head))[0][1]
754
 
        return {'svnrevision': info['rev'].number
755
 
                  if info['rev'] and
756
 
                     info['rev'].kind == pysvn.opt_revision_kind.number
757
 
                  else None}
 
749
        svnclient.info2(url)
758
750
    except pysvn.ClientError, e:
759
751
        # Error code 170000 means ENOENT in this revision.
760
752
        if e[1][0][1] == 170000: