Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/system/path.py

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 29 matching lines...) Expand all
40 40
41 41
42 def cygpath(path): 42 def cygpath(path):
43 """Converts an absolute cygwin path to an absolute Windows path.""" 43 """Converts an absolute cygwin path to an absolute Windows path."""
44 return _CygPath.convert_using_singleton(path) 44 return _CygPath.convert_using_singleton(path)
45 45
46 46
47 # Note that this object is not threadsafe and must only be called 47 # Note that this object is not threadsafe and must only be called
48 # from multiple threads under protection of a lock (as is done in cygpath()) 48 # from multiple threads under protection of a lock (as is done in cygpath())
49 class _CygPath(object): 49 class _CygPath(object):
50
50 """Manages a long-running 'cygpath' process for file conversion.""" 51 """Manages a long-running 'cygpath' process for file conversion."""
51 _lock = None 52 _lock = None
52 _singleton = None 53 _singleton = None
53 54
54 @staticmethod 55 @staticmethod
55 def stop_cygpath_subprocess(): 56 def stop_cygpath_subprocess():
56 if not _CygPath._lock: 57 if not _CygPath._lock:
57 return 58 return
58 59
59 with _CygPath._lock: 60 with _CygPath._lock:
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 126
126 127
127 def _winpath_to_uri(path): 128 def _winpath_to_uri(path):
128 """Converts a window absolute path to a file: URL.""" 129 """Converts a window absolute path to a file: URL."""
129 return "///" + path.replace("\\", "/") 130 return "///" + path.replace("\\", "/")
130 131
131 132
132 def _unixypath_to_uri(path): 133 def _unixypath_to_uri(path):
133 """Converts a unix-style path to a file: URL.""" 134 """Converts a unix-style path to a file: URL."""
134 return "//" + path 135 return "//" + path
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698