-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
executable file
·46 lines (30 loc) · 988 Bytes
/
main.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
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python3
import os
import os.path
import shutil
from pprint import pprint
from nsb_config import options
from nsb_config import default_global_path
import nsb_twitter
import cotn_twitter
def main():
debug = options['debug']
dry_run = options['dry-run']
if options['twitter_keys'] != None:
twitter = nsb_twitter.twitter(options['twitter_keys'])
else:
twitter = None
if options['action'] == 'init':
print('copying', default_global_path, 'to', options['config'])
if not options['dry-run']:
shutil.copy(default_global_path, options['config'])
elif options['action'] == 'update':
cotn_twitter.update(twitter)
elif options['action'] == 'postDaily':
cotn_twitter.postYesterday(twitter)
elif options['action'] == 'printBoard':
cotn_twitter.printBoard()
elif options['action'] == 'none':
print("exiting")
if __name__ == '__main__':
main()