aprsd 3.4.4__py3-none-any.whl → 4.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. aprsd/cli_helper.py +12 -5
  2. aprsd/client/aprsis.py +31 -9
  3. aprsd/client/base.py +13 -2
  4. aprsd/client/drivers/aprsis.py +6 -3
  5. aprsd/client/drivers/fake.py +15 -20
  6. aprsd/client/factory.py +0 -2
  7. aprsd/client/fake.py +0 -2
  8. aprsd/client/kiss.py +17 -2
  9. aprsd/client/stats.py +1 -3
  10. aprsd/cmds/completion.py +7 -4
  11. aprsd/cmds/dev.py +38 -42
  12. aprsd/cmds/fetch_stats.py +140 -143
  13. aprsd/cmds/healthcheck.py +5 -3
  14. aprsd/cmds/list_plugins.py +140 -134
  15. aprsd/cmds/listen.py +13 -9
  16. aprsd/cmds/server.py +53 -27
  17. aprsd/conf/__init__.py +1 -2
  18. aprsd/conf/client.py +3 -4
  19. aprsd/conf/common.py +19 -93
  20. aprsd/conf/log.py +2 -4
  21. aprsd/conf/opts.py +5 -4
  22. aprsd/conf/plugin_common.py +11 -121
  23. aprsd/exception.py +2 -0
  24. aprsd/log/log.py +7 -46
  25. aprsd/main.py +10 -4
  26. aprsd/packets/__init__.py +14 -4
  27. aprsd/packets/core.py +57 -67
  28. aprsd/packets/log.py +8 -8
  29. aprsd/packets/packet_list.py +9 -6
  30. aprsd/plugin.py +22 -11
  31. aprsd/plugins/notify.py +1 -4
  32. aprsd/plugins/weather.py +10 -8
  33. aprsd/stats/collector.py +5 -2
  34. aprsd/threads/__init__.py +3 -2
  35. aprsd/threads/aprsd.py +12 -7
  36. aprsd/threads/{keep_alive.py → keepalive.py} +14 -45
  37. aprsd/threads/registry.py +3 -3
  38. aprsd/threads/rx.py +9 -6
  39. aprsd/threads/stats.py +2 -2
  40. aprsd/threads/tx.py +3 -4
  41. aprsd/utils/__init__.py +42 -10
  42. aprsd/utils/json.py +9 -4
  43. aprsd/utils/keepalive_collector.py +55 -0
  44. aprsd/utils/trace.py +0 -2
  45. aprsd-4.0.1.dist-info/AUTHORS +1 -0
  46. {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/METADATA +307 -408
  47. aprsd-4.0.1.dist-info/RECORD +74 -0
  48. {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/WHEEL +1 -1
  49. aprsd/cmds/admin.py +0 -57
  50. aprsd/cmds/webchat.py +0 -662
  51. aprsd/conf/plugin_email.py +0 -105
  52. aprsd/plugins/email.py +0 -715
  53. aprsd/plugins/location.py +0 -181
  54. aprsd/threads/log_monitor.py +0 -121
  55. aprsd/web/__init__.py +0 -0
  56. aprsd/web/admin/__init__.py +0 -0
  57. aprsd/web/admin/static/css/index.css +0 -84
  58. aprsd/web/admin/static/css/prism.css +0 -4
  59. aprsd/web/admin/static/css/tabs.css +0 -35
  60. aprsd/web/admin/static/images/Untitled.png +0 -0
  61. aprsd/web/admin/static/images/aprs-symbols-16-0.png +0 -0
  62. aprsd/web/admin/static/images/aprs-symbols-16-1.png +0 -0
  63. aprsd/web/admin/static/images/aprs-symbols-64-0.png +0 -0
  64. aprsd/web/admin/static/images/aprs-symbols-64-1.png +0 -0
  65. aprsd/web/admin/static/images/aprs-symbols-64-2.png +0 -0
  66. aprsd/web/admin/static/js/charts.js +0 -235
  67. aprsd/web/admin/static/js/echarts.js +0 -465
  68. aprsd/web/admin/static/js/logs.js +0 -26
  69. aprsd/web/admin/static/js/main.js +0 -231
  70. aprsd/web/admin/static/js/prism.js +0 -12
  71. aprsd/web/admin/static/js/send-message.js +0 -114
  72. aprsd/web/admin/static/js/tabs.js +0 -28
  73. aprsd/web/admin/templates/index.html +0 -196
  74. aprsd/web/chat/static/css/chat.css +0 -115
  75. aprsd/web/chat/static/css/index.css +0 -66
  76. aprsd/web/chat/static/css/style.css.map +0 -1
  77. aprsd/web/chat/static/css/tabs.css +0 -41
  78. aprsd/web/chat/static/css/upstream/bootstrap.min.css +0 -6
  79. aprsd/web/chat/static/css/upstream/font.woff2 +0 -0
  80. aprsd/web/chat/static/css/upstream/google-fonts.css +0 -23
  81. aprsd/web/chat/static/css/upstream/jquery-ui.css +0 -1311
  82. aprsd/web/chat/static/css/upstream/jquery.toast.css +0 -28
  83. aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  84. aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  85. aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  86. aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  87. aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/icons.woff +0 -0
  88. aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/icons.woff2 +0 -0
  89. aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/outline-icons.woff +0 -0
  90. aprsd/web/chat/static/css/upstream/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  91. aprsd/web/chat/static/images/Untitled.png +0 -0
  92. aprsd/web/chat/static/images/aprs-symbols-16-0.png +0 -0
  93. aprsd/web/chat/static/images/aprs-symbols-16-1.png +0 -0
  94. aprsd/web/chat/static/images/aprs-symbols-64-0.png +0 -0
  95. aprsd/web/chat/static/images/aprs-symbols-64-1.png +0 -0
  96. aprsd/web/chat/static/images/aprs-symbols-64-2.png +0 -0
  97. aprsd/web/chat/static/images/globe.svg +0 -3
  98. aprsd/web/chat/static/js/gps.js +0 -84
  99. aprsd/web/chat/static/js/main.js +0 -45
  100. aprsd/web/chat/static/js/send-message.js +0 -612
  101. aprsd/web/chat/static/js/tabs.js +0 -28
  102. aprsd/web/chat/static/js/upstream/bootstrap.bundle.min.js +0 -7
  103. aprsd/web/chat/static/js/upstream/jquery-3.7.1.min.js +0 -2
  104. aprsd/web/chat/static/js/upstream/jquery-ui.min.js +0 -13
  105. aprsd/web/chat/static/js/upstream/jquery.toast.js +0 -374
  106. aprsd/web/chat/static/js/upstream/semantic.min.js +0 -11
  107. aprsd/web/chat/static/js/upstream/socket.io.min.js +0 -7
  108. aprsd/web/chat/templates/index.html +0 -139
  109. aprsd/wsgi.py +0 -322
  110. aprsd-3.4.4.dist-info/AUTHORS +0 -13
  111. aprsd-3.4.4.dist-info/RECORD +0 -134
  112. {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/LICENSE +0 -0
  113. {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/entry_points.txt +0 -0
  114. {aprsd-3.4.4.dist-info → aprsd-4.0.1.dist-info}/top_level.txt +0 -0
aprsd/cmds/fetch_stats.py CHANGED
@@ -2,8 +2,8 @@
2
2
  import logging
3
3
 
4
4
  import click
5
- from oslo_config import cfg
6
5
  import requests
6
+ from oslo_config import cfg
7
7
  from rich.console import Console
8
8
  from rich.table import Table
9
9
 
@@ -13,31 +13,32 @@ from aprsd import cli_helper
13
13
  from aprsd.main import cli
14
14
  from aprsd.threads.stats import StatsStore
15
15
 
16
-
17
16
  # setup the global logger
18
17
  # log.basicConfig(level=log.DEBUG) # level=10
19
- LOG = logging.getLogger("APRSD")
18
+ LOG = logging.getLogger('APRSD')
20
19
  CONF = cfg.CONF
21
20
 
22
21
 
23
22
  @cli.command()
24
23
  @cli_helper.add_options(cli_helper.common_options)
25
24
  @click.option(
26
- "--host", type=str,
25
+ '--host',
26
+ type=str,
27
27
  default=None,
28
- help="IP address of the remote aprsd admin web ui fetch stats from.",
28
+ help='IP address of the remote aprsd admin web ui fetch stats from.',
29
29
  )
30
30
  @click.option(
31
- "--port", type=int,
31
+ '--port',
32
+ type=int,
32
33
  default=None,
33
- help="Port of the remote aprsd web admin interface to fetch stats from.",
34
+ help='Port of the remote aprsd web admin interface to fetch stats from.',
34
35
  )
35
36
  @click.pass_context
36
37
  @cli_helper.process_standard_options
37
38
  def fetch_stats(ctx, host, port):
38
39
  """Fetch stats from a APRSD admin web interface."""
39
40
  console = Console()
40
- console.print(f"APRSD Fetch-Stats started version: {aprsd.__version__}")
41
+ console.print(f'APRSD Fetch-Stats started version: {aprsd.__version__}')
41
42
 
42
43
  CONF.log_opt_values(LOG, logging.DEBUG)
43
44
  if not host:
@@ -45,114 +46,110 @@ def fetch_stats(ctx, host, port):
45
46
  if not port:
46
47
  port = CONF.admin.web_port
47
48
 
48
- msg = f"Fetching stats from {host}:{port}"
49
+ msg = f'Fetching stats from {host}:{port}'
49
50
  console.print(msg)
50
51
  with console.status(msg):
51
- response = requests.get(f"http://{host}:{port}/stats", timeout=120)
52
+ response = requests.get(f'http://{host}:{port}/stats', timeout=120)
52
53
  if not response:
53
54
  console.print(
54
- f"Failed to fetch stats from {host}:{port}?",
55
- style="bold red",
55
+ f'Failed to fetch stats from {host}:{port}?',
56
+ style='bold red',
56
57
  )
57
58
  return
58
59
 
59
60
  stats = response.json()
60
61
  if not stats:
61
62
  console.print(
62
- f"Failed to fetch stats from aprsd admin ui at {host}:{port}",
63
- style="bold red",
63
+ f'Failed to fetch stats from aprsd admin ui at {host}:{port}',
64
+ style='bold red',
64
65
  )
65
66
  return
66
67
 
67
68
  aprsd_title = (
68
- "APRSD "
69
- f"[bold cyan]v{stats['APRSDStats']['version']}[/] "
70
- f"Callsign [bold green]{stats['APRSDStats']['callsign']}[/] "
71
- f"Uptime [bold yellow]{stats['APRSDStats']['uptime']}[/]"
69
+ 'APRSD '
70
+ f'[bold cyan]v{stats["APRSDStats"]["version"]}[/] '
71
+ f'Callsign [bold green]{stats["APRSDStats"]["callsign"]}[/] '
72
+ f'Uptime [bold yellow]{stats["APRSDStats"]["uptime"]}[/]'
72
73
  )
73
74
 
74
- console.rule(f"Stats from {host}:{port}")
75
- console.print("\n\n")
75
+ console.rule(f'Stats from {host}:{port}')
76
+ console.print('\n\n')
76
77
  console.rule(aprsd_title)
77
78
 
78
79
  # Show the connection to APRS
79
80
  # It can be a connection to an APRS-IS server or a local TNC via KISS or KISSTCP
80
- if "aprs-is" in stats:
81
- title = f"APRS-IS Connection {stats['APRSClientStats']['server_string']}"
81
+ if 'aprs-is' in stats:
82
+ title = f'APRS-IS Connection {stats["APRSClientStats"]["server_string"]}'
82
83
  table = Table(title=title)
83
- table.add_column("Key")
84
- table.add_column("Value")
85
- for key, value in stats["APRSClientStats"].items():
84
+ table.add_column('Key')
85
+ table.add_column('Value')
86
+ for key, value in stats['APRSClientStats'].items():
86
87
  table.add_row(key, value)
87
88
  console.print(table)
88
89
 
89
- threads_table = Table(title="Threads")
90
- threads_table.add_column("Name")
91
- threads_table.add_column("Alive?")
92
- for name, alive in stats["APRSDThreadList"].items():
90
+ threads_table = Table(title='Threads')
91
+ threads_table.add_column('Name')
92
+ threads_table.add_column('Alive?')
93
+ for name, alive in stats['APRSDThreadList'].items():
93
94
  threads_table.add_row(name, str(alive))
94
95
 
95
96
  console.print(threads_table)
96
97
 
97
- packet_totals = Table(title="Packet Totals")
98
- packet_totals.add_column("Key")
99
- packet_totals.add_column("Value")
100
- packet_totals.add_row("Total Received", str(stats["PacketList"]["rx"]))
101
- packet_totals.add_row("Total Sent", str(stats["PacketList"]["tx"]))
98
+ packet_totals = Table(title='Packet Totals')
99
+ packet_totals.add_column('Key')
100
+ packet_totals.add_column('Value')
101
+ packet_totals.add_row('Total Received', str(stats['PacketList']['rx']))
102
+ packet_totals.add_row('Total Sent', str(stats['PacketList']['tx']))
102
103
  console.print(packet_totals)
103
104
 
104
105
  # Show each of the packet types
105
- packets_table = Table(title="Packets By Type")
106
- packets_table.add_column("Packet Type")
107
- packets_table.add_column("TX")
108
- packets_table.add_column("RX")
109
- for key, value in stats["PacketList"]["packets"].items():
110
- packets_table.add_row(key, str(value["tx"]), str(value["rx"]))
106
+ packets_table = Table(title='Packets By Type')
107
+ packets_table.add_column('Packet Type')
108
+ packets_table.add_column('TX')
109
+ packets_table.add_column('RX')
110
+ for key, value in stats['PacketList']['packets'].items():
111
+ packets_table.add_row(key, str(value['tx']), str(value['rx']))
111
112
 
112
113
  console.print(packets_table)
113
114
 
114
- if "plugins" in stats:
115
- count = len(stats["PluginManager"])
116
- plugins_table = Table(title=f"Plugins ({count})")
117
- plugins_table.add_column("Plugin")
118
- plugins_table.add_column("Enabled")
119
- plugins_table.add_column("Version")
120
- plugins_table.add_column("TX")
121
- plugins_table.add_column("RX")
122
- plugins = stats["PluginManager"]
123
- for key, value in plugins.items():
115
+ if 'plugins' in stats:
116
+ count = len(stats['PluginManager'])
117
+ plugins_table = Table(title=f'Plugins ({count})')
118
+ plugins_table.add_column('Plugin')
119
+ plugins_table.add_column('Enabled')
120
+ plugins_table.add_column('Version')
121
+ plugins_table.add_column('TX')
122
+ plugins_table.add_column('RX')
123
+ plugins = stats['PluginManager']
124
+ for key, _ in plugins.items():
124
125
  plugins_table.add_row(
125
126
  key,
126
- str(plugins[key]["enabled"]),
127
- plugins[key]["version"],
128
- str(plugins[key]["tx"]),
129
- str(plugins[key]["rx"]),
127
+ str(plugins[key]['enabled']),
128
+ plugins[key]['version'],
129
+ str(plugins[key]['tx']),
130
+ str(plugins[key]['rx']),
130
131
  )
131
132
 
132
133
  console.print(plugins_table)
133
134
 
134
- seen_list = stats.get("SeenList")
135
-
136
- if seen_list:
135
+ if seen_list := stats.get('SeenList'):
137
136
  count = len(seen_list)
138
- seen_table = Table(title=f"Seen List ({count})")
139
- seen_table.add_column("Callsign")
140
- seen_table.add_column("Message Count")
141
- seen_table.add_column("Last Heard")
137
+ seen_table = Table(title=f'Seen List ({count})')
138
+ seen_table.add_column('Callsign')
139
+ seen_table.add_column('Message Count')
140
+ seen_table.add_column('Last Heard')
142
141
  for key, value in seen_list.items():
143
- seen_table.add_row(key, str(value["count"]), value["last"])
142
+ seen_table.add_row(key, str(value['count']), value['last'])
144
143
 
145
144
  console.print(seen_table)
146
145
 
147
- watch_list = stats.get("WatchList")
148
-
149
- if watch_list:
146
+ if watch_list := stats.get('WatchList'):
150
147
  count = len(watch_list)
151
- watch_table = Table(title=f"Watch List ({count})")
152
- watch_table.add_column("Callsign")
153
- watch_table.add_column("Last Heard")
148
+ watch_table = Table(title=f'Watch List ({count})')
149
+ watch_table.add_column('Callsign')
150
+ watch_table.add_column('Last Heard')
154
151
  for key, value in watch_list.items():
155
- watch_table.add_row(key, value["last"])
152
+ watch_table.add_row(key, value['last'])
156
153
 
157
154
  console.print(watch_table)
158
155
 
@@ -160,27 +157,27 @@ def fetch_stats(ctx, host, port):
160
157
  @cli.command()
161
158
  @cli_helper.add_options(cli_helper.common_options)
162
159
  @click.option(
163
- "--raw",
160
+ '--raw',
164
161
  is_flag=True,
165
162
  default=False,
166
- help="Dump raw stats instead of formatted output.",
163
+ help='Dump raw stats instead of formatted output.',
167
164
  )
168
165
  @click.option(
169
- "--show-section",
170
- default=["All"],
171
- help="Show specific sections of the stats. "
172
- " Choices: All, APRSDStats, APRSDThreadList, APRSClientStats,"
173
- " PacketList, SeenList, WatchList",
166
+ '--show-section',
167
+ default=['All'],
168
+ help='Show specific sections of the stats. '
169
+ ' Choices: All, APRSDStats, APRSDThreadList, APRSClientStats,'
170
+ ' PacketList, SeenList, WatchList',
174
171
  multiple=True,
175
172
  type=click.Choice(
176
173
  [
177
- "All",
178
- "APRSDStats",
179
- "APRSDThreadList",
180
- "APRSClientStats",
181
- "PacketList",
182
- "SeenList",
183
- "WatchList",
174
+ 'All',
175
+ 'APRSDStats',
176
+ 'APRSDThreadList',
177
+ 'APRSClientStats',
178
+ 'PacketList',
179
+ 'SeenList',
180
+ 'WatchList',
184
181
  ],
185
182
  case_sensitive=False,
186
183
  ),
@@ -190,122 +187,122 @@ def fetch_stats(ctx, host, port):
190
187
  def dump_stats(ctx, raw, show_section):
191
188
  """Dump the current stats from the running APRSD instance."""
192
189
  console = Console()
193
- console.print(f"APRSD Dump-Stats started version: {aprsd.__version__}")
190
+ console.print(f'APRSD Dump-Stats started version: {aprsd.__version__}')
194
191
 
195
- with console.status("Dumping stats"):
192
+ with console.status('Dumping stats'):
196
193
  ss = StatsStore()
197
194
  ss.load()
198
195
  stats = ss.data
199
196
  if raw:
200
- if "All" in show_section:
197
+ if 'All' in show_section:
201
198
  console.print(stats)
202
199
  return
203
200
  else:
204
201
  for section in show_section:
205
- console.print(f"Dumping {section} section:")
202
+ console.print(f'Dumping {section} section:')
206
203
  console.print(stats[section])
207
204
  return
208
205
 
209
- t = Table(title="APRSD Stats")
210
- t.add_column("Key")
211
- t.add_column("Value")
212
- for key, value in stats["APRSDStats"].items():
206
+ t = Table(title='APRSD Stats')
207
+ t.add_column('Key')
208
+ t.add_column('Value')
209
+ for key, value in stats['APRSDStats'].items():
213
210
  t.add_row(key, str(value))
214
211
 
215
- if "All" in show_section or "APRSDStats" in show_section:
212
+ if 'All' in show_section or 'APRSDStats' in show_section:
216
213
  console.print(t)
217
214
 
218
215
  # Show the thread list
219
- t = Table(title="Thread List")
220
- t.add_column("Name")
221
- t.add_column("Class")
222
- t.add_column("Alive?")
223
- t.add_column("Loop Count")
224
- t.add_column("Age")
225
- for name, value in stats["APRSDThreadList"].items():
216
+ t = Table(title='Thread List')
217
+ t.add_column('Name')
218
+ t.add_column('Class')
219
+ t.add_column('Alive?')
220
+ t.add_column('Loop Count')
221
+ t.add_column('Age')
222
+ for name, value in stats['APRSDThreadList'].items():
226
223
  t.add_row(
227
224
  name,
228
- value["class"],
229
- str(value["alive"]),
230
- str(value["loop_count"]),
231
- str(value["age"]),
225
+ value['class'],
226
+ str(value['alive']),
227
+ str(value['loop_count']),
228
+ str(value['age']),
232
229
  )
233
230
 
234
- if "All" in show_section or "APRSDThreadList" in show_section:
231
+ if 'All' in show_section or 'APRSDThreadList' in show_section:
235
232
  console.print(t)
236
233
 
237
234
  # Show the plugins
238
- t = Table(title="Plugin List")
239
- t.add_column("Name")
240
- t.add_column("Enabled")
241
- t.add_column("Version")
242
- t.add_column("TX")
243
- t.add_column("RX")
244
- for name, value in stats["PluginManager"].items():
235
+ t = Table(title='Plugin List')
236
+ t.add_column('Name')
237
+ t.add_column('Enabled')
238
+ t.add_column('Version')
239
+ t.add_column('TX')
240
+ t.add_column('RX')
241
+ for name, value in stats['PluginManager'].items():
245
242
  t.add_row(
246
243
  name,
247
- str(value["enabled"]),
248
- value["version"],
249
- str(value["tx"]),
250
- str(value["rx"]),
244
+ str(value['enabled']),
245
+ value['version'],
246
+ str(value['tx']),
247
+ str(value['rx']),
251
248
  )
252
249
 
253
- if "All" in show_section or "PluginManager" in show_section:
250
+ if 'All' in show_section or 'PluginManager' in show_section:
254
251
  console.print(t)
255
252
 
256
253
  # Now show the client stats
257
- t = Table(title="Client Stats")
258
- t.add_column("Key")
259
- t.add_column("Value")
260
- for key, value in stats["APRSClientStats"].items():
254
+ t = Table(title='Client Stats')
255
+ t.add_column('Key')
256
+ t.add_column('Value')
257
+ for key, value in stats['APRSClientStats'].items():
261
258
  t.add_row(key, str(value))
262
259
 
263
- if "All" in show_section or "APRSClientStats" in show_section:
260
+ if 'All' in show_section or 'APRSClientStats' in show_section:
264
261
  console.print(t)
265
262
 
266
263
  # now show the packet list
267
- packet_list = stats.get("PacketList")
268
- t = Table(title="Packet List")
269
- t.add_column("Key")
270
- t.add_column("Value")
271
- t.add_row("Total Received", str(packet_list["rx"]))
272
- t.add_row("Total Sent", str(packet_list["tx"]))
273
-
274
- if "All" in show_section or "PacketList" in show_section:
264
+ packet_list = stats.get('PacketList')
265
+ t = Table(title='Packet List')
266
+ t.add_column('Key')
267
+ t.add_column('Value')
268
+ t.add_row('Total Received', str(packet_list['rx']))
269
+ t.add_row('Total Sent', str(packet_list['tx']))
270
+
271
+ if 'All' in show_section or 'PacketList' in show_section:
275
272
  console.print(t)
276
273
 
277
274
  # now show the seen list
278
- seen_list = stats.get("SeenList")
275
+ seen_list = stats.get('SeenList')
279
276
  sorted_seen_list = sorted(
280
277
  seen_list.items(),
281
278
  )
282
- t = Table(title="Seen List")
283
- t.add_column("Callsign")
284
- t.add_column("Message Count")
285
- t.add_column("Last Heard")
279
+ t = Table(title='Seen List')
280
+ t.add_column('Callsign')
281
+ t.add_column('Message Count')
282
+ t.add_column('Last Heard')
286
283
  for key, value in sorted_seen_list:
287
284
  t.add_row(
288
285
  key,
289
- str(value["count"]),
290
- str(value["last"]),
286
+ str(value['count']),
287
+ str(value['last']),
291
288
  )
292
289
 
293
- if "All" in show_section or "SeenList" in show_section:
290
+ if 'All' in show_section or 'SeenList' in show_section:
294
291
  console.print(t)
295
292
 
296
293
  # now show the watch list
297
- watch_list = stats.get("WatchList")
294
+ watch_list = stats.get('WatchList')
298
295
  sorted_watch_list = sorted(
299
296
  watch_list.items(),
300
297
  )
301
- t = Table(title="Watch List")
302
- t.add_column("Callsign")
303
- t.add_column("Last Heard")
298
+ t = Table(title='Watch List')
299
+ t.add_column('Callsign')
300
+ t.add_column('Last Heard')
304
301
  for key, value in sorted_watch_list:
305
302
  t.add_row(
306
303
  key,
307
- str(value["last"]),
304
+ str(value['last']),
308
305
  )
309
306
 
310
- if "All" in show_section or "WatchList" in show_section:
307
+ if 'All' in show_section or 'WatchList' in show_section:
311
308
  console.print(t)
aprsd/cmds/healthcheck.py CHANGED
@@ -13,13 +13,15 @@ from oslo_config import cfg
13
13
  from rich.console import Console
14
14
 
15
15
  import aprsd
16
- from aprsd import cli_helper
17
- from aprsd import conf # noqa
16
+ from aprsd import ( # noqa: F401
17
+ cli_helper,
18
+ conf,
19
+ )
20
+
18
21
  # local imports here
19
22
  from aprsd.main import cli
20
23
  from aprsd.threads import stats as stats_threads
21
24
 
22
-
23
25
  # setup the global logger
24
26
  # log.basicConfig(level=log.DEBUG) # level=10
25
27
  CONF = cfg.CONF