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

Unified Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 2443113003: Make .pyc cleaning optional in clean_local_files. (Closed)
Patch Set: Fixed expectations Created 4 years, 2 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 | scripts/slave/recipe_modules/webrtc/api.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/chromium_android/api.py
diff --git a/scripts/slave/recipe_modules/chromium_android/api.py b/scripts/slave/recipe_modules/chromium_android/api.py
index 9b2008567e1e357194ec3885bcaefd190df0acfa..2c2ef508013216c644ea317b070b872788097cd1 100644
--- a/scripts/slave/recipe_modules/chromium_android/api.py
+++ b/scripts/slave/recipe_modules/chromium_android/api.py
@@ -9,6 +9,7 @@ import os
import pipes
import re
import sys
+import textwrap
import urllib
from recipe_engine.types import freeze
@@ -137,31 +138,36 @@ class AndroidApi(recipe_api.RecipeApi):
return result
- def clean_local_files(self):
+ def clean_local_files(self, clean_pyc_files=True):
target = self.c.BUILD_CONFIG
debug_info_dumps = self.m.path['checkout'].join('out',
target,
'debug_info_dumps')
test_logs = self.m.path['checkout'].join('out', target, 'test_logs')
build_product = self.m.path['checkout'].join('out', 'build_product.zip')
- self.m.python.inline(
- 'clean local files',
- """
- import shutil, sys, os
- shutil.rmtree(sys.argv[1], True)
- shutil.rmtree(sys.argv[2], True)
- try:
- os.remove(sys.argv[3])
- except OSError:
- pass
+ python_inline_script = textwrap.dedent("""
+ import shutil, sys, os
+ shutil.rmtree(sys.argv[1], True)
+ shutil.rmtree(sys.argv[2], True)
+ try:
+ os.remove(sys.argv[3])
+ except OSError:
+ pass
+ """)
+ if clean_pyc_files:
+ python_inline_script += textwrap.dedent("""\
for base, _dirs, files in os.walk(sys.argv[4]):
for f in files:
if f.endswith('.pyc'):
os.remove(os.path.join(base, f))
- """,
- args=[debug_info_dumps, test_logs, build_product,
- self.m.path['checkout']],
- infra_step=True,
+ """)
+
+ self.m.python.inline(
+ 'clean local files',
+ python_inline_script,
+ args=[debug_info_dumps, test_logs, build_product,
+ self.m.path['checkout']],
+ infra_step=True,
)
def run_tree_truth(self, additional_repos=None):
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/webrtc/api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698