-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
42 lines (30 loc) · 941 Bytes
/
main.py
File metadata and controls
42 lines (30 loc) · 941 Bytes
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
36
37
38
39
40
41
42
from sys import argv
# from opsdroid.cli import start
from opsdroid.cli.utils import (
check_dependencies,
configure_lang,
welcome_message,
)
from opsdroid.configuration import load_config_file
from opsdroid.const import DEFAULT_CONFIG_LOCATIONS
from opsdroid.core import OpsDroid
from opsdroid.logging import configure_logging
from mongo_manager import __init__
def setup():
# googleAPI.init()
mongo_manager.setup()
def start_server(path=None):
check_dependencies()
config_path = [path] if path else DEFAULT_CONFIG_LOCATIONS
config = load_config_file(config_path)
configure_lang(config)
configure_logging(config.get("logging", {}))
welcome_message(config)
with OpsDroid(config=config, config_path=config_path) as opsdroid:
opsdroid.run()
if __name__ == '__main__':
setup()
if len(argv) > 1:
if argv[1]:
start_server(argv[1])
start_server()