From 8f1a8737eb8821ac23e97a787f73956061bbe4d9 Mon Sep 17 00:00:00 2001 From: topilski Date: Mon, 1 May 2017 21:30:02 +0300 Subject: [PATCH] Typo --- base/run_command.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/base/run_command.py b/base/run_command.py index c46352d..130fa8b 100644 --- a/base/run_command.py +++ b/base/run_command.py @@ -21,7 +21,7 @@ class Message(object): class Policy(object): - def __init__(self, cb): + def __init__(self, cb = None): self.progress_ = 0.0 self.cb_ = cb @@ -31,7 +31,8 @@ class Policy(object): def update_progress_message(self, progress, message): self.progress_ = progress - self.process(Message(message, MessageType.STATUS)) + msg = Message(message, MessageType.STATUS) + self.process(msg) class CommonPolicy(Policy): @@ -111,7 +112,7 @@ class NinjaPolicy(Policy): return None, None -def run_command_cb(cmd: list, policy=Policy): +def run_command_cb(cmd: list, policy=Policy()): try: policy.update_progress_message(0.0, 'Command {0} started'.format(cmd)) process = subprocess.Popen(cmd, stdout=subprocess.PIPE)