Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 10 matching lines...) Expand all Loading... | |
| 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 """Wrapper object for the file system / source tree.""" | 29 """Wrapper object for the file system / source tree.""" |
| 30 | 30 |
| 31 import stat | |
| 31 import codecs | 32 import codecs |
| 32 import errno | 33 import errno |
| 33 import exceptions | 34 import exceptions |
| 34 import glob | 35 import glob |
| 35 import hashlib | 36 import hashlib |
| 36 import os | 37 import os |
| 37 import shutil | 38 import shutil |
| 38 import sys | 39 import sys |
| 39 import tempfile | 40 import tempfile |
| 40 import time | 41 import time |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 def copytree(self, source, destination): | 268 def copytree(self, source, destination): |
| 268 shutil.copytree(source, destination) | 269 shutil.copytree(source, destination) |
| 269 | 270 |
| 270 def split(self, path): | 271 def split(self, path): |
| 271 """Return (dirname, basename + '.' + ext)""" | 272 """Return (dirname, basename + '.' + ext)""" |
| 272 return os.path.split(path) | 273 return os.path.split(path) |
| 273 | 274 |
| 274 def splitext(self, path): | 275 def splitext(self, path): |
| 275 """Return (dirname + os.sep + basename, '.' + ext)""" | 276 """Return (dirname + os.sep + basename, '.' + ext)""" |
| 276 return os.path.splitext(path) | 277 return os.path.splitext(path) |
| 278 | |
| 279 def make_executable(self, file_path): | |
| 280 os.chmod(file_path, stat.S_IXUSR) | |
|
qyearsley
2016/06/15 21:54:25
Not sure if it makes a difference, but currently e
| |
| 281 | |
| 282 def is_executable(self, file_path): | |
| 283 return os.access(file_path, os.X_OK) | |
| OLD | NEW |