Changeset 56747 in webkit
- Timestamp:
- Mar 29, 2010 4:18:27 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r56746 r56747 1 2010-03-29 Chris Jerdonek <cjerdonek@webkit.org> 2 3 Reviewed by Shinichiro Hamaji. 4 5 Eliminate explicit slash characters from check-webkit-style's 6 _rel_path() method to make its implementation more platform 7 independent. 8 9 https://bugs.webkit.org/show_bug.cgi?id=36759 10 11 * Scripts/webkitpy/style/main.py: 12 - Changed to use os.sep instead of slash_chars "/\\". This can 13 be done since os.path.abspath() converts slashes to os.sep. 14 1 15 2010-03-29 Dirk Pranke <dpranke@chromium.org> 2 16 -
trunk/WebKitTools/Scripts/webkitpy/style/main.py
r56682 r56747 50 50 os_path_abspath = os.path.abspath 51 51 52 # Calling os_path_abspath() also removes any trailing slashes. 52 # Since os_path_abspath() calls os.path.normpath()-- 53 # 54 # (see http://docs.python.org/library/os.path.html#os.path.abspath ) 55 # 56 # it also removes trailing slashes and converts forward and backward 57 # slashes to the preferred slash os.sep. 53 58 start_path = os_path_abspath(start_path) 54 59 path = os_path_abspath(path) 55 56 slash_chars = "/\\"57 60 58 61 if not path.lower().startswith(start_path.lower()): … … 62 65 rel_path = path[len(start_path):] 63 66 64 if rel_path and rel_path[0] not in slash_chars: 65 # Then we are in the case typified by the following example: 67 if not rel_path: 68 # Then the paths are the same. 69 pass 70 elif rel_path[0] == os.sep: 71 # It is probably sufficient to remove just the first character 72 # since os.path.normpath() collapses separators, but we use 73 # lstrip() just to be sure. 74 rel_path = rel_path.lstrip(os.sep) 75 else: 76 # We are in the case typified by the following example: 66 77 # 67 78 # start_path = "/tmp/foo" … … 69 80 # rel_path = "bar" 70 81 return None 71 # Otherwise rel_path is "" or begins with a slash.72 73 rel_path = rel_path.lstrip(slash_chars)74 82 75 83 return rel_path
Note: See TracChangeset
for help on using the changeset viewer.