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

Unified Diff: build/android/pylib/android_commands.py

Issue 201443017: Replace GetHostSize with a cross-platform implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/pylib/utils/host_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d56a13846036ec16913a2602eb3159358f0e2da8 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -26,6 +26,7 @@ import cmd_helper
import constants
import screenshot
import system_properties
+from utils import host_utils
try:
from pylib import pexpect
@@ -1001,10 +1002,7 @@ class AndroidCommands(object):
if host_path_mtime == os.stat(host_path).st_mtime:
return
- def GetHostSize(path):
- return int(cmd_helper.GetCmdOutput(['du', '-sb', path]).split()[0])
-
- size = GetHostSize(host_path)
+ size = host_utils.GetRecursiveDiskUsage(host_path)
self._pushed_files.append(device_path)
self._potential_push_size += size
@@ -1039,7 +1037,8 @@ class AndroidCommands(object):
diff_size = 0
if len(changed_files) <= MAX_INDIVIDUAL_PUSHES:
- diff_size = sum(GetHostSize(f[0]) for f in changed_files)
+ diff_size = sum(host_utils.GetRecursiveDiskUsage(f[0])
+ for f in changed_files)
# TODO(craigdh): Replace this educated guess with a heuristic that
# approximates the push time for each method.
« no previous file with comments | « no previous file | build/android/pylib/utils/host_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698