[ARVADOS] updated: 00dd253443e7f7a94bdea1a349627ebd95f296fd
git at public.curoverse.com
git at public.curoverse.com
Mon Aug 18 11:42:26 EDT 2014
Summary of changes:
sdk/python/bin/arv-get | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
via 00dd253443e7f7a94bdea1a349627ebd95f296fd (commit)
from 2077daccf5001f6b5564b52c3acd7f57d7b7d75e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 00dd253443e7f7a94bdea1a349627ebd95f296fd
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Aug 18 11:39:49 2014 -0400
Display progress by default when writing to regular files and stderr isatty. No issue #
diff --git a/sdk/python/bin/arv-get b/sdk/python/bin/arv-get
index c1b2bcb..7f02cf7 100755
--- a/sdk/python/bin/arv-get
+++ b/sdk/python/bin/arv-get
@@ -31,8 +31,10 @@ group = parser.add_mutually_exclusive_group()
group.add_argument('--progress', action='store_true',
help="""
Display human-readable progress on stderr (bytes and, if possible,
-percentage of total data size). This is the default behavior when
-stderr is a tty and stdout is not a tty.
+percentage of total data size). This is the default behavior when it
+is not expected to interfere with the output: specifically, stderr is
+a tty _and_ either stdout is not a tty, or output is being written to
+named files rather than stdout.
""")
group.add_argument('--no-progress', action='store_true',
help="""
@@ -96,12 +98,6 @@ if not args.r and (os.path.isdir(args.destination) or
logger.debug("Appended source file name to destination directory: %s",
args.destination)
-# Turn on --progress by default if stderr is a tty and stdout isn't.
-if (not (args.batch_progress or args.no_progress)
- and os.isatty(sys.stderr.fileno())
- and not os.isatty(sys.stdout.fileno())):
- args.progress = True
-
if args.destination == '-':
args.destination = '/dev/stdout'
if args.destination == '/dev/stdout':
@@ -112,6 +108,15 @@ if args.destination == '/dev/stdout':
else:
args.destination = args.destination.rstrip(os.sep)
+# Turn on --progress by default if stderr is a tty and output is
+# either going to a named file, or going (via stdout) to something
+# that isn't a tty.
+if (not (args.batch_progress or args.no_progress)
+ and sys.stderr.isatty()
+ and (args.destination != '/dev/stdout'
+ or not sys.stdout.isatty())):
+ args.progress = True
+
r = re.search(r'^(.*?)(/.*)?$', args.locator)
collection = r.group(1)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list