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

« back to all changes in this revision

Viewing changes to www/common/util.py

  • Committer: mattgiuca
  • Date: 2008-01-25 06:28:03 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:314
tutorialservice: svn:ignore

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    root = os.path.normpath(root_dir)
53
53
 
54
54
    if path.startswith(root):
55
 
        path = path[len(root):]
56
 
        # Take out the slash as well
57
 
        if len(path) > 0 and path[0] == os.sep:
58
 
            path = path[1:]
59
 
 
60
 
    return path
 
55
        # +1 to take out the slash as well
 
56
        return path[len(root)+1:]
 
57
    else:
 
58
        return path
61
59
 
62
60
def split_path(path):
63
61
    """Given a path, returns a tuple consisting of the top-level directory in