GitHub PullRequestReviewCommentEvent at 2014-08-25 17:15:30
Repository: repoguard
Actor: karthik-rangarajan
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/prezi/repoguard/pulls/comments/16666912","id":16666912,"diff_hunk":"@@ -33,9 +47,18 @@ def send_if_fine(self):\n         if self.email_from and self.email_to and self.mime_message:\n             self.smtp_send()\n         else:\n-            raise Exception(\"Mails should have FROM, TO headers and a message as well!\")\n+            raise EmailNotifierException(\"Mails should have FROM, TO headers and a message as well!\")\n \n     def smtp_send(self):\n-        smtp = smtplib.SMTP(self.connection_string)\n-        smtp.sendmail(self.email_from, self.email_to, self.mime_message.as_string())\n-        smtp.quit()\n+        try:\n+            smtp = smtplib.SMTP(self.connection_string)\n+            if self.login_to_smtp:\n+                if self.use_tls:\n+                    smtp.starttls()\n+                smtp.login(self.username, self.password)\n+            smtp.sendmail(self.email_from, self.email_to, self.mime_message.as_string())\n+            smtp.quit()","path":"core/notifier.py","position":56,"original_position":56,"commit_id":"aad0d15d9ccd66204567c40c168d7f233aea4adf","original_commit_id":"1235a534f839495e3533b6b6fb9fc9eaa6e6f2e4","user":{"login":"karthik-rangarajan","id":6006468,"avatar_url":"https://avatars.githubusercontent.com/u/6006468?v=2","gravatar_id":"a112bda59abd65591016fccffc7900aa","url":"https://api.github.com/users/karthik-rangarajan","html_url":"https://github.com/karthik-rangarajan","followers_url":"https://api.github.com/users/karthik-rangarajan/followers","following_url":"https://api.github.com/users/karthik-rangarajan/following{/other_user}","gists_url":"https://api.github.com/users/karthik-rangarajan/gists{/gist_id}","starred_url":"https://api.github.com/users/karthik-rangarajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karthik-rangarajan/subscriptions","organizations_url":"https://api.github.com/users/karthik-rangarajan/orgs","repos_url":"https://api.github.com/users/karthik-rangarajan/repos","events_url":"https://api.github.com/users/karthik-rangarajan/events{/privacy}","received_events_url":"https://api.github.com/users/karthik-rangarajan/received_events","type":"User","site_admin":false},"body":"You're right, I missed that one. I'll add a finally.","created_at":"2014-08-25T17:15:30Z","updated_at":"2014-08-25T17:15:30Z","html_url":"https://github.com/prezi/repoguard/pull/1#discussion_r16666912","pull_request_url":"https://api.github.com/repos/prezi/repoguard/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/prezi/repoguard/pulls/comments/16666912"},"html":{"href":"https://github.com/prezi/repoguard/pull/1#discussion_r16666912"},"pull_request":{"href":"https://api.github.com/repos/prezi/repoguard/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/prezi/repoguard/pulls/1","id":20150206,"html_url":"https://github.com/prezi/repoguard/pull/1","diff_url":"https://github.com/prezi/repoguard/pull/1.diff","patch_url":"https://github.com/prezi/repoguard/pull/1.patch","issue_url":"https://api.github.com/repos/prezi/repoguard/issues/1","number":1,"state":"open","locked":false,"title":"Add option to send email via gmail or other authenticated service.","user":{"login":"karthik-rangarajan","id":6006468,"avatar_url":"https://avatars.githubusercontent.com/u/6006468?v=2","gravatar_id":"a112bda59abd65591016fccffc7900aa","url":"https://api.github.com/users/karthik-rangarajan","html_url":"https://github.com/karthik-rangarajan","followers_url":"https://api.github.com/users/karthik-rangarajan/followers","following_url":"https://api.github.com/users/karthik-rangarajan/following{/other_user}","gists_url":"https://api.github.com/users/karthik-rangarajan/gists{/gist_id}","starred_url":"https://api.github.com/users/karthik-rangarajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karthik-rangarajan/subscriptions","organizations_url":"https://api.github.com/users/karthik-rangarajan/orgs","repos_url":"https://api.github.com/users/karthik-rangarajan/repos","events_url":"https://api.github.com/users/karthik-rangarajan/events{/privacy}","received_events_url":"https://api.github.com/users/karthik-rangarajan/received_events","type":"User","site_admin":false},"body":"I was trying out repoguard on my local machine, and didn't have a local SMTP server to use. I wrote this code to send email via other SMTP servers (I tested on Google and Microsoft Live).","created_at":"2014-08-22T02:44:31Z","updated_at":"2014-08-25T17:15:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18d5b9e19301b58e5abb5bc32644b43ad68f9923","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/prezi/repoguard/pulls/1/commits","review_comments_url":"https://api.github.com/repos/prezi/repoguard/pulls/1/comments","review_comment_url":"https://api.github.com/repos/prezi/repoguard/pulls/comments/{number}","comments_url":"https://api.github.com/repos/prezi/repoguard/issues/1/comments","statuses_url":"https://api.github.com/repos/prezi/repoguard/statuses/aad0d15d9ccd66204567c40c168d7f233aea4adf","head":{"label":"karthik-rangarajan:master","ref":"master","sha":"aad0d15d9ccd66204567c40c168d7f233aea4adf","user":{"login":"karthik-rangarajan","id":6006468,"avatar_url":"https://avatars.githubusercontent.com/u/6006468?v=2","gravatar_id":"a112bda59abd65591016fccffc7900aa","url":"https://api.github.com/users/karthik-rangarajan","html_url":"https://github.com/karthik-rangarajan","followers_url":"https://api.github.com/users/karthik-rangarajan/followers","following_url":"https://api.github.com/users/karthik-rangarajan/following{/other_user}","gists_url":"https://api.github.com/users/karthik-rangarajan/gists{/gist_id}","starred_url":"https://api.github.com/users/karthik-rangarajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karthik-rangarajan/subscriptions","organizations_url":"https://api.github.com/users/karthik-rangarajan/orgs","repos_url":"https://api.github.com/users/karthik-rangarajan/repos","events_url":"https://api.github.com/users/karthik-rangarajan/events{/privacy}","received_events_url":"https://api.github.com/users/karthik-rangarajan/received_events","type":"User","site_admin":false},"repo":{"id":23168272,"name":"repoguard","full_name":"karthik-rangarajan/repoguard","owner":{"login":"karthik-rangarajan","id":6006468,"avatar_url":"https://avatars.githubusercontent.com/u/6006468?v=2","gravatar_id":"a112bda59abd65591016fccffc7900aa","url":"https://api.github.com/users/karthik-rangarajan","html_url":"https://github.com/karthik-rangarajan","followers_url":"https://api.github.com/users/karthik-rangarajan/followers","following_url":"https://api.github.com/users/karthik-rangarajan/following{/other_user}","gists_url":"https://api.github.com/users/karthik-rangarajan/gists{/gist_id}","starred_url":"https://api.github.com/users/karthik-rangarajan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karthik-rangarajan/subscriptions","organizations_url":"https://api.github.com/users/karthik-rangarajan/orgs","repos_url":"https://api.github.com/users/karthik-rangarajan/repos","events_url":"https://api.github.com/users/karthik-rangarajan/events{/privacy}","received_events_url":"https://api.github.com/users/karthik-rangarajan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/karthik-rangarajan/repoguard","description":"Repoguard is a simple tool to check and alert on interesting changes in a git repository.","fork":true,"url":"https://api.github.com/repos/karthik-rangarajan/repoguard","forks_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/forks","keys_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/teams","hooks_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/hooks","issue_events_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/issues/events{/number}","events_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/events","assignees_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/assignees{/user}","branches_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/branches{/branch}","tags_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/tags","blobs_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/git/refs{/sha}","trees_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/statuses/{sha}","languages_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/languages","stargazers_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/stargazers","contributors_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/contributors","subscribers_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/subscribers","subscription_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/subscription","commits_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/commits{/sha}","git_commits_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/git/commits{/sha}","comments_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/comments{/number}","issue_comment_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/issues/comments/{number}","contents_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/contents/{+path}","compare_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/merges","archive_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/downloads","issues_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/issues{/number}","pulls_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/pulls{/number}","milestones_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/milestones{/number}","notifications_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/labels{/name}","releases_url":"https://api.github.com/repos/karthik-rangarajan/repoguard/releases{/id}","created_at":"2014-08-21T00:04:12Z","updated_at":"2014-08-22T02:42:56Z","pushed_at":"2014-08-25T17:14:57Z","git_url":"git://github.com/karthik-rangarajan/repoguard.git","ssh_url":"git@github.com:karthik-rangarajan/repoguard.git","clone_url":"https://github.com/karthik-rangarajan/repoguard.git","svn_url":"https://github.com/karthik-rangarajan/repoguard","homepage":null,"size":354,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"prezi:master","ref":"master","sha":"865f626d0d3cd1a61bbfb7ac375d478f87f60888","user":{"login":"prezi","id":1989101,"avatar_url":"https://avatars.githubusercontent.com/u/1989101?v=2","gravatar_id":"854a91963b1cceab615cafda9ecdf488","url":"https://api.github.com/users/prezi","html_url":"https://github.com/prezi","followers_url":"https://api.github.com/users/prezi/followers","following_url":"https://api.github.com/users/prezi/following{/other_user}","gists_url":"https://api.github.com/users/prezi/gists{/gist_id}","starred_url":"https://api.github.com/users/prezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prezi/subscriptions","organizations_url":"https://api.github.com/users/prezi/orgs","repos_url":"https://api.github.com/users/prezi/repos","events_url":"https://api.github.com/users/prezi/events{/privacy}","received_events_url":"https://api.github.com/users/prezi/received_events","type":"Organization","site_admin":false},"repo":{"id":22835114,"name":"repoguard","full_name":"prezi/repoguard","owner":{"login":"prezi","id":1989101,"avatar_url":"https://avatars.githubusercontent.com/u/1989101?v=2","gravatar_id":"854a91963b1cceab615cafda9ecdf488","url":"https://api.github.com/users/prezi","html_url":"https://github.com/prezi","followers_url":"https://api.github.com/users/prezi/followers","following_url":"https://api.github.com/users/prezi/following{/other_user}","gists_url":"https://api.github.com/users/prezi/gists{/gist_id}","starred_url":"https://api.github.com/users/prezi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prezi/subscriptions","organizations_url":"https://api.github.com/users/prezi/orgs","repos_url":"https://api.github.com/users/prezi/repos","events_url":"https://api.github.com/users/prezi/events{/privacy}","received_events_url":"https://api.github.com/users/prezi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prezi/repoguard","description":"Repoguard is a simple tool to check and alert on interesting changes in a git repository.","fork":false,"url":"https://api.github.com/repos/prezi/repoguard","forks_url":"https://api.github.com/repos/prezi/repoguard/forks","keys_url":"https://api.github.com/repos/prezi/repoguard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prezi/repoguard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prezi/repoguard/teams","hooks_url":"https://api.github.com/repos/prezi/repoguard/hooks","issue_events_url":"https://api.github.com/repos/prezi/repoguard/issues/events{/number}","events_url":"https://api.github.com/repos/prezi/repoguard/events","assignees_url":"https://api.github.com/repos/prezi/repoguard/assignees{/user}","branches_url":"https://api.github.com/repos/prezi/repoguard/branches{/branch}","tags_url":"https://api.github.com/repos/prezi/repoguard/tags","blobs_url":"https://api.github.com/repos/prezi/repoguard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prezi/repoguard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prezi/repoguard/git/refs{/sha}","trees_url":"https://api.github.com/repos/prezi/repoguard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prezi/repoguard/statuses/{sha}","languages_url":"https://api.github.com/repos/prezi/repoguard/languages","stargazers_url":"https://api.github.com/repos/prezi/repoguard/stargazers","contributors_url":"https://api.github.com/repos/prezi/repoguard/contributors","subscribers_url":"https://api.github.com/repos/prezi/repoguard/subscribers","subscription_url":"https://api.github.com/repos/prezi/repoguard/subscription","commits_url":"https://api.github.com/repos/prezi/repoguard/commits{/sha}","git_commits_url":"https://api.github.com/repos/prezi/repoguard/git/commits{/sha}","comments_url":"https://api.github.com/repos/prezi/repoguard/comments{/number}","issue_comment_url":"https://api.github.com/repos/prezi/repoguard/issues/comments/{number}","contents_url":"https://api.github.com/repos/prezi/repoguard/contents/{+path}","compare_url":"https://api.github.com/repos/prezi/repoguard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prezi/repoguard/merges","archive_url":"https://api.github.com/repos/prezi/repoguard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prezi/repoguard/downloads","issues_url":"https://api.github.com/repos/prezi/repoguard/issues{/number}","pulls_url":"https://api.github.com/repos/prezi/repoguard/pulls{/number}","milestones_url":"https://api.github.com/repos/prezi/repoguard/milestones{/number}","notifications_url":"https://api.github.com/repos/prezi/repoguard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prezi/repoguard/labels{/name}","releases_url":"https://api.github.com/repos/prezi/repoguard/releases{/id}","created_at":"2014-08-11T10:16:56Z","updated_at":"2014-08-13T13:59:36Z","pushed_at":"2014-08-12T13:12:44Z","git_url":"git://github.com/prezi/repoguard.git","ssh_url":"git@github.com:prezi/repoguard.git","clone_url":"https://github.com/prezi/repoguard.git","svn_url":"https://github.com/prezi/repoguard","homepage":null,"size":418,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prezi/repoguard/pulls/1"},"html":{"href":"https://github.com/prezi/repoguard/pull/1"},"issue":{"href":"https://api.github.com/repos/prezi/repoguard/issues/1"},"comments":{"href":"https://api.github.com/repos/prezi/repoguard/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/prezi/repoguard/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/prezi/repoguard/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/prezi/repoguard/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/prezi/repoguard/statuses/aad0d15d9ccd66204567c40c168d7f233aea4adf"}}}}