[op25-dev] A couple of patches [1 Attachment]
John Ackermann N8UR firstname.lastname@example.org [op25-dev]
op25-dev at yahoogroups.com
Tue Jul 25 00:17:39 UTC 2017
Attached is a patch file that updates Max's terminal.py and trunking.py
in a few ways:
1. terminal.py reads the window size at startup and adjusts the curses
settings accordingly. If you set xterm or equivalent to more rows (I'm
using 38), you can handle sites with more than 20 frequencies without
crashing. This is the patch I posted a week or so ago. (Max, I think
your idea of making the main window two columns is still a good one, and
the space that frees up could be used to display other interesting info.
I don't think I'll have the time to learn how to implement that, though.)
2. terminal.py now displays an info line at the bottom of the screen
showing the keyboard commands that are available. I also added a blank
line or two to make the display look (IMHO) a bit cleaner.
3. If you set -v to 5 or higher, every frequency or talkgroup command
is output on stderr (this will generate a lot of output on a busy
system!). If you want to generate a list of every unique frequency used
by the system, this will produce it from the stderr.2 file:
grep freq: stderr.2 | cut -d" " -f3 | sort | uniq
or to get all the unique talkgroups:
greg freq: stderr.2 | cut -d" " -f5 | sort | uniq
Max, this was actually a bit less trivial than first thought. The code
is easy, but where to put it wasn't. Your suggestion about the end of
update_state() led to only one update per second, and lost many
freq/talkgroup set commands. I think I found a spot that doesn't miss
any. Lots of output, but lets you build a comprehensive tgid list.
4. The stderr output of "set trunk_cc..." was not all that useful, so
it's now set to appear only when the -v level is set to 6 or greater.
(Behavior of -v 10 includes the above but is otherwise unchanged.)
5. I cleaned up all the logging/status/debug outputs in trunking.py to
use "sys.stderr.write()" rather than "print". That will stop them from
showing up in the terminal screen. While I was at it, I also added
newlines to the end of all output and did some other cleanup.
Hope this is useful.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the op25-dev