Commit 57ff1f75 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

Colorized the output of the frames.

parent 1546cae4
...@@ -10,17 +10,20 @@ module Apex ...@@ -10,17 +10,20 @@ module Apex
frame[:path].each do |path| frame[:path].each do |path|
paths << path.colorize(:cyan) paths << path.colorize(:cyan)
end end
paths = ','.join(paths) paths = paths.join(',')
if frame['path'] if frame[:path] and frame[:path].length > 0
formatted_aprs = ','.join([formatted_aprs, paths]) formatted_aprs = [formatted_aprs, paths].join(',')
end end
formatted_aprs += ':' formatted_aprs += ':'
formatted_aprs += frame['text'] formatted_aprs += frame[:text]
if direction_in if direction_in
click.echo(click.style(port_name + ' << ', fg='magenta') + formatted_aprs) puts (port_name + ' << ').colorize(:magenta) + formatted_aprs
else else
click.echo(click.style(port_name + ' >> ', fg='magenta', bold=True, blink=True) + formatted_aprs) # TODO : make this bold and/or blink
puts (port_name + ' >> ').colorize(:magenta) + formatted_aprs
end end
puts String.modes
puts String.colors
end end
def self.main def self.main
...@@ -31,7 +34,7 @@ module Apex ...@@ -31,7 +34,7 @@ module Apex
while true while true
frame = aprs_kiss.read frame = aprs_kiss.read
if frame if frame
echo_color_frame(frame) echo_color_frame(frame, true)
else else
sleep(1) sleep(1)
end end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment