-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.py
35 lines (28 loc) · 821 Bytes
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
import sys
import logging
import doxcli.config.app as config
from doxcli.bootstrap import Bootstrap
from doxcli.exceptions.general import MethodNotFoundException
from doxcli.utils.general import display_error
logging.basicConfig(
filename=config.log_file(),
encoding='utf8',
level=logging.DEBUG,
format=config.LOGGER_FORMAT
)
def main():
try:
return Bootstrap().main()
except NotADirectoryError as exception:
logging.error(exception)
except FileExistsError as exception:
logging.error(exception)
except MethodNotFoundException as exception:
display_error(exception)
logging.error(exception)
except Exception as exception:
logging.error(exception)
return 0
if __name__ == '__main__':
sys.exit(main())