Skip to content

Commit

Permalink
ConsoleInteraction: Add arg cli_actions
Browse files Browse the repository at this point in the history
cli_actions as an arguments helps when testing the function.
This doesn't affect the rest of the workflow at all, as it
has a default None value.
  • Loading branch information
AbdealiLoKo committed Feb 21, 2016
1 parent 45ebd9d commit 136f1b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions coalib/output/ConsoleInteraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def acquire_actions_and_apply(console_printer,
section,
file_diff_dict,
result,
file_dict):
file_dict,
cli_actions=None):
"""
Acquires applicable actions and applies them.
Expand All @@ -80,9 +81,11 @@ def acquire_actions_and_apply(console_printer,
:param result: A derivative of Result.
:param file_dict: A dictionary containing all files with filename as
key.
:param cli_actions: The list of cli actions available.
"""
cli_actions = cli_actions or CLI_ACTIONS
actions = []
for action in CLI_ACTIONS:
for action in cli_actions:
if action.is_applicable(result, file_dict, file_diff_dict):
actions.append(action)

Expand Down

0 comments on commit 136f1b4

Please sign in to comment.