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

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/__init__.py

  • Committer: David Coles
  • Date: 2010-07-28 10:45:53 UTC
  • mfrom: (1829 trunk)
  • mto: This revision was merged to the branch mainline in revision 1830.
  • Revision ID: coles.david@gmail.com-20100728104553-5z3nxt0l6kyfqfh5
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    """Return breadcrumbs for the segments of the given path."""
49
49
 
50
50
    crumbs = []
51
 
    for i in range(1, len(pathsegments)):
52
 
        crumbs.append(FileBreadcrumb(req, pathsegments[:i], revno))
53
 
    crumbs.append(FileBreadcrumb(req, pathsegments, revno, True, suffix))
 
51
 
 
52
    crumbable = tuple(pathsegments)
 
53
    if len(crumbable) > 0:
 
54
        # If the path has a trailing slash, the last segment will be
 
55
        # empty. We don't want a breadcrumb for that.
 
56
        if crumbable[-1] == '':
 
57
            crumbable = crumbable[:-1]
 
58
        for i in range(1, len(crumbable)):
 
59
            crumbs.append(FileBreadcrumb(req, crumbable[:i], revno))
 
60
        crumbs.append(FileBreadcrumb(req, crumbable, revno, True, suffix))
54
61
    return crumbs