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

« back to all changes in this revision

Viewing changes to ivle/studpath.py

  • Committer: William Grant
  • Date: 2012-06-28 01:52:02 UTC
  • Revision ID: me@williamgrant.id.au-20120628015202-f6ru7o367gt6nvgz
Hah

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."""