Chromium Code Reviews| Index: build/android/pylib/android_commands.py |
| diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py |
| index 4cf996f134a724e9ad7a17825cf69b57eb6804bd..ad395d8aa0894f392d13183ead144a41acd8a663 100644 |
| --- a/build/android/pylib/android_commands.py |
| +++ b/build/android/pylib/android_commands.py |
| @@ -1002,7 +1002,14 @@ class AndroidCommands(object): |
| return |
| def GetHostSize(path): |
|
craigdh
2014/03/24 23:36:46
This is getting really big for an inline function
|
| - return int(cmd_helper.GetCmdOutput(['du', '-sb', path]).split()[0]) |
| + running_size = os.path.getsize(path) |
| + if os.path.isdir(path): |
| + for root, dirs, files in os.walk(path): |
| + running_size += sum([GetHostSize(os.path.join(root, f)) |
|
craigdh
2014/03/24 23:36:46
You should just be able to call os.path.getsize on
|
| + for f in files]) |
| + running_size += sum([os.path.getsize(os.path.join(root, d)) |
| + for d in dirs]) |
| + return running_size |
| size = GetHostSize(host_path) |
| self._pushed_files.append(device_path) |