]> git.phdru.name Git - m_librarian.git/blobdiff - scripts/ml-import.py
Fix(scripts/ml-import.py): Inhibit progress bar if stdout is not terminal
[m_librarian.git] / scripts / ml-import.py
index 47c6b1b2056e39139221acb474571db305edf75c..169a715f217721b976dc90e98f1065bd29a92fb1 100755 (executable)
@@ -27,8 +27,9 @@ if __name__ == '__main__':
     open_db(args.database)
     init_db()
     import_glst()
+    use_pbar = ttyProgressBar and not args.no_pbar and sys.stdout.isatty()
     for inpx in args.inpx:
-        if ttyProgressBar and not args.no_pbar:
+        if use_pbar:
             if len(inpx) > 25:
                 pbar_fname = inpx[:22] + '...'
             else: