mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 1048446 - [mozprocess] Allow passing in a function as a value to 'processOutputLine', r=gbrown
MozReview-Commit-ID: Jqyhbj7nC6z --HG-- extra : rebase_source : f3401977e96dc91543454f153c5fe22961b352ae
This commit is contained in:
parent
c9821f47ec
commit
f121d2e5b6
@ -904,6 +904,9 @@ class ProcessHandler(ProcessHandlerMixin):
|
|||||||
def __init__(self, cmd, logfile=None, storeOutput=True, **kwargs):
|
def __init__(self, cmd, logfile=None, storeOutput=True, **kwargs):
|
||||||
kwargs.setdefault('processOutputLine', [])
|
kwargs.setdefault('processOutputLine', [])
|
||||||
|
|
||||||
|
if not isinstance(kwargs['processOutputLine'], (list, tuple)):
|
||||||
|
kwargs['processOutputLine'] = [kwargs['processOutputLine']]
|
||||||
|
|
||||||
# Print to standard output only if no outputline provided
|
# Print to standard output only if no outputline provided
|
||||||
if not kwargs['processOutputLine']:
|
if not kwargs['processOutputLine']:
|
||||||
kwargs['processOutputLine'].append(print_output)
|
kwargs['processOutputLine'].append(print_output)
|
||||||
|
Loading…
Reference in New Issue
Block a user