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

Unified Diff: gclient_utils.py

Issue 24950002: Delete nag_max and nag_timer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 3 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 | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index e3c504a9da614fd3dfaee4f7483d5645311188af..80eb816b12dc1c540eb72c043c118e3d36dc5dc4 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -407,7 +407,7 @@ class GClientChildren(object):
def CheckCallAndFilter(args, stdout=None, filter_fn=None,
print_stdout=None, call_filter_on_first_line=False,
- nag_timer=None, nag_max=None, **kwargs):
+ **kwargs):
"""Runs a command and calls back a filter function if needed.
Accepts all subprocess2.Popen() parameters plus:
@@ -431,21 +431,6 @@ def CheckCallAndFilter(args, stdout=None, filter_fn=None,
# Do a flush of stdout before we begin reading from the subprocess2's stdout
stdout.flush()
- nag = None
- if nag_timer:
- # Hack thread.index to force correct annotation.
- index = getattr(threading.currentThread(), 'index', 0)
- def _nag_cb(elapsed):
- setattr(threading.currentThread(), 'index', index)
- stdout.write(' No output for %.0f seconds from command:\n' % elapsed)
- stdout.write(' %s\n' % kid.cmd_str)
- if (nag_max and
- int('%.0f' % (elapsed / nag_timer)) >= nag_max):
- stdout.write(' ... killing it!\n')
- kid.kill()
- nag = subprocess2.NagTimer(nag_timer, _nag_cb)
- nag.start()
-
# Also, we need to forward stdout to prevent weird re-ordering of output.
# This has to be done on a per byte basis to make sure it is not buffered:
# normally buffering is done for each line, but if svn requests input, no
@@ -453,8 +438,6 @@ def CheckCallAndFilter(args, stdout=None, filter_fn=None,
try:
in_byte = kid.stdout.read(1)
if in_byte:
- if nag:
- nag.event()
if call_filter_on_first_line:
filter_fn(None)
in_line = ''
@@ -471,8 +454,6 @@ def CheckCallAndFilter(args, stdout=None, filter_fn=None,
filter_fn(in_line)
in_line = ''
in_byte = kid.stdout.read(1)
- if in_byte and nag:
- nag.event()
# Flush the rest of buffered output. This is only an issue with
# stdout/stderr not ending with a \n.
if len(in_line):
@@ -486,9 +467,6 @@ def CheckCallAndFilter(args, stdout=None, filter_fn=None,
except KeyboardInterrupt:
print >> sys.stderr, 'Failed while running "%s"' % ' '.join(args)
raise
- finally:
- if nag:
- nag.cancel()
if rv:
raise subprocess2.CalledProcessError(
« no previous file with comments | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698