diff options
author | kongr45gpen <kongr45gpen@helit.org> | 2015-01-01 00:48:15 +0200 |
---|---|---|
committer | kongr45gpen <kongr45gpen@helit.org> | 2015-01-01 00:48:15 +0200 |
commit | 82714999b1160f710ff8dfa315dcd5cac0a98547 (patch) | |
tree | 962184a6097a6921ac2a9d1aaccc107cb55e027f /local | |
parent | dfa08b9b4ef776f7f651ec4c61db19b6bb4d1ae9 (diff) | |
download | supybot_github-82714999b1160f710ff8dfa315dcd5cac0a98547.tar.gz supybot_github-82714999b1160f710ff8dfa315dcd5cac0a98547.tar.bz2 supybot_github-82714999b1160f710ff8dfa315dcd5cac0a98547.zip |
Create the `requests` folder if it doesn't exist
Diffstat (limited to 'local')
-rw-r--r-- | local/handler/GithubHandler.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py index 7365d7b..a45f22c 100644 --- a/local/handler/GithubHandler.py +++ b/local/handler/GithubHandler.py @@ -1,3 +1,4 @@ +import os import re import json import time @@ -52,6 +53,9 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): eventType = '' if not world.testing: + if not os.path.exists('requests/'): + os.makedirs('requests') + f = open('requests/' + eventType + strftime("%Y-%m-%d %H:%M:%S") + '.json', 'w') f.write(json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))) f.close() |