def main():
iplow = ip2long('192.30.252.0')
iphigh = ip2long('192.30.255.255')
if request.remote_addr in range(iplow, iphigh):
payload = request.get_json()
if payload["repository"]["name"] == "Python-IRC-Bot":
try:
subprocess.check_call(["git", "pull"])
except subprocess.CalledProcessError:
irc.privmsg("##wolfy1339", "git pull failed!")
else:
if "handlers.py" in payload['head_commit']['modified']:
reload_handlers(bot)
return flask.Response("Thanks.", mimetype="text/plain")
return flask.Response("Wrong repo.", mimetype="text/plain")
else:
flask.abort(403)
评论列表
文章目录