telert 0.2.4__tar.gz → 0.2.5__tar.gz

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 (28) hide show
  1. {telert-0.2.4/telert.egg-info → telert-0.2.5}/PKG-INFO +2 -2
  2. {telert-0.2.4 → telert-0.2.5}/README.md +1 -1
  3. {telert-0.2.4 → telert-0.2.5}/pyproject.toml +1 -1
  4. {telert-0.2.4 → telert-0.2.5}/telert/__init__.py +1 -1
  5. {telert-0.2.4 → telert-0.2.5}/telert/cli.py +50 -7
  6. {telert-0.2.4 → telert-0.2.5}/telert/messaging.py +16 -0
  7. {telert-0.2.4 → telert-0.2.5/telert.egg-info}/PKG-INFO +2 -2
  8. {telert-0.2.4 → telert-0.2.5}/LICENSE +0 -0
  9. {telert-0.2.4 → telert-0.2.5}/MANIFEST.in +0 -0
  10. {telert-0.2.4 → telert-0.2.5}/setup.cfg +0 -0
  11. {telert-0.2.4 → telert-0.2.5}/telert/api.py +0 -0
  12. {telert-0.2.4 → telert-0.2.5}/telert/data/notification-icon.png +0 -0
  13. {telert-0.2.4 → telert-0.2.5}/telert/data/notification.mp3 +0 -0
  14. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/__init__.py +0 -0
  15. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/activity_logs.py +0 -0
  16. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/base.py +0 -0
  17. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/cli.py +0 -0
  18. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/cli_logs.py +0 -0
  19. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/debug_logs.py +0 -0
  20. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/log.py +0 -0
  21. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/network.py +0 -0
  22. {telert-0.2.4 → telert-0.2.5}/telert/monitoring/process.py +0 -0
  23. {telert-0.2.4 → telert-0.2.5}/telert.egg-info/SOURCES.txt +0 -0
  24. {telert-0.2.4 → telert-0.2.5}/telert.egg-info/dependency_links.txt +0 -0
  25. {telert-0.2.4 → telert-0.2.5}/telert.egg-info/entry_points.txt +0 -0
  26. {telert-0.2.4 → telert-0.2.5}/telert.egg-info/requires.txt +0 -0
  27. {telert-0.2.4 → telert-0.2.5}/telert.egg-info/top_level.txt +0 -0
  28. {telert-0.2.4 → telert-0.2.5}/telert.png +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: telert
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Ultimate command monitoring & notification system: Telegram, Slack, Discord, Teams, Pushover, Email, desktop & more. Monitor Python code and CLI tasks with context managers, decorators, and webhooks.
5
5
  Author-email: Mihir Khandekar <mihirkhandekar@gmail.com>
6
6
  License-Expression: MIT
@@ -54,7 +54,7 @@ Dynamic: license-file
54
54
  <img src="https://github.com/navig-me/telert/raw/main/telert.png" alt="telert logo" width="150">
55
55
  </p>
56
56
 
57
- **Version 0.2.4**
57
+ **Version 0.2.5**
58
58
 
59
59
  [![PyPI Downloads](https://static.pepy.tech/badge/telert)](https://pepy.tech/projects/telert)
60
60
  [![GitHub Stars](https://img.shields.io/github/stars/navig-me/telert?style=social)](https://github.com/navig-me/telert/stargazers)
@@ -6,7 +6,7 @@
6
6
  <img src="https://github.com/navig-me/telert/raw/main/telert.png" alt="telert logo" width="150">
7
7
  </p>
8
8
 
9
- **Version 0.2.4**
9
+ **Version 0.2.5**
10
10
 
11
11
  [![PyPI Downloads](https://static.pepy.tech/badge/telert)](https://pepy.tech/projects/telert)
12
12
  [![GitHub Stars](https://img.shields.io/github/stars/navig-me/telert?style=social)](https://github.com/navig-me/telert/stargazers)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "telert"
3
- version = "0.2.4"
3
+ version = "0.2.5"
4
4
  description = "Ultimate command monitoring & notification system: Telegram, Slack, Discord, Teams, Pushover, Email, desktop & more. Monitor Python code and CLI tasks with context managers, decorators, and webhooks."
5
5
  authors = [{name = "Mihir Khandekar", email = "mihirkhandekar@gmail.com"}]
6
6
  license = "MIT"
@@ -19,7 +19,7 @@ __all__ = [
19
19
  "set_default_providers",
20
20
  "list_providers",
21
21
  ]
22
- __version__ = "0.2.4"
22
+ __version__ = "0.2.5"
23
23
 
24
24
  from telert.api import (
25
25
  configure,
@@ -104,6 +104,29 @@ def do_config(a):
104
104
  # Exit the function since we're done
105
105
  return
106
106
 
107
+ # List providers
108
+ if provider == "list-providers":
109
+ config = MessagingConfig()
110
+ providers = config.get_providers()
111
+ default_providers = config.get_default_providers()
112
+ print("Providers:")
113
+ if not providers:
114
+ print(" (none configured)")
115
+ return
116
+
117
+ for provider in providers:
118
+ if provider in default_providers:
119
+ if len(default_providers) > 1:
120
+ # Show priority order starting at 1
121
+ priority = default_providers.index(provider) + 1
122
+ marker = f" (default #{priority})"
123
+ else:
124
+ marker = " (default)"
125
+ else:
126
+ marker = ""
127
+ print(f" {provider.value}{marker}")
128
+ return
129
+
107
130
  # Single provider configuration
108
131
  if provider == "discord":
109
132
  if not hasattr(a, "webhook_url"):
@@ -291,8 +314,27 @@ def do_config(a):
291
314
  else:
292
315
  sys.exit(f"❌ Unknown provider: {provider}")
293
316
  else:
294
- # Legacy Telegram-only config for backward compatibility
295
- _save(a.token, a.chat_id)
317
+ print("Run `telert config --help` to see available options.\n")
318
+ config = MessagingConfig()
319
+ providers = config.get_providers()
320
+ default_providers = config.get_default_providers()
321
+ print("Providers:")
322
+ if not providers:
323
+ print(" (none configured)")
324
+ return
325
+
326
+ for provider in providers:
327
+ if provider in default_providers:
328
+ if len(default_providers) > 1:
329
+ # Show priority order starting at 1
330
+ priority = default_providers.index(provider) + 1
331
+ marker = f" (default #{priority})"
332
+ else:
333
+ marker = " (default)"
334
+ else:
335
+ marker = ""
336
+ print(f" {provider.value}{marker}")
337
+ return
296
338
 
297
339
 
298
340
  def do_status(a):
@@ -1412,7 +1454,7 @@ def main():
1412
1454
  dest="provider", help="provider type to configure"
1413
1455
  )
1414
1456
 
1415
- # Set defaults command (new)
1457
+ # Set defaults command
1416
1458
  set_defaults_parser = config_sp.add_parser(
1417
1459
  "set-defaults", help="set multiple default providers in priority order"
1418
1460
  )
@@ -1422,6 +1464,11 @@ def main():
1422
1464
  help="comma-separated list of providers to use as defaults, in priority order",
1423
1465
  )
1424
1466
 
1467
+ # List providers command
1468
+ list_providers_parser = config_sp.add_parser(
1469
+ "list-providers", help="list all available providers"
1470
+ )
1471
+
1425
1472
  # Telegram config
1426
1473
  telegram_parser = config_sp.add_parser(
1427
1474
  "telegram", help="configure Telegram messaging"
@@ -1627,10 +1674,6 @@ def main():
1627
1674
  help="add to existing default providers",
1628
1675
  )
1629
1676
 
1630
- # Legacy Telegram config (for backward compatibility)
1631
- c.add_argument("--token", help="(legacy) Telegram bot token")
1632
- c.add_argument("--chat-id", help="(legacy) Telegram chat ID")
1633
-
1634
1677
  c.set_defaults(func=do_config)
1635
1678
 
1636
1679
  # status
@@ -227,6 +227,22 @@ class MessagingConfig:
227
227
  """Check if a provider is configured."""
228
228
  return bool(self.get_provider_config(provider))
229
229
 
230
+ def get_providers(self) -> List[Provider]:
231
+ """Return a list of all providers that are configured.
232
+
233
+ A provider is considered configured if configuration exists in the
234
+ configuration file or corresponding environment variables.
235
+ """
236
+ configured: List[Provider] = []
237
+ for p in Provider:
238
+ try:
239
+ if self.is_provider_configured(p):
240
+ configured.append(p)
241
+ except Exception:
242
+ # Ignore any provider-specific errors when checking configuration
243
+ pass
244
+ return configured
245
+
230
246
  def get_default_providers(self) -> List[Provider]:
231
247
  """Get the default providers if configured.
232
248
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: telert
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Ultimate command monitoring & notification system: Telegram, Slack, Discord, Teams, Pushover, Email, desktop & more. Monitor Python code and CLI tasks with context managers, decorators, and webhooks.
5
5
  Author-email: Mihir Khandekar <mihirkhandekar@gmail.com>
6
6
  License-Expression: MIT
@@ -54,7 +54,7 @@ Dynamic: license-file
54
54
  <img src="https://github.com/navig-me/telert/raw/main/telert.png" alt="telert logo" width="150">
55
55
  </p>
56
56
 
57
- **Version 0.2.4**
57
+ **Version 0.2.5**
58
58
 
59
59
  [![PyPI Downloads](https://static.pepy.tech/badge/telert)](https://pepy.tech/projects/telert)
60
60
  [![GitHub Stars](https://img.shields.io/github/stars/navig-me/telert?style=social)](https://github.com/navig-me/telert/stargazers)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes