diff options
author | Ben Connors <benconnors@outlook.com> | 2019-12-04 00:30:02 -0500 |
---|---|---|
committer | Ben Connors <benconnors@outlook.com> | 2019-12-04 00:30:02 -0500 |
commit | d50dc8cec7e4b59ee5e01681f39db198dc37a3d9 (patch) | |
tree | 520103395fd21360d8844811847bc014a629b909 /interface/chaserview.py | |
parent | 1ea9b37468b2cffc6c6c62dd767ab4d3956e54c7 (diff) |
Show fixes
Diffstat (limited to 'interface/chaserview.py')
-rwxr-xr-x | interface/chaserview.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/interface/chaserview.py b/interface/chaserview.py index 011d2bd..56a59d5 100755 --- a/interface/chaserview.py +++ b/interface/chaserview.py @@ -22,6 +22,19 @@ def format_time(n): return str(n)[0]+postfixes[idx] +def format_long(n): + if n == INFTY: + return " ∞s" + elif n == 0: + return " 0s" + elif n < 10000: + return "%4d" % n + else: + n = str(n/1000)[:3] + if n[-1] == '.': + n = n[:-1] + return "%4s" % n + class ChaserView: def set_dim(self, height, width): if height < 5 or width < 10: @@ -113,7 +126,7 @@ class ChaserView: ft = "-" fid = "---" - t = "%s%3s%s|%s:%s:%s" % (ft, fid, '*' if (s.type == CHASERSTEP and s.duration_mode == MANUAL) else ' ', format_time(s.fade_in), format_time(s.duration if s.type != CHASERSTEP else s.length), format_time(s.fade_out)) + t = "%s%3s%s|%s:%s:%s" % (ft, fid, '*' if (s.type == CHASERSTEP and s.duration_mode == MANUAL) else ' ', format_long(s.fade_in), format_long(s.duration if s.type != CHASERSTEP else s.length), format_long(s.fade_out)) self.win.addstr(n+2, 1, self.fit((self._numformat % (first+n)) + ": " + s.name, w-len(t), pad=True)+t, attrs) if first > 0: |