[chirp_devel] [PATCH 3/6] Add newline at end of console status (#2343)

Zachary T Welch
Wed Mar 4 23:19:10 PST 2015


# HG changeset patch
# User Zachary T Welch <zach at mandolincreekfarm.com>
# Fake Node ID 7b488413bec51647efcc47a17d11502226442fec

Add newline at end of console status (#2343)

When downloading/uploading on the console, a pretty status bar is
printed on a single line.  At the end of the transfer, a newline needs
to be added, or subsequent output will appear on the same line as the
status bar.

diff --git a/chirp/chirp_common.py b/chirp/chirp_common.py
index 16cbf40..0a34adc 100644
--- a/chirp/chirp_common.py
+++ b/chirp/chirp_common.py
@@ -1218,7 +1218,10 @@ class Status:
             pct = 0.0
             ticks = "?" * 10
 
-        return "|%-10s| %2.1f%% %s" % (ticks, pct, self.msg)
+        s = "|%-10s| %2.1f%% %s" % (ticks, pct, self.msg)
+        if self.cur == self.max:
+            s += "\n"
+        return s
 
 
 def is_fractional_step(freq):




More information about the chirp_devel mailing list