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

« back to all changes in this revision

Viewing changes to ivle/studpath.py

  • Committer: Matt Giuca
  • Date: 2009-12-08 05:05:20 UTC
  • Revision ID: matt.giuca@gmail.com-20091208050520-a4nmmjxwtmhip063
ivle-createdatadirs: Fixed exit -- if path already exists, log and exit(0).

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
29
30
 
30
31
from ivle import util
31
32
 
 
33
# Make a Subversion client object (for published)
 
34
svnclient = pysvn.Client()
 
35
 
32
36
def url_to_local(config, urlpath):
33
37
    """Given a URL path (part of a URL query string, see below), returns a
34
38
    tuple of
138
142
 
139
143
    return os.path.join('/home', urlpath)
140
144
 
 
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
 
141
157
def published(path):
142
158
    """Given a path on the LOCAL file system, determines whether the path has a 
143
159
    '.published' file.  Returns True or False."""