{"action":"created","comment":{"url":"https://api.github.com/repos/glogiotatidis/babis/pulls/comments/76014998","id":76014998,"diff_hunk":"@@ -1 +1,43 @@\n # -*- coding: utf-8 -*-\n+import six\n+from six.moves.urllib.request import Request, urlopen\n+from six.moves.urllib.error import URLError\n+\n+\n+class decorator(object):\n+    def __init__(self, ping_before=None, ping_after=None, fail_silenty=False,\n+                 method='GET', user_agent='curl/7.50.1'):\n+        self.ping_before = ping_before\n+        self.ping_after = ping_after\n+        self.fail_silenty = fail_silenty\n+        self.method = method\n+        self.user_agent = user_agent\n+\n+    def __call__(self, fn):\n+        def wrapped(*args, **kwargs):\n+            if self.ping_before:\n+                self.ping_urls(self.ping_before)\n+            fn(*args, **kwargs)\n+            if self.ping_after:\n+                self.ping_urls(self.ping_after)\n+        return wrapped\n+\n+    def ping_urls(self, urls):\n+        if isinstance(urls, six.string_types):\n+            self.ping_url(urls)\n+        else:\n+            for url in urls:","path":"babis/babis.py","position":29,"original_position":29,"commit_id":"3667e65dd73c6928c2f776db05f21ad5a9ffdf7f","original_commit_id":"3667e65dd73c6928c2f776db05f21ad5a9ffdf7f","user":{"login":"johngian","id":835321,"avatar_url":"https://avatars.githubusercontent.com/u/835321?v=3","gravatar_id":"","url":"https://api.github.com/users/johngian","html_url":"https://github.com/johngian","followers_url":"https://api.github.com/users/johngian/followers","following_url":"https://api.github.com/users/johngian/following{/other_user}","gists_url":"https://api.github.com/users/johngian/gists{/gist_id}","starred_url":"https://api.github.com/users/johngian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johngian/subscriptions","organizations_url":"https://api.github.com/users/johngian/orgs","repos_url":"https://api.github.com/users/johngian/repos","events_url":"https://api.github.com/users/johngian/events{/privacy}","received_events_url":"https://api.github.com/users/johngian/received_events","type":"User","site_admin":false},"body":"``urls`` can be ``None`` and this is going to raise ``TypeError: 'NoneType' object is not iterable``","created_at":"2016-08-24T08:36:08Z","updated_at":"2016-08-24T08:36:08Z","html_url":"https://github.com/glogiotatidis/babis/pull/2#discussion_r76014998","pull_request_url":"https://api.github.com/repos/glogiotatidis/babis/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/glogiotatidis/babis/pulls/comments/76014998"},"html":{"href":"https://github.com/glogiotatidis/babis/pull/2#discussion_r76014998"},"pull_request":{"href":"https://api.github.com/repos/glogiotatidis/babis/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/glogiotatidis/babis/pulls/2","id":82386606,"html_url":"https://github.com/glogiotatidis/babis/pull/2","diff_url":"https://github.com/glogiotatidis/babis/pull/2.diff","patch_url":"https://github.com/glogiotatidis/babis/pull/2.patch","issue_url":"https://api.github.com/repos/glogiotatidis/babis/issues/2","number":2,"state":"open","locked":false,"title":"Core functionality.","user":{"login":"glogiotatidis","id":584352,"avatar_url":"https://avatars.githubusercontent.com/u/584352?v=3","gravatar_id":"","url":"https://api.github.com/users/glogiotatidis","html_url":"https://github.com/glogiotatidis","followers_url":"https://api.github.com/users/glogiotatidis/followers","following_url":"https://api.github.com/users/glogiotatidis/following{/other_user}","gists_url":"https://api.github.com/users/glogiotatidis/gists{/gist_id}","starred_url":"https://api.github.com/users/glogiotatidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glogiotatidis/subscriptions","organizations_url":"https://api.github.com/users/glogiotatidis/orgs","repos_url":"https://api.github.com/users/glogiotatidis/repos","events_url":"https://api.github.com/users/glogiotatidis/events{/privacy}","received_events_url":"https://api.github.com/users/glogiotatidis/received_events","type":"User","site_admin":false},"body":"Features:\r\n - Ping URLs before executing\r\n - Ping URLs after executing\r\n - HTTP Method to be used\r\n - User agent setting\r\n - Silent failures\r\n - and... tests!","created_at":"2016-08-23T15:25:34Z","updated_at":"2016-08-24T08:36:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b19f7eee3dffb6cd87bf10766252bb1cfffe9ad7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/glogiotatidis/babis/pulls/2/commits","review_comments_url":"https://api.github.com/repos/glogiotatidis/babis/pulls/2/comments","review_comment_url":"https://api.github.com/repos/glogiotatidis/babis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/glogiotatidis/babis/issues/2/comments","statuses_url":"https://api.github.com/repos/glogiotatidis/babis/statuses/3667e65dd73c6928c2f776db05f21ad5a9ffdf7f","head":{"label":"glogiotatidis:initial-functionality","ref":"initial-functionality","sha":"3667e65dd73c6928c2f776db05f21ad5a9ffdf7f","user":{"login":"glogiotatidis","id":584352,"avatar_url":"https://avatars.githubusercontent.com/u/584352?v=3","gravatar_id":"","url":"https://api.github.com/users/glogiotatidis","html_url":"https://github.com/glogiotatidis","followers_url":"https://api.github.com/users/glogiotatidis/followers","following_url":"https://api.github.com/users/glogiotatidis/following{/other_user}","gists_url":"https://api.github.com/users/glogiotatidis/gists{/gist_id}","starred_url":"https://api.github.com/users/glogiotatidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glogiotatidis/subscriptions","organizations_url":"https://api.github.com/users/glogiotatidis/orgs","repos_url":"https://api.github.com/users/glogiotatidis/repos","events_url":"https://api.github.com/users/glogiotatidis/events{/privacy}","received_events_url":"https://api.github.com/users/glogiotatidis/received_events","type":"User","site_admin":false},"repo":{"id":66365617,"name":"babis","full_name":"glogiotatidis/babis","owner":{"login":"glogiotatidis","id":584352,"avatar_url":"https://avatars.githubusercontent.com/u/584352?v=3","gravatar_id":"","url":"https://api.github.com/users/glogiotatidis","html_url":"https://github.com/glogiotatidis","followers_url":"https://api.github.com/users/glogiotatidis/followers","following_url":"https://api.github.com/users/glogiotatidis/following{/other_user}","gists_url":"https://api.github.com/users/glogiotatidis/gists{/gist_id}","starred_url":"https://api.github.com/users/glogiotatidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glogiotatidis/subscriptions","organizations_url":"https://api.github.com/users/glogiotatidis/orgs","repos_url":"https://api.github.com/users/glogiotatidis/repos","events_url":"https://api.github.com/users/glogiotatidis/events{/privacy}","received_events_url":"https://api.github.com/users/glogiotatidis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/glogiotatidis/babis","description":"Decorator that pings URLs before and after executing the wrapped obj","fork":false,"url":"https://api.github.com/repos/glogiotatidis/babis","forks_url":"https://api.github.com/repos/glogiotatidis/babis/forks","keys_url":"https://api.github.com/repos/glogiotatidis/babis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glogiotatidis/babis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glogiotatidis/babis/teams","hooks_url":"https://api.github.com/repos/glogiotatidis/babis/hooks","issue_events_url":"https://api.github.com/repos/glogiotatidis/babis/issues/events{/number}","events_url":"https://api.github.com/repos/glogiotatidis/babis/events","assignees_url":"https://api.github.com/repos/glogiotatidis/babis/assignees{/user}","branches_url":"https://api.github.com/repos/glogiotatidis/babis/branches{/branch}","tags_url":"https://api.github.com/repos/glogiotatidis/babis/tags","blobs_url":"https://api.github.com/repos/glogiotatidis/babis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glogiotatidis/babis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glogiotatidis/babis/git/refs{/sha}","trees_url":"https://api.github.com/repos/glogiotatidis/babis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glogiotatidis/babis/statuses/{sha}","languages_url":"https://api.github.com/repos/glogiotatidis/babis/languages","stargazers_url":"https://api.github.com/repos/glogiotatidis/babis/stargazers","contributors_url":"https://api.github.com/repos/glogiotatidis/babis/contributors","subscribers_url":"https://api.github.com/repos/glogiotatidis/babis/subscribers","subscription_url":"https://api.github.com/repos/glogiotatidis/babis/subscription","commits_url":"https://api.github.com/repos/glogiotatidis/babis/commits{/sha}","git_commits_url":"https://api.github.com/repos/glogiotatidis/babis/git/commits{/sha}","comments_url":"https://api.github.com/repos/glogiotatidis/babis/comments{/number}","issue_comment_url":"https://api.github.com/repos/glogiotatidis/babis/issues/comments{/number}","contents_url":"https://api.github.com/repos/glogiotatidis/babis/contents/{+path}","compare_url":"https://api.github.com/repos/glogiotatidis/babis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glogiotatidis/babis/merges","archive_url":"https://api.github.com/repos/glogiotatidis/babis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glogiotatidis/babis/downloads","issues_url":"https://api.github.com/repos/glogiotatidis/babis/issues{/number}","pulls_url":"https://api.github.com/repos/glogiotatidis/babis/pulls{/number}","milestones_url":"https://api.github.com/repos/glogiotatidis/babis/milestones{/number}","notifications_url":"https://api.github.com/repos/glogiotatidis/babis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glogiotatidis/babis/labels{/name}","releases_url":"https://api.github.com/repos/glogiotatidis/babis/releases{/id}","deployments_url":"https://api.github.com/repos/glogiotatidis/babis/deployments","created_at":"2016-08-23T12:39:21Z","updated_at":"2016-08-24T07:00:03Z","pushed_at":"2016-08-24T07:25:30Z","git_url":"git://github.com/glogiotatidis/babis.git","ssh_url":"git@github.com:glogiotatidis/babis.git","clone_url":"https://github.com/glogiotatidis/babis.git","svn_url":"https://github.com/glogiotatidis/babis","homepage":"","size":21,"stargazers_count":0,"watchers_count":0,"language":"Makefile","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"glogiotatidis:master","ref":"master","sha":"7a7cc0f91f4f86ef850002f5a4b947585bd8e2a7","user":{"login":"glogiotatidis","id":584352,"avatar_url":"https://avatars.githubusercontent.com/u/584352?v=3","gravatar_id":"","url":"https://api.github.com/users/glogiotatidis","html_url":"https://github.com/glogiotatidis","followers_url":"https://api.github.com/users/glogiotatidis/followers","following_url":"https://api.github.com/users/glogiotatidis/following{/other_user}","gists_url":"https://api.github.com/users/glogiotatidis/gists{/gist_id}","starred_url":"https://api.github.com/users/glogiotatidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glogiotatidis/subscriptions","organizations_url":"https://api.github.com/users/glogiotatidis/orgs","repos_url":"https://api.github.com/users/glogiotatidis/repos","events_url":"https://api.github.com/users/glogiotatidis/events{/privacy}","received_events_url":"https://api.github.com/users/glogiotatidis/received_events","type":"User","site_admin":false},"repo":{"id":66365617,"name":"babis","full_name":"glogiotatidis/babis","owner":{"login":"glogiotatidis","id":584352,"avatar_url":"https://avatars.githubusercontent.com/u/584352?v=3","gravatar_id":"","url":"https://api.github.com/users/glogiotatidis","html_url":"https://github.com/glogiotatidis","followers_url":"https://api.github.com/users/glogiotatidis/followers","following_url":"https://api.github.com/users/glogiotatidis/following{/other_user}","gists_url":"https://api.github.com/users/glogiotatidis/gists{/gist_id}","starred_url":"https://api.github.com/users/glogiotatidis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glogiotatidis/subscriptions","organizations_url":"https://api.github.com/users/glogiotatidis/orgs","repos_url":"https://api.github.com/users/glogiotatidis/repos","events_url":"https://api.github.com/users/glogiotatidis/events{/privacy}","received_events_url":"https://api.github.com/users/glogiotatidis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/glogiotatidis/babis","description":"Decorator that pings URLs before and after executing the wrapped obj","fork":false,"url":"https://api.github.com/repos/glogiotatidis/babis","forks_url":"https://api.github.com/repos/glogiotatidis/babis/forks","keys_url":"https://api.github.com/repos/glogiotatidis/babis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glogiotatidis/babis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glogiotatidis/babis/teams","hooks_url":"https://api.github.com/repos/glogiotatidis/babis/hooks","issue_events_url":"https://api.github.com/repos/glogiotatidis/babis/issues/events{/number}","events_url":"https://api.github.com/repos/glogiotatidis/babis/events","assignees_url":"https://api.github.com/repos/glogiotatidis/babis/assignees{/user}","branches_url":"https://api.github.com/repos/glogiotatidis/babis/branches{/branch}","tags_url":"https://api.github.com/repos/glogiotatidis/babis/tags","blobs_url":"https://api.github.com/repos/glogiotatidis/babis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glogiotatidis/babis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glogiotatidis/babis/git/refs{/sha}","trees_url":"https://api.github.com/repos/glogiotatidis/babis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glogiotatidis/babis/statuses/{sha}","languages_url":"https://api.github.com/repos/glogiotatidis/babis/languages","stargazers_url":"https://api.github.com/repos/glogiotatidis/babis/stargazers","contributors_url":"https://api.github.com/repos/glogiotatidis/babis/contributors","subscribers_url":"https://api.github.com/repos/glogiotatidis/babis/subscribers","subscription_url":"https://api.github.com/repos/glogiotatidis/babis/subscription","commits_url":"https://api.github.com/repos/glogiotatidis/babis/commits{/sha}","git_commits_url":"https://api.github.com/repos/glogiotatidis/babis/git/commits{/sha}","comments_url":"https://api.github.com/repos/glogiotatidis/babis/comments{/number}","issue_comment_url":"https://api.github.com/repos/glogiotatidis/babis/issues/comments{/number}","contents_url":"https://api.github.com/repos/glogiotatidis/babis/contents/{+path}","compare_url":"https://api.github.com/repos/glogiotatidis/babis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glogiotatidis/babis/merges","archive_url":"https://api.github.com/repos/glogiotatidis/babis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glogiotatidis/babis/downloads","issues_url":"https://api.github.com/repos/glogiotatidis/babis/issues{/number}","pulls_url":"https://api.github.com/repos/glogiotatidis/babis/pulls{/number}","milestones_url":"https://api.github.com/repos/glogiotatidis/babis/milestones{/number}","notifications_url":"https://api.github.com/repos/glogiotatidis/babis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glogiotatidis/babis/labels{/name}","releases_url":"https://api.github.com/repos/glogiotatidis/babis/releases{/id}","deployments_url":"https://api.github.com/repos/glogiotatidis/babis/deployments","created_at":"2016-08-23T12:39:21Z","updated_at":"2016-08-24T07:00:03Z","pushed_at":"2016-08-24T07:25:30Z","git_url":"git://github.com/glogiotatidis/babis.git","ssh_url":"git@github.com:glogiotatidis/babis.git","clone_url":"https://github.com/glogiotatidis/babis.git","svn_url":"https://github.com/glogiotatidis/babis","homepage":"","size":21,"stargazers_count":0,"watchers_count":0,"language":"Makefile","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/glogiotatidis/babis/pulls/2"},"html":{"href":"https://github.com/glogiotatidis/babis/pull/2"},"issue":{"href":"https://api.github.com/repos/glogiotatidis/babis/issues/2"},"comments":{"href":"https://api.github.com/repos/glogiotatidis/babis/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/glogiotatidis/babis/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/glogiotatidis/babis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/glogiotatidis/babis/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/glogiotatidis/babis/statuses/3667e65dd73c6928c2f776db05f21ad5a9ffdf7f"}}}}
{"actor":{"display_login":"johngian"}}