-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitbot.py
More file actions
executable file
·36 lines (30 loc) · 863 Bytes
/
gitbot.py
File metadata and controls
executable file
·36 lines (30 loc) · 863 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#Import block
import sys, os, traceback, random
from os import listdir
from os.path import isfile, join
from gitbotException import GitbotException
from gitbotParser import Gitbot
import json
#### Entry point #####
#Usage: gitbotTest.py jsonDirectory
if __name__ == '__main__':
exit_status = 0
try:
parser = Gitbot(sys.argv)
parser.preParse()
data = parser.parse()
sys.stdout.write(json.dumps(data,indent = 4)+"\n")
sys.stdout.flush()
exit_status = 0
except GitbotException as e:
sys.stderr.write(e.message+'\n')
sys.stderr.flush()
exit_status = e.code
except Exception as e:
sys.stderr.write(str(e)+'\n')
sys.stderr.flush()
exit_status = 1000
finally:
sys.exit(exit_status)