aprsd 3.4.4__py3-none-any.whl → 4.0.0__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 (115) 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.0.dist-info/AUTHORS +1 -0
  46. aprsd-4.0.0.dist-info/METADATA +293 -0
  47. aprsd-4.0.0.dist-info/RECORD +74 -0
  48. {aprsd-3.4.4.dist-info → aprsd-4.0.0.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/METADATA +0 -849
  112. aprsd-3.4.4.dist-info/RECORD +0 -134
  113. {aprsd-3.4.4.dist-info → aprsd-4.0.0.dist-info}/LICENSE +0 -0
  114. {aprsd-3.4.4.dist-info → aprsd-4.0.0.dist-info}/entry_points.txt +0 -0
  115. {aprsd-3.4.4.dist-info → aprsd-4.0.0.dist-info}/top_level.txt +0 -0
aprsd/conf/common.py CHANGED
@@ -2,30 +2,20 @@ from pathlib import Path
2
2
 
3
3
  from oslo_config import cfg
4
4
 
5
-
6
5
  home = str(Path.home())
7
6
  DEFAULT_CONFIG_DIR = f"{home}/.config/aprsd/"
8
7
  APRSD_DEFAULT_MAGIC_WORD = "CHANGEME!!!"
9
8
 
10
- admin_group = cfg.OptGroup(
11
- name="admin",
12
- title="Admin web interface settings",
13
- )
14
9
  watch_list_group = cfg.OptGroup(
15
10
  name="watch_list",
16
11
  title="Watch List settings",
17
12
  )
18
- webchat_group = cfg.OptGroup(
19
- name="webchat",
20
- title="Settings specific to the webchat command",
21
- )
22
13
 
23
14
  registry_group = cfg.OptGroup(
24
15
  name="aprs_registry",
25
16
  title="APRS Registry settings",
26
17
  )
27
18
 
28
-
29
19
  aprsd_opts = [
30
20
  cfg.StrOpt(
31
21
  "callsign",
@@ -56,15 +46,15 @@ aprsd_opts = [
56
46
  "ack_rate_limit_period",
57
47
  default=1,
58
48
  help="The wait period in seconds per Ack packet being sent."
59
- "1 means 1 ack packet per second allowed."
60
- "2 means 1 pack packet every 2 seconds allowed",
49
+ "1 means 1 ack packet per second allowed."
50
+ "2 means 1 pack packet every 2 seconds allowed",
61
51
  ),
62
52
  cfg.IntOpt(
63
53
  "msg_rate_limit_period",
64
54
  default=2,
65
55
  help="Wait period in seconds per non AckPacket being sent."
66
- "2 means 1 packet every 2 seconds allowed."
67
- "5 means 1 pack packet every 5 seconds allowed",
56
+ "2 means 1 packet every 2 seconds allowed."
57
+ "5 means 1 pack packet every 5 seconds allowed",
68
58
  ),
69
59
  cfg.IntOpt(
70
60
  "packet_dupe_timeout",
@@ -75,7 +65,7 @@ aprsd_opts = [
75
65
  "enable_beacon",
76
66
  default=False,
77
67
  help="Enable sending of a GPS Beacon packet to locate this service. "
78
- "Requires latitude and longitude to be set.",
68
+ "Requires latitude and longitude to be set.",
79
69
  ),
80
70
  cfg.IntOpt(
81
71
  "beacon_interval",
@@ -102,8 +92,8 @@ aprsd_opts = [
102
92
  choices=["compact", "multiline", "both"],
103
93
  default="compact",
104
94
  help="When logging packets 'compact' will use a single line formatted for each packet."
105
- "'multiline' will use multiple lines for each packet and is the traditional format."
106
- "both will log both compact and multiline.",
95
+ "'multiline' will use multiple lines for each packet and is the traditional format."
96
+ "both will log both compact and multiline.",
107
97
  ),
108
98
  cfg.IntOpt(
109
99
  "default_packet_send_count",
@@ -129,7 +119,7 @@ aprsd_opts = [
129
119
  "enable_seen_list",
130
120
  default=True,
131
121
  help="Enable the Callsign seen list tracking feature. This allows aprsd to keep track of "
132
- "callsigns that have been seen and when they were last seen.",
122
+ "callsigns that have been seen and when they were last seen.",
133
123
  ),
134
124
  cfg.BoolOpt(
135
125
  "enable_packet_logging",
@@ -145,7 +135,7 @@ aprsd_opts = [
145
135
  "enable_sending_ack_packets",
146
136
  default=True,
147
137
  help="Set this to False, to disable sending of ack packets. This will entirely stop"
148
- "APRSD from sending ack packets.",
138
+ "APRSD from sending ack packets.",
149
139
  ),
150
140
  ]
151
141
 
@@ -154,8 +144,8 @@ watch_list_opts = [
154
144
  "enabled",
155
145
  default=False,
156
146
  help="Enable the watch list feature. Still have to enable "
157
- "the correct plugin. Built-in plugin to use is "
158
- "aprsd.plugins.notify.NotifyPlugin",
147
+ "the correct plugin. Built-in plugin to use is "
148
+ "aprsd.plugins.notify.NotifyPlugin",
159
149
  ),
160
150
  cfg.ListOpt(
161
151
  "callsigns",
@@ -174,36 +164,7 @@ watch_list_opts = [
174
164
  "alert_time_seconds",
175
165
  default=3600,
176
166
  help="Time to wait before alert is sent on new message for "
177
- "users in callsigns.",
178
- ),
179
- ]
180
-
181
- admin_opts = [
182
- cfg.BoolOpt(
183
- "web_enabled",
184
- default=False,
185
- help="Enable the Admin Web Interface",
186
- ),
187
- cfg.StrOpt(
188
- "web_ip",
189
- default="0.0.0.0",
190
- help="The ip address to listen on",
191
- ),
192
- cfg.PortOpt(
193
- "web_port",
194
- default=8001,
195
- help="The port to listen on",
196
- ),
197
- cfg.StrOpt(
198
- "user",
199
- default="admin",
200
- help="The admin user for the admin web interface",
201
- ),
202
- cfg.StrOpt(
203
- "password",
204
- default="password",
205
- secret=True,
206
- help="Admin interface password",
167
+ "users in callsigns.",
207
168
  ),
208
169
  ]
209
170
 
@@ -212,7 +173,6 @@ enabled_plugins_opts = [
212
173
  cfg.ListOpt(
213
174
  "enabled_plugins",
214
175
  default=[
215
- "aprsd.plugins.email.EmailPlugin",
216
176
  "aprsd.plugins.fortune.FortunePlugin",
217
177
  "aprsd.plugins.location.LocationPlugin",
218
178
  "aprsd.plugins.ping.PingPlugin",
@@ -222,36 +182,8 @@ enabled_plugins_opts = [
222
182
  "aprsd.plugins.notify.NotifySeenPlugin",
223
183
  ],
224
184
  help="Comma separated list of enabled plugins for APRSD."
225
- "To enable installed external plugins add them here."
226
- "The full python path to the class name must be used",
227
- ),
228
- ]
229
-
230
- webchat_opts = [
231
- cfg.StrOpt(
232
- "web_ip",
233
- default="0.0.0.0",
234
- help="The ip address to listen on",
235
- ),
236
- cfg.PortOpt(
237
- "web_port",
238
- default=8001,
239
- help="The port to listen on",
240
- ),
241
- cfg.StrOpt(
242
- "latitude",
243
- default=None,
244
- help="Latitude for the GPS Beacon button. If not set, the button will not be enabled.",
245
- ),
246
- cfg.StrOpt(
247
- "longitude",
248
- default=None,
249
- help="Longitude for the GPS Beacon button. If not set, the button will not be enabled.",
250
- ),
251
- cfg.BoolOpt(
252
- "disable_url_request_logging",
253
- default=False,
254
- help="Disable the logging of url requests in the webchat command.",
185
+ "To enable installed external plugins add them here."
186
+ "The full python path to the class name must be used",
255
187
  ),
256
188
  ]
257
189
 
@@ -260,16 +192,16 @@ registry_opts = [
260
192
  "enabled",
261
193
  default=False,
262
194
  help="Enable sending aprs registry information. This will let the "
263
- "APRS registry know about your service and it's uptime. "
264
- "No personal information is sent, just the callsign, uptime and description. "
265
- "The service callsign is the callsign set in [DEFAULT] section.",
195
+ "APRS registry know about your service and it's uptime. "
196
+ "No personal information is sent, just the callsign, uptime and description. "
197
+ "The service callsign is the callsign set in [DEFAULT] section.",
266
198
  ),
267
199
  cfg.StrOpt(
268
200
  "description",
269
201
  default=None,
270
202
  help="Description of the service to send to the APRS registry. "
271
- "This is what will show up in the APRS registry."
272
- "If not set, the description will be the same as the callsign.",
203
+ "This is what will show up in the APRS registry."
204
+ "If not set, the description will be the same as the callsign.",
273
205
  ),
274
206
  cfg.StrOpt(
275
207
  "registry_url",
@@ -292,12 +224,8 @@ registry_opts = [
292
224
  def register_opts(config):
293
225
  config.register_opts(aprsd_opts)
294
226
  config.register_opts(enabled_plugins_opts)
295
- config.register_group(admin_group)
296
- config.register_opts(admin_opts, group=admin_group)
297
227
  config.register_group(watch_list_group)
298
228
  config.register_opts(watch_list_opts, group=watch_list_group)
299
- config.register_group(webchat_group)
300
- config.register_opts(webchat_opts, group=webchat_group)
301
229
  config.register_group(registry_group)
302
230
  config.register_opts(registry_opts, group=registry_group)
303
231
 
@@ -305,8 +233,6 @@ def register_opts(config):
305
233
  def list_opts():
306
234
  return {
307
235
  "DEFAULT": (aprsd_opts + enabled_plugins_opts),
308
- admin_group.name: admin_opts,
309
236
  watch_list_group.name: watch_list_opts,
310
- webchat_group.name: webchat_opts,
311
237
  registry_group.name: registry_opts,
312
238
  }
aprsd/conf/log.py CHANGED
@@ -1,11 +1,11 @@
1
1
  """
2
2
  The options for log setup
3
3
  """
4
+
4
5
  import logging
5
6
 
6
7
  from oslo_config import cfg
7
8
 
8
-
9
9
  LOG_LEVELS = {
10
10
  "CRITICAL": logging.CRITICAL,
11
11
  "ERROR": logging.ERROR,
@@ -59,7 +59,5 @@ def register_opts(config):
59
59
 
60
60
  def list_opts():
61
61
  return {
62
- logging_group.name: (
63
- logging_opts
64
- ),
62
+ logging_group.name: (logging_opts),
65
63
  }
aprsd/conf/opts.py CHANGED
@@ -31,7 +31,6 @@ import importlib
31
31
  import os
32
32
  import pkgutil
33
33
 
34
-
35
34
  LIST_OPTS_FUNC_NAME = "list_opts"
36
35
 
37
36
 
@@ -64,9 +63,11 @@ def _import_modules(module_names):
64
63
  for modname in module_names:
65
64
  mod = importlib.import_module("aprsd.conf." + modname)
66
65
  if not hasattr(mod, LIST_OPTS_FUNC_NAME):
67
- msg = "The module 'aprsd.conf.%s' should have a '%s' "\
68
- "function which returns the config options." % \
69
- (modname, LIST_OPTS_FUNC_NAME)
66
+ msg = (
67
+ "The module 'aprsd.conf.%s' should have a '%s' "
68
+ "function which returns the config options."
69
+ % (modname, LIST_OPTS_FUNC_NAME)
70
+ )
70
71
  raise Exception(msg)
71
72
  else:
72
73
  imported_modules.append(mod)
@@ -1,6 +1,5 @@
1
1
  from oslo_config import cfg
2
2
 
3
-
4
3
  aprsfi_group = cfg.OptGroup(
5
4
  name="aprs_fi",
6
5
  title="APRS.FI website settings",
@@ -18,16 +17,10 @@ owm_wx_group = cfg.OptGroup(
18
17
  title="Options for the OWMWeatherPlugin",
19
18
  )
20
19
 
21
- location_group = cfg.OptGroup(
22
- name="location_plugin",
23
- title="Options for the LocationPlugin",
24
- )
25
-
26
20
  aprsfi_opts = [
27
21
  cfg.StrOpt(
28
22
  "apiKey",
29
- help="Get the apiKey from your aprs.fi account here:"
30
- "http://aprs.fi/account",
23
+ help="Get the apiKey from your aprs.fi account here:" "http://aprs.fi/account",
31
24
  ),
32
25
  ]
33
26
 
@@ -35,11 +28,11 @@ owm_wx_opts = [
35
28
  cfg.StrOpt(
36
29
  "apiKey",
37
30
  help="OWMWeatherPlugin api key to OpenWeatherMap's API."
38
- "This plugin uses the openweathermap API to fetch"
39
- "location and weather information."
40
- "To use this plugin you need to get an openweathermap"
41
- "account and apikey."
42
- "https://home.openweathermap.org/api_keys",
31
+ "This plugin uses the openweathermap API to fetch"
32
+ "location and weather information."
33
+ "To use this plugin you need to get an openweathermap"
34
+ "account and apikey."
35
+ "https://home.openweathermap.org/api_keys",
43
36
  ),
44
37
  ]
45
38
 
@@ -47,116 +40,16 @@ avwx_opts = [
47
40
  cfg.StrOpt(
48
41
  "apiKey",
49
42
  help="avwx-api is an opensource project that has"
50
- "a hosted service here: https://avwx.rest/"
51
- "You can launch your own avwx-api in a container"
52
- "by cloning the githug repo here:"
53
- "https://github.com/avwx-rest/AVWX-API",
43
+ "a hosted service here: https://avwx.rest/"
44
+ "You can launch your own avwx-api in a container"
45
+ "by cloning the githug repo here:"
46
+ "https://github.com/avwx-rest/AVWX-API",
54
47
  ),
55
48
  cfg.StrOpt(
56
49
  "base_url",
57
50
  default="https://avwx.rest",
58
51
  help="The base url for the avwx API. If you are hosting your own"
59
- "Here is where you change the url to point to yours.",
60
- ),
61
- ]
62
-
63
- location_opts = [
64
- cfg.StrOpt(
65
- "geopy_geocoder",
66
- choices=[
67
- "ArcGIS", "AzureMaps", "Baidu", "Bing", "GoogleV3", "HERE",
68
- "Nominatim", "OpenCage", "TomTom", "USGov", "What3Words", "Woosmap",
69
- ],
70
- default="Nominatim",
71
- help="The geopy geocoder to use. Default is Nominatim."
72
- "See https://geopy.readthedocs.io/en/stable/#module-geopy.geocoders"
73
- "for more information.",
74
- ),
75
- cfg.StrOpt(
76
- "user_agent",
77
- default="APRSD",
78
- help="The user agent to use for the Nominatim geocoder."
79
- "See https://geopy.readthedocs.io/en/stable/#module-geopy.geocoders"
80
- "for more information.",
81
- ),
82
- cfg.StrOpt(
83
- "arcgis_username",
84
- default=None,
85
- help="The username to use for the ArcGIS geocoder."
86
- "See https://geopy.readthedocs.io/en/latest/#arcgis"
87
- "for more information."
88
- "Only used for the ArcGIS geocoder.",
89
- ),
90
- cfg.StrOpt(
91
- "arcgis_password",
92
- default=None,
93
- help="The password to use for the ArcGIS geocoder."
94
- "See https://geopy.readthedocs.io/en/latest/#arcgis"
95
- "for more information."
96
- "Only used for the ArcGIS geocoder.",
97
- ),
98
- cfg.StrOpt(
99
- "azuremaps_subscription_key",
100
- help="The subscription key to use for the AzureMaps geocoder."
101
- "See https://geopy.readthedocs.io/en/latest/#azuremaps"
102
- "for more information."
103
- "Only used for the AzureMaps geocoder.",
104
- ),
105
- cfg.StrOpt(
106
- "baidu_api_key",
107
- help="The API key to use for the Baidu geocoder."
108
- "See https://geopy.readthedocs.io/en/latest/#baidu"
109
- "for more information."
110
- "Only used for the Baidu geocoder.",
111
- ),
112
- cfg.StrOpt(
113
- "bing_api_key",
114
- help="The API key to use for the Bing geocoder."
115
- "See https://geopy.readthedocs.io/en/latest/#bing"
116
- "for more information."
117
- "Only used for the Bing geocoder.",
118
- ),
119
- cfg.StrOpt(
120
- "google_api_key",
121
- help="The API key to use for the Google geocoder."
122
- "See https://geopy.readthedocs.io/en/latest/#googlev3"
123
- "for more information."
124
- "Only used for the Google geocoder.",
125
- ),
126
- cfg.StrOpt(
127
- "here_api_key",
128
- help="The API key to use for the HERE geocoder."
129
- "See https://geopy.readthedocs.io/en/latest/#here"
130
- "for more information."
131
- "Only used for the HERE geocoder.",
132
- ),
133
- cfg.StrOpt(
134
- "opencage_api_key",
135
- help="The API key to use for the OpenCage geocoder."
136
- "See https://geopy.readthedocs.io/en/latest/#opencage"
137
- "for more information."
138
- "Only used for the OpenCage geocoder.",
139
- ),
140
- cfg.StrOpt(
141
- "tomtom_api_key",
142
- help="The API key to use for the TomTom geocoder."
143
- "See https://geopy.readthedocs.io/en/latest/#tomtom"
144
- "for more information."
145
- "Only used for the TomTom geocoder.",
146
- ),
147
- cfg.StrOpt(
148
- "what3words_api_key",
149
- help="The API key to use for the What3Words geocoder."
150
- "See https://geopy.readthedocs.io/en/latest/#what3words"
151
- "for more information."
152
- "Only used for the What3Words geocoder.",
153
- ),
154
- cfg.StrOpt(
155
- "woosmap_api_key",
156
- help="The API key to use for the Woosmap geocoder."
157
- "See https://geopy.readthedocs.io/en/latest/#woosmap"
158
- "for more information."
159
- "Only used for the Woosmap geocoder.",
52
+ "Here is where you change the url to point to yours.",
160
53
  ),
161
54
  ]
162
55
 
@@ -169,8 +62,6 @@ def register_opts(config):
169
62
  config.register_opts(owm_wx_opts, group=owm_wx_group)
170
63
  config.register_group(avwx_group)
171
64
  config.register_opts(avwx_opts, group=avwx_group)
172
- config.register_group(location_group)
173
- config.register_opts(location_opts, group=location_group)
174
65
 
175
66
 
176
67
  def list_opts():
@@ -178,5 +69,4 @@ def list_opts():
178
69
  aprsfi_group.name: aprsfi_opts,
179
70
  owm_wx_group.name: owm_wx_opts,
180
71
  avwx_group.name: avwx_opts,
181
- location_group.name: location_opts,
182
72
  }
aprsd/exception.py CHANGED
@@ -1,11 +1,13 @@
1
1
  class MissingConfigOptionException(Exception):
2
2
  """Missing a config option."""
3
+
3
4
  def __init__(self, config_option):
4
5
  self.message = f"Option '{config_option}' was not in config file"
5
6
 
6
7
 
7
8
  class ConfigOptionBogusDefaultException(Exception):
8
9
  """Missing a config option."""
10
+
9
11
  def __init__(self, config_option, default_fail):
10
12
  self.message = (
11
13
  f"Config file option '{config_option}' needs to be "
aprsd/log/log.py CHANGED
@@ -1,5 +1,4 @@
1
1
  import logging
2
- from logging.handlers import QueueHandler
3
2
  import queue
4
3
  import sys
5
4
 
@@ -8,7 +7,6 @@ from oslo_config import cfg
8
7
 
9
8
  from aprsd.conf import log as conf_log
10
9
 
11
-
12
10
  CONF = cfg.CONF
13
11
  # LOG = logging.getLogger("APRSD")
14
12
  LOG = logger
@@ -19,6 +17,7 @@ class QueueLatest(queue.Queue):
19
17
 
20
18
  This prevents the queue from blowing up in size.
21
19
  """
20
+
22
21
  def put(self, *args, **kwargs):
23
22
  try:
24
23
  super().put(*args, **kwargs)
@@ -44,7 +43,9 @@ class InterceptHandler(logging.Handler):
44
43
  frame = frame.f_back
45
44
  depth += 1
46
45
 
47
- logger.opt(depth=depth, exception=record.exc_info).log(level, record.getMessage())
46
+ logger.opt(depth=depth, exception=record.exc_info).log(
47
+ level, record.getMessage()
48
+ )
48
49
 
49
50
 
50
51
  # Setup the log faciility
@@ -60,43 +61,18 @@ def setup_logging(loglevel=None, quiet=False):
60
61
  logging.root.handlers = [InterceptHandler()]
61
62
  logging.root.setLevel(log_level)
62
63
 
63
- imap_list = [
64
- "imapclient.imaplib", "imaplib", "imapclient",
65
- "imapclient.util",
66
- ]
67
- aprslib_list = [
64
+ # We don't really want to see the aprslib parsing debug output.
65
+ disable_list = [
68
66
  "aprslib",
69
67
  "aprslib.parsing",
70
68
  "aprslib.exceptions",
71
69
  ]
72
- webserver_list = [
73
- "werkzeug",
74
- "werkzeug._internal",
75
- "socketio",
76
- "urllib3.connectionpool",
77
- "chardet",
78
- "chardet.charsetgroupprober",
79
- "chardet.eucjpprober",
80
- "chardet.mbcharsetprober",
81
- ]
82
-
83
- # We don't really want to see the aprslib parsing debug output.
84
- disable_list = imap_list + aprslib_list + webserver_list
85
70
 
86
71
  # remove every other logger's handlers
87
72
  # and propagate to root logger
88
73
  for name in logging.root.manager.loggerDict.keys():
89
74
  logging.getLogger(name).handlers = []
90
- if name in disable_list:
91
- logging.getLogger(name).propagate = False
92
- else:
93
- logging.getLogger(name).propagate = True
94
-
95
- if CONF.webchat.disable_url_request_logging:
96
- for name in webserver_list:
97
- logging.getLogger(name).handlers = []
98
- logging.getLogger(name).propagate = True
99
- logging.getLogger(name).setLevel(logging.ERROR)
75
+ logging.getLogger(name).propagate = name not in disable_list
100
76
 
101
77
  handlers = [
102
78
  {
@@ -118,21 +94,6 @@ def setup_logging(loglevel=None, quiet=False):
118
94
  },
119
95
  )
120
96
 
121
- if CONF.email_plugin.enabled and CONF.email_plugin.debug:
122
- for name in imap_list:
123
- logging.getLogger(name).propagate = True
124
-
125
- if CONF.admin.web_enabled:
126
- qh = QueueHandler(logging_queue)
127
- handlers.append(
128
- {
129
- "sink": qh, "serialize": False,
130
- "format": CONF.logging.logformat,
131
- "level": log_level,
132
- "colorize": False,
133
- },
134
- )
135
-
136
97
  # configure loguru
137
98
  logger.configure(handlers=handlers)
138
99
  logger.level("DEBUG", color="<fg #BABABA>")
aprsd/main.py CHANGED
@@ -22,11 +22,11 @@
22
22
  # python included libs
23
23
  import datetime
24
24
  import importlib.metadata as imp
25
- from importlib.metadata import version as metadata_version
26
25
  import logging
27
26
  import signal
28
27
  import sys
29
28
  import time
29
+ from importlib.metadata import version as metadata_version
30
30
 
31
31
  import click
32
32
  from oslo_config import cfg, generator
@@ -36,7 +36,6 @@ import aprsd
36
36
  from aprsd import cli_helper, packets, threads, utils
37
37
  from aprsd.stats import collector
38
38
 
39
-
40
39
  # setup the global logger
41
40
  # log.basicConfig(level=log.DEBUG) # level=10
42
41
  CONF = cfg.CONF
@@ -54,8 +53,14 @@ def cli(ctx):
54
53
 
55
54
  def load_commands():
56
55
  from .cmds import ( # noqa
57
- admin, completion, dev, fetch_stats, healthcheck, list_plugins, listen,
58
- send_message, server, webchat,
56
+ completion,
57
+ dev,
58
+ fetch_stats,
59
+ healthcheck,
60
+ list_plugins,
61
+ listen,
62
+ send_message,
63
+ server,
59
64
  )
60
65
 
61
66
 
@@ -115,6 +120,7 @@ def sample_config(ctx):
115
120
 
116
121
  def _get_selected_entry_points():
117
122
  import sys
123
+
118
124
  if sys.version_info < (3, 10):
119
125
  all = imp.entry_points()
120
126
  selected = []
aprsd/packets/__init__.py CHANGED
@@ -1,15 +1,25 @@
1
1
  from aprsd.packets import collector
2
2
  from aprsd.packets.core import ( # noqa: F401
3
- AckPacket, BeaconPacket, BulletinPacket, GPSPacket, MessagePacket,
4
- MicEPacket, ObjectPacket, Packet, RejectPacket, StatusPacket,
5
- ThirdPartyPacket, UnknownPacket, WeatherPacket, factory,
3
+ AckPacket,
4
+ BeaconPacket,
5
+ BulletinPacket,
6
+ GPSPacket,
7
+ MessagePacket,
8
+ MicEPacket,
9
+ ObjectPacket,
10
+ Packet,
11
+ RejectPacket,
12
+ StatusPacket,
13
+ ThirdPartyPacket,
14
+ UnknownPacket,
15
+ WeatherPacket,
16
+ factory,
6
17
  )
7
18
  from aprsd.packets.packet_list import PacketList # noqa: F401
8
19
  from aprsd.packets.seen_list import SeenList # noqa: F401
9
20
  from aprsd.packets.tracker import PacketTrack # noqa: F401
10
21
  from aprsd.packets.watch_list import WatchList # noqa: F401
11
22
 
12
-
13
23
  # Register all the packet tracking objects.
14
24
  collector.PacketCollector().register(PacketList)
15
25
  collector.PacketCollector().register(SeenList)