myl-discovery 0.2.0__tar.gz → 0.3.0__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.
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/PKG-INFO +1 -1
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/myl_discovery.egg-info/PKG-INFO +1 -1
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/myl_discovery.egg-info/SOURCES.txt +5 -1
- myl-discovery-0.3.0/myl_discovery.egg-info/entry_points.txt +2 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/myl_discovery.egg-info/requires.txt +1 -0
- myl-discovery-0.3.0/myldiscovery/__init__.py +4 -0
- myl-discovery-0.3.0/myldiscovery/__main__.py +4 -0
- myl-discovery-0.2.0/myldiscovery/__init__.py → myl-discovery-0.3.0/myldiscovery/discovery.py +1 -1
- myl-discovery-0.3.0/myldiscovery/main.py +64 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/pyproject.toml +5 -1
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/.github/dependabot.yml +0 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/.github/workflows/lint.yaml +0 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/.github/workflows/release.yaml +0 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/.gitignore +0 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/LICENSE +0 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/README.md +0 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/myl_discovery.egg-info/dependency_links.txt +0 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/myl_discovery.egg-info/top_level.txt +0 -0
- {myl-discovery-0.2.0 → myl-discovery-0.3.0}/setup.cfg +0 -0
@@ -8,6 +8,10 @@ pyproject.toml
|
|
8
8
|
myl_discovery.egg-info/PKG-INFO
|
9
9
|
myl_discovery.egg-info/SOURCES.txt
|
10
10
|
myl_discovery.egg-info/dependency_links.txt
|
11
|
+
myl_discovery.egg-info/entry_points.txt
|
11
12
|
myl_discovery.egg-info/requires.txt
|
12
13
|
myl_discovery.egg-info/top_level.txt
|
13
|
-
myldiscovery/__init__.py
|
14
|
+
myldiscovery/__init__.py
|
15
|
+
myldiscovery/__main__.py
|
16
|
+
myldiscovery/discovery.py
|
17
|
+
myldiscovery/main.py
|
@@ -0,0 +1,64 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# coding: utf-8
|
3
|
+
|
4
|
+
import argparse
|
5
|
+
import logging
|
6
|
+
|
7
|
+
from rich import print_json
|
8
|
+
from rich.console import Console
|
9
|
+
from rich.logging import RichHandler
|
10
|
+
from rich.table import Table
|
11
|
+
|
12
|
+
from myldiscovery import autodiscover
|
13
|
+
|
14
|
+
LOGGER = logging.getLogger(__name__)
|
15
|
+
|
16
|
+
|
17
|
+
def parse_args():
|
18
|
+
parser = argparse.ArgumentParser()
|
19
|
+
parser.add_argument("-j", "--json", action="store_true", default=False)
|
20
|
+
parser.add_argument("-d", "--debug", action="store_true", default=False)
|
21
|
+
parser.add_argument("EMAIL")
|
22
|
+
return parser.parse_args()
|
23
|
+
|
24
|
+
|
25
|
+
def main():
|
26
|
+
console = Console()
|
27
|
+
args = parse_args()
|
28
|
+
|
29
|
+
logging.basicConfig(
|
30
|
+
handlers=[RichHandler(console=console, show_time=False)],
|
31
|
+
level=logging.DEBUG if args.debug else logging.INFO,
|
32
|
+
)
|
33
|
+
LOGGER.debug(args)
|
34
|
+
|
35
|
+
try:
|
36
|
+
res = autodiscover(args.EMAIL)
|
37
|
+
if args.json:
|
38
|
+
print_json(data=res)
|
39
|
+
else:
|
40
|
+
table = Table(
|
41
|
+
expand=True,
|
42
|
+
show_header=True,
|
43
|
+
header_style="bold",
|
44
|
+
show_lines=False,
|
45
|
+
box=None,
|
46
|
+
)
|
47
|
+
table.add_column("Service", style="red")
|
48
|
+
table.add_column("Host", style="blue")
|
49
|
+
table.add_column("Port", style="green")
|
50
|
+
table.add_column("TLS", style="yellow")
|
51
|
+
for svc in ["imap", "smtp"]:
|
52
|
+
table.add_row(
|
53
|
+
svc,
|
54
|
+
res[svc]["server"],
|
55
|
+
str(res[svc]["port"]),
|
56
|
+
"starttls" if res[svc]["starttls"] else "tls",
|
57
|
+
)
|
58
|
+
console.print(table)
|
59
|
+
except Exception:
|
60
|
+
console.print_exception(show_locals=True)
|
61
|
+
|
62
|
+
|
63
|
+
if __name__ == "__main__":
|
64
|
+
main()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|