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

« back to all changes in this revision

Viewing changes to www/common/util.py

  • Committer: mattgiuca
  • Date: 2008-02-03 05:01:14 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:384
editor.js: Rewrote the way the editor and surrounding UI are inserted. The top
UI is now integrated into a fixed-height div that appears to be part of the
title bar. Changed some settings in the editor such as disabling toggle,
resize, and replacing tabs with 4 spaces (consistent with console).
editor.css: Restyled editor. The editor pane now takes up the whole screen
(all the way to the edge).

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
 
        # +1 to take out the slash as well
56
 
        return path[len(root)+1:]
57
 
    else:
58
 
        return path
 
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
59
61
 
60
62
def split_path(path):
61
63
    """Given a path, returns a tuple consisting of the top-level directory in