From 1802b9439a2cfdd7a7d62913647cc3ff103c3ec8 Mon Sep 17 00:00:00 2001 From: "Didion, John (NIH/NHGRI) [F]" Date: Wed, 2 Nov 2016 15:50:48 -0400 Subject: [PATCH] Fix two bugs with pv_command() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Provide default value as argument 2. Return tuple rather than string No unit tests because I’m not sure how to test this --- xphyle/progress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xphyle/progress.py b/xphyle/progress.py index 18ecf19..e9f6efa 100644 --- a/xphyle/progress.py +++ b/xphyle/progress.py @@ -28,13 +28,13 @@ def wrap(itr, size=None): return wrapper(itr, size) return itr -def pv_command(): # pragma: no-cover +def pv_command(pv=None): # pragma: no-cover if pv is None: pv = get_executable_path('pv') if pv is None: raise IOError("pv is not available on the path") check_path(pv, 'f', 'x') - return "{} -pre".format(pv) + return (pv, "-pre") def wrap_subprocess(cmd, stdin, stdout, **kwargs): # pragma: no-cover global system_wrapper