Skip to content

Commit bdd63de

Browse files
committed
Black formatting
1 parent f83f798 commit bdd63de

File tree

5 files changed

+114
-119
lines changed

5 files changed

+114
-119
lines changed

contrib/docker/discord_config.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
11
import logging
2-
BACKEND = 'Discord'
2+
3+
BACKEND = "Discord"
34
BOT_ROOT_DIR = "/opt/errbot"
45
BOT_DATA_DIR = f"{BOT_ROOT_DIR}/data"
56
BOT_EXTRA_BACKEND_DIR = f"{BOT_ROOT_DIR}/backends/"
67
BOT_EXTRA_PLUGIN_DIR = f"{BOT_ROOT_DIR}/plugins/"
78
BOT_LOG_FILE = f"{BOT_ROOT_DIR}/log/err.log"
89
BOT_LOG_LEVEL = logging.DEBUG
910
BOT_LOG_SENTRY = False
10-
SENTRY_DSN = ''
11+
SENTRY_DSN = ""
1112
SENTRY_LOGLEVEL = 1
1213
BOT_ASYNC = True
1314

1415
BOT_IDENTITY = {
15-
'token': '<BOT_TOKEN>',
16+
"token": "<BOT_TOKEN>",
1617
}
1718

18-
BOT_ADMINS = (['<DISCORD_NAME>'])
19-
CHATROOM_PRESENCE = (["<CHAT_ROOM_NAME>"])
20-
CHATROOM_FN = '<BOT_NAME>'
21-
BOT_PREFIX = '!'
19+
BOT_ADMINS = ["<DISCORD_NAME>"]
20+
CHATROOM_PRESENCE = ["<CHAT_ROOM_NAME>"]
21+
CHATROOM_FN = "<BOT_NAME>"
22+
BOT_PREFIX = "!"
2223

2324
DIVERT_TO_PRIVATE = ()
2425
CHATROOM_RELAY = {}
2526
REVERSE_CHATROOM_RELAY = {}
2627

2728
# Err-StackStorm
2829
STACKSTORM = {
29-
'auth_url': 'https://<STACKSTORM_SERVERNAME>/auth/v1',
30-
'api_url': 'https://<STACKSTORM_SERVERNAME>/api/v1',
31-
'stream_url': 'https://<STACKSTORM_SERVERNAME>/stream/v1',
32-
33-
'verify_cert': False,
34-
'secrets_store': 'cleartext',
35-
'api_auth': {
36-
'user': {
37-
'name': '<BOT_ST2_USERNAME>',
38-
'password': "<BOT_ST2_PASSWORD>",
30+
"auth_url": "https://<STACKSTORM_SERVERNAME>/auth/v1",
31+
"api_url": "https://<STACKSTORM_SERVERNAME>/api/v1",
32+
"stream_url": "https://<STACKSTORM_SERVERNAME>/stream/v1",
33+
"verify_cert": False,
34+
"secrets_store": "cleartext",
35+
"api_auth": {
36+
"user": {
37+
"name": "<BOT_ST2_USERNAME>",
38+
"password": "<BOT_ST2_PASSWORD>",
3939
},
4040
},
41-
'rbac_auth': {
42-
'standalone': {}
43-
},
44-
'timer_update': 900, # Unit: second. Bot token renewal interval.
41+
"rbac_auth": {"standalone": {}},
42+
"timer_update": 900, # Unit: second. Bot token renewal interval.
4543
}

contrib/docker/gitter_config.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
11
import logging
2-
BACKEND = 'Gitter'
2+
3+
BACKEND = "Gitter"
34
BOT_ROOT_DIR = "/opt/errbot"
45
BOT_DATA_DIR = f"{BOT_ROOT_DIR}/data"
56
BOT_EXTRA_BACKEND_DIR = f"{BOT_ROOT_DIR}/backends/"
67
BOT_EXTRA_PLUGIN_DIR = f"{BOT_ROOT_DIR}/plugins/"
78
BOT_LOG_FILE = f"{BOT_ROOT_DIR}/log/err.log"
89
BOT_LOG_LEVEL = logging.DEBUG
910
BOT_LOG_SENTRY = False
10-
SENTRY_DSN = ''
11+
SENTRY_DSN = ""
1112
SENTRY_LOGLEVEL = 1
1213
BOT_ASYNC = True
1314

1415
# Gitter
1516
GITTER = {
16-
'token': '<BOT_TOKEN>',
17+
"token": "<BOT_TOKEN>",
1718
}
1819
BOT_IDENTITY = GITTER
1920

20-
BOT_ADMINS = (['<DISCORD_NAME>'])
21-
CHATROOM_PRESENCE = (["<CHAT_ROOM_NAME>"])
22-
CHATROOM_FN = '<BOT_NAME>'
23-
BOT_PREFIX = '!'
21+
BOT_ADMINS = ["<DISCORD_NAME>"]
22+
CHATROOM_PRESENCE = ["<CHAT_ROOM_NAME>"]
23+
CHATROOM_FN = "<BOT_NAME>"
24+
BOT_PREFIX = "!"
2425

2526
DIVERT_TO_PRIVATE = ()
2627
CHATROOM_RELAY = {}
2728
REVERSE_CHATROOM_RELAY = {}
2829

2930
# Err-StackStorm
3031
STACKSTORM = {
31-
'auth_url': 'https://<STACKSTORM_SERVERNAME>/auth/v1',
32-
'api_url': 'https://<STACKSTORM_SERVERNAME>/api/v1',
33-
'stream_url': 'https://<STACKSTORM_SERVERNAME>/stream/v1',
34-
35-
'verify_cert': False,
36-
'secrets_store': 'cleartext',
37-
'api_auth': {
38-
'user': {
39-
'name': '<BOT_ST2_USERNAME>',
40-
'password': "<BOT_ST2_PASSWORD>",
32+
"auth_url": "https://<STACKSTORM_SERVERNAME>/auth/v1",
33+
"api_url": "https://<STACKSTORM_SERVERNAME>/api/v1",
34+
"stream_url": "https://<STACKSTORM_SERVERNAME>/stream/v1",
35+
"verify_cert": False,
36+
"secrets_store": "cleartext",
37+
"api_auth": {
38+
"user": {
39+
"name": "<BOT_ST2_USERNAME>",
40+
"password": "<BOT_ST2_PASSWORD>",
4141
},
4242
},
43-
'rbac_auth': {
44-
'standalone': {}
45-
},
46-
'timer_update': 900, # Unit: second. Bot token renewal interval.
43+
"rbac_auth": {"standalone": {}},
44+
"timer_update": 900, # Unit: second. Bot token renewal interval.
4745
}
Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,58 @@
11
import logging
2-
BACKEND = 'Mattermost'
2+
3+
BACKEND = "Mattermost"
34
BOT_ROOT_DIR = "/opt/errbot"
45
BOT_DATA_DIR = f"{BOT_ROOT_DIR}/data"
56
BOT_EXTRA_BACKEND_DIR = f"{BOT_ROOT_DIR}/backends/"
67
BOT_EXTRA_PLUGIN_DIR = f"{BOT_ROOT_DIR}/plugins/"
78
BOT_LOG_FILE = f"{BOT_ROOT_DIR}/log/err.log"
89
BOT_LOG_LEVEL = logging.DEBUG
910
BOT_LOG_SENTRY = False
10-
SENTRY_DSN = ''
11+
SENTRY_DSN = ""
1112
SENTRY_LOGLEVEL = 1
1213
BOT_ASYNC = True
1314

1415
# Mattermost
1516
MATTERMOST = {
1617
# Required
17-
'team': '<TEAM_NAME>',
18-
'server': '<MATTERMOST_SERVER_NAME>',
18+
"team": "<TEAM_NAME>",
19+
"server": "<MATTERMOST_SERVER_NAME>",
1920
# For the login, either
20-
'login': '<BOT_MATTERMOST_LOGIN>',
21-
'password': '<BOT_MATTERMOST_PASSWORD>',
21+
"login": "<BOT_MATTERMOST_LOGIN>",
22+
"password": "<BOT_MATTERMOST_PASSWORD>",
2223
# Or, if you have a personal access token
2324
#'token': '<BOT_TOKEN>',
2425
# Optional
25-
'insecure': False, # Default = False. Set to true for self signed certificates
26-
'scheme': 'http', # Default = https
27-
'port': 8065, # Default = 8065
28-
'timeout': 30, # Default = 30. If the webserver disconnects idle connections later/earlier change this value
29-
'cards_hook': 'incomingWebhookId' # Needed for cards/attachments
26+
"insecure": False, # Default = False. Set to true for self signed certificates
27+
"scheme": "http", # Default = https
28+
"port": 8065, # Default = 8065
29+
"timeout": 30, # Default = 30. If the webserver disconnects idle connections later/earlier change this value
30+
"cards_hook": "incomingWebhookId", # Needed for cards/attachments
3031
}
31-
BOT_IDENTITY=MATTERMOST
32+
BOT_IDENTITY = MATTERMOST
3233

33-
BOT_ADMINS = (['<MATTERMOST_NAME>'])
34-
CHATROOM_PRESENCE = (["<CHAT_ROOM_NAME>"])
35-
CHATROOM_FN = '<BOT_NAME>'
36-
BOT_PREFIX = '!'
34+
BOT_ADMINS = ["<MATTERMOST_NAME>"]
35+
CHATROOM_PRESENCE = ["<CHAT_ROOM_NAME>"]
36+
CHATROOM_FN = "<BOT_NAME>"
37+
BOT_PREFIX = "!"
3738

3839
DIVERT_TO_PRIVATE = ()
3940
CHATROOM_RELAY = {}
4041
REVERSE_CHATROOM_RELAY = {}
4142

4243
# Err-StackStorm
4344
STACKSTORM = {
44-
'auth_url': 'https://<STACKSTORM_SERVERNAME>/auth/v1',
45-
'api_url': 'https://<STACKSTORM_SERVERNAME>/api/v1',
46-
'stream_url': 'https://<STACKSTORM_SERVERNAME>/stream/v1',
47-
48-
'verify_cert': False,
49-
'secrets_store': 'cleartext',
50-
'api_auth': {
51-
'user': {
52-
'name': '<BOT_ST2_USERNAME>',
53-
'password': "<BOT_ST2_PASSWORD>",
45+
"auth_url": "https://<STACKSTORM_SERVERNAME>/auth/v1",
46+
"api_url": "https://<STACKSTORM_SERVERNAME>/api/v1",
47+
"stream_url": "https://<STACKSTORM_SERVERNAME>/stream/v1",
48+
"verify_cert": False,
49+
"secrets_store": "cleartext",
50+
"api_auth": {
51+
"user": {
52+
"name": "<BOT_ST2_USERNAME>",
53+
"password": "<BOT_ST2_PASSWORD>",
5454
},
5555
},
56-
'rbac_auth': {
57-
'standalone': {}
58-
},
59-
'timer_update': 900, # Unit: second. Bot token renewal interval.
56+
"rbac_auth": {"standalone": {}},
57+
"timer_update": 900, # Unit: second. Bot token renewal interval.
6058
}
Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,75 @@
11
import logging
2-
BACKEND = 'RocketChat'
2+
3+
BACKEND = "RocketChat"
34
BOT_ROOT_DIR = "/opt/errbot"
45
BOT_DATA_DIR = f"{BOT_ROOT_DIR}/data"
56
BOT_EXTRA_BACKEND_DIR = f"{BOT_ROOT_DIR}/backends/"
67
BOT_EXTRA_PLUGIN_DIR = f"{BOT_ROOT_DIR}/plugins/"
78
BOT_LOG_FILE = f"{BOT_ROOT_DIR}/log/err.log"
89
BOT_LOG_LEVEL = logging.DEBUG
910
BOT_LOG_SENTRY = False
10-
SENTRY_DSN = ''
11+
SENTRY_DSN = ""
1112
SENTRY_LOGLEVEL = 1
1213
BOT_ASYNC = True
1314

15+
1416
class ROCKETCHAT_CONFIG(object):
1517
"""
1618
Config object for AoikRocketChatErrbot.
1719
Config values can be overridden by env variables. Config key `SERVER_URI`
1820
maps to env variable name `AOIKROCKETCHATERRBOT_SERVER_URI`. Use string
1921
'0', 'false' or 'no' to mean boolean false in env variable value.
2022
"""
21-
SERVER_URI = 'ws://<SERVER_NAME>:3000/websocket'
22-
LOGIN_USERNAME = '<BOT_USERNAME>'
23-
LOGIN_PASSWORD = '<BOT_PASSWORD>'
23+
24+
SERVER_URI = "ws://<SERVER_NAME>:3000/websocket"
25+
LOGIN_USERNAME = "<BOT_USERNAME>"
26+
LOGIN_PASSWORD = "<BOT_PASSWORD>"
2427
PATCH_METEOR_CLIENT = True
2528
RECONNECT_ENABLED = True
2629

2730
HEARTBEAT_ENABLED = False
2831
HEARTBEAT_INTERVAL = 10
32+
2933
@classmethod
3034
def _heartbeat_func(cls, backend):
3135
"""
3236
Heartbeat function.
3337
:param backend: Backend object.
3438
:return: None.
3539
"""
36-
msg = 'Heartbeat: {}'.format(datetime.now().strftime('%H:%M:%S'))
40+
msg = "Heartbeat: {}".format(datetime.now().strftime("%H:%M:%S"))
3741
backend.send_rocketchat_message(
3842
params={
39-
'rid': 'GENERAL',
40-
'msg': msg,
43+
"rid": "GENERAL",
44+
"msg": msg,
4145
}
4246
)
47+
4348
HEARTBEAT_FUNC = _heartbeat_func
4449

45-
BOT_ADMINS = (['<ROCKETCHAT_NAME>'])
46-
CHATROOM_PRESENCE = (["<CHAT_ROOM_NAME>"])
47-
CHATROOM_FN = '<BOT_NAME>'
48-
BOT_PREFIX = '!'
50+
51+
BOT_ADMINS = ["<ROCKETCHAT_NAME>"]
52+
CHATROOM_PRESENCE = ["<CHAT_ROOM_NAME>"]
53+
CHATROOM_FN = "<BOT_NAME>"
54+
BOT_PREFIX = "!"
4955

5056
DIVERT_TO_PRIVATE = ()
5157
CHATROOM_RELAY = {}
5258
REVERSE_CHATROOM_RELAY = {}
5359

5460
# Err-StackStorm
5561
STACKSTORM = {
56-
'auth_url': 'https://<STACKSTORM_SERVERNAME>/auth/v1',
57-
'api_url': 'https://<STACKSTORM_SERVERNAME>/api/v1',
58-
'stream_url': 'https://<STACKSTORM_SERVERNAME>/stream/v1',
59-
60-
'verify_cert': False,
61-
'secrets_store': 'cleartext',
62-
'api_auth': {
63-
'user': {
64-
'name': '<BOT_ST2_USERNAME>',
65-
'password': "<BOT_ST2_PASSWORD>",
62+
"auth_url": "https://<STACKSTORM_SERVERNAME>/auth/v1",
63+
"api_url": "https://<STACKSTORM_SERVERNAME>/api/v1",
64+
"stream_url": "https://<STACKSTORM_SERVERNAME>/stream/v1",
65+
"verify_cert": False,
66+
"secrets_store": "cleartext",
67+
"api_auth": {
68+
"user": {
69+
"name": "<BOT_ST2_USERNAME>",
70+
"password": "<BOT_ST2_PASSWORD>",
6671
},
6772
},
68-
'rbac_auth': {
69-
'standalone': {}
70-
},
71-
'timer_update': 900, # Unit: second. Bot token renewal interval.
73+
"rbac_auth": {"standalone": {}},
74+
"timer_update": 900, # Unit: second. Bot token renewal interval.
7275
}

contrib/docker/slack_config.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
11
import logging
2-
BACKEND = 'SlackV3'
2+
3+
BACKEND = "SlackV3"
34
BOT_ROOT_DIR = "/opt/errbot"
45
BOT_DATA_DIR = f"{BOT_ROOT_DIR}/data"
56
BOT_EXTRA_BACKEND_DIR = f"{BOT_ROOT_DIR}/backends/"
67
BOT_EXTRA_PLUGIN_DIR = f"{BOT_ROOT_DIR}/plugins/"
78
BOT_LOG_FILE = f"{BOT_ROOT_DIR}/log/err.log"
89
BOT_LOG_LEVEL = logging.DEBUG
910
BOT_LOG_SENTRY = False
10-
SENTRY_DSN = ''
11+
SENTRY_DSN = ""
1112
SENTRY_LOGLEVEL = 1
1213
BOT_ASYNC = True
1314

14-
BOT_ADMINS = (['<SLACK_ID>'])
15-
BOT_ADMINS_NOTIFICATIONS = (['<@SLACK_ID>'])
16-
CHATROOM_PRESENCE = (["<CHAT_ROOM_NAME>"])
17-
CHATROOM_FN = '<BOT_NAME>'
18-
BOT_PREFIX = '!'
15+
BOT_ADMINS = ["<SLACK_ID>"]
16+
BOT_ADMINS_NOTIFICATIONS = ["<@SLACK_ID>"]
17+
CHATROOM_PRESENCE = ["<CHAT_ROOM_NAME>"]
18+
CHATROOM_FN = "<BOT_NAME>"
19+
BOT_PREFIX = "!"
1920

2021
DIVERT_TO_PRIVATE = ()
2122
CHATROOM_RELAY = {}
2223
REVERSE_CHATROOM_RELAY = {}
2324

2425
# Err-StackStorm
2526
STACKSTORM = {
26-
'auth_url': 'https://<STACKSTORM_SERVERNAME>/auth/v1',
27-
'api_url': 'https://<STACKSTORM_SERVERNAME>/api/v1',
28-
'stream_url': 'https://<STACKSTORM_SERVERNAME>/stream/v1',
29-
30-
'verify_cert': False,
31-
'secrets_store': 'cleartext',
32-
'api_auth': {
33-
'user': {
34-
'name': '<BOT_ST2_USERNAME>',
35-
'password': "<BOT_ST2_PASSWORD>",
27+
"auth_url": "https://<STACKSTORM_SERVERNAME>/auth/v1",
28+
"api_url": "https://<STACKSTORM_SERVERNAME>/api/v1",
29+
"stream_url": "https://<STACKSTORM_SERVERNAME>/stream/v1",
30+
"verify_cert": False,
31+
"secrets_store": "cleartext",
32+
"api_auth": {
33+
"user": {
34+
"name": "<BOT_ST2_USERNAME>",
35+
"password": "<BOT_ST2_PASSWORD>",
3636
},
3737
},
38-
'rbac_auth': {
39-
'standalone': {}
40-
},
41-
'timer_update': 900, # Unit: second. Bot token renewal interval.
38+
"rbac_auth": {"standalone": {}},
39+
"timer_update": 900, # Unit: second. Bot token renewal interval.
4240
}

0 commit comments

Comments
 (0)