Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelper.py
More file actions
Latest commit
71 lines (48 loc) · 1.41 KB
/
Copy pathhelper.py
File metadata and controls
71 lines (48 loc) · 1.41 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
importconfig
importlogging
log=logging.getLogger(__name__)
defany_dry_run():
dry_run_count=0
ifconfig.TWITTER_ACTIVEandconfig.TWITTER_DRY_RUN:
dry_run_count+=1
ifconfig.MATRIX_ACTIVEandconfig.MATRIX_DRY_RUN:
dry_run_count+=1
ifconfig.MASTODON_ACTIVEandconfig.MASTODON_DRY_RUN:
dry_run_count+=1
ifconfig.DISCORD_ACTIVEandconfig.DISCORD_DRY_RUN:
dry_run_count+=1
returndry_run_count>0
defdata_valid(data_list):
forconfig_dataindata_list:
ifconfig_data=='':
returnFalse
returnTrue
defcan_twitter():
required_config_data= [
config.TWITTER_TOKEN,
config.TWITTER_TOKEN_SECRET,
config.TWITTER_API_KEY,
config.TWITTER_API_SECRET,
]
returndata_valid(required_config_data)
defcan_mastodon():
required_config_data= [
config.MASTODON_API_BASE_URL,
config.MASTODON_ACCESS_TOKEN
]
returndata_valid(required_config_data)
defcan_matrix():
required_config_data= [
config.MATRIX_SERVER,
config.MATRIX_USER_NAME,
config.MATRIX_PASSWORD,
config.MATRIX_ROOM_ID
]
returndata_valid(required_config_data)
defcan_discord():
required_config_data= [
config.DISCORD_APP_ID,
config.DISCORD_TOKEN,
config.DISCORD_CHANNEL_ID,
]
returndata_valid(required_config_data)