-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhook.py
More file actions
30 lines (26 loc) · 749 Bytes
/
hook.py
File metadata and controls
30 lines (26 loc) · 749 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
from delegator import Delegator
from manager import Manager
import web
urls = ('/.*', 'hooks')
app = web.application(urls, globals())
class hooks:
def POST(self):
# Json from github
payload = web.data()
print
print 'DATA RECEIVED:'
print payload
# send payload to delegator
delegator = Delegator(payload)
print 'DELEGATOR PARSED'
if delegator.action:
print 'REPO FOUND'
man = Manager(delegator.action)
print 'RUNNING CMDS'
man.do()
print 'DELEGATOR FOUND NO ACTION'
return 'OK'
if __name__ == '__main__':
print 'running'
app = web.application(urls, globals())
app.run()