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

« back to all changes in this revision

Viewing changes to ivle/studpath.py

  • Committer: William Grant
  • Date: 2009-05-26 02:38:09 UTC
  • Revision ID: grantw@unimelb.edu.au-20090526023809-mqffswolwmvk9m00
Rename to to_home_path, and use it in ivle.interpret.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
    if user is None: return (None, None, None)
104
104
 
105
105
    jail = os.path.join(ivle.conf.jail_base, user)
106
 
    path = url_path_to_jail_path(urlpath)
 
106
    path = to_home_path(urlpath)
107
107
 
108
108
    return (user, jail, path)
109
109
 
110
 
def url_path_to_jail_path(urlpath):
111
 
    """Given a URL path (eg. joe/foo/bar/baz), returns a path within the jail.
 
110
def to_home_path(urlpath):
 
111
    """Given a URL path (eg. joe/foo/bar/baz), returns a path within the home.
112
112
 
113
 
    >>> url_path_to_jail_path('joe/foo/bar/baz')
 
113
    >>> to_home_path('joe/foo/bar/baz')
114
114
    '/home/joe/foo/bar/baz'
115
115
    """
116
116
    return os.path.join('/home', urlpath)