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

« back to all changes in this revision

Viewing changes to ivle/studpath.py

  • Committer: Matt Giuca
  • Date: 2010-03-22 06:05:32 UTC
  • Revision ID: matt.giuca@gmail.com-20100322060532-5365361xrx9mh32v
Changed database.py get_svn_url to take a req; include the req.user.login in the Subversion URL. This allows you to check out repositories without separately supplying the IVLE URL (as Subversion won't ask for a username by default). Also removed --username= from the lecturer project view, as it's redundant now. This fixes Launchpad bug #543936.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
import os
28
28
import stat
29
 
import pysvn
30
29
 
31
30
from ivle import util
32
31
 
33
 
# Make a Subversion client object (for published)
34
 
svnclient = pysvn.Client()
35
 
 
36
32
def url_to_local(config, urlpath):
37
33
    """Given a URL path (part of a URL query string, see below), returns a
38
34
    tuple of
142
138
 
143
139
    return os.path.join('/home', urlpath)
144
140
 
145
 
def svnpublished(path):
146
 
    """Given a path on the LOCAL file system, determines whether the path has
147
 
    its "ivle:published" property active (in subversion). Returns True
148
 
    or False."""
149
 
    # Read SVN properties for this path
150
 
    try:
151
 
        props = svnclient.propget("ivle:published", path, recurse=False)
152
 
    except pysvn.ClientError:
153
 
        # Not under version control? Then it isn't published.
154
 
        return False
155
 
    return len(props) > 0
156
 
 
157
141
def published(path):
158
142
    """Given a path on the LOCAL file system, determines whether the path has a 
159
143
    '.published' file.  Returns True or False."""