{"action":"created","comment":{"url":"https://api.github.com/repos/Bl41r/http_server/pulls/comments/75584986","id":75584986,"diff_hunk":"@@ -1,16 +1,51 @@\n # -*- coding: utf-8 -*-\n import socket\n \n+port = 5003\n \n-def response_ok():\n-    return b\"HTTP/1.1 200 OK\\r\\nContent-Type: text/plain\\r\\n\\r\\n\"\n \n+class HTTPException(Exception):\n+    def __init__(self, code, reason, htmlstring):\n+        self.code = code\n+        self.reason = reason\n+        self.htmlstring = htmlstring\n+\n+    def as_response(self):\n+        template = \"HTTP/1.1 {} {}\\r\\n\\r\\n{}\"\n+        return template.format(self.code, self.reason, self.htmlstring)\n+\n+\n+def response_ok(uri):\n+    return b\"HTTP/1.1 200 OK\\r\\nContent-Type: text/plain\\r\\n\\r\\nIf you want my body and you think I'm sexy come on sugar let me know\\r\\n\\r\\n\"\n+\n+\n+def response_error(msg):\n+    return msg","path":"src/server.py","position":25,"original_position":25,"commit_id":"b69d7b84cd759c67229ff24375cb7156592a6033","original_commit_id":"b69d7b84cd759c67229ff24375cb7156592a6033","user":{"login":"cewing","id":417109,"avatar_url":"https://avatars.githubusercontent.com/u/417109?v=3","gravatar_id":"","url":"https://api.github.com/users/cewing","html_url":"https://github.com/cewing","followers_url":"https://api.github.com/users/cewing/followers","following_url":"https://api.github.com/users/cewing/following{/other_user}","gists_url":"https://api.github.com/users/cewing/gists{/gist_id}","starred_url":"https://api.github.com/users/cewing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cewing/subscriptions","organizations_url":"https://api.github.com/users/cewing/orgs","repos_url":"https://api.github.com/users/cewing/repos","events_url":"https://api.github.com/users/cewing/events{/privacy}","received_events_url":"https://api.github.com/users/cewing/received_events","type":"User","site_admin":false},"body":"As it stands, this is a completely useless function.  Why keep it?\r\n\r\nYou could make it a bit less useless like so:\r\n\r\n```python\r\ndef response_error(http_exception_instance):\r\n    return http_exception_instance.as_response()\r\n```","created_at":"2016-08-20T21:19:49Z","updated_at":"2016-08-20T21:19:49Z","html_url":"https://github.com/Bl41r/http_server/pull/3#discussion_r75584986","pull_request_url":"https://api.github.com/repos/Bl41r/http_server/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/Bl41r/http_server/pulls/comments/75584986"},"html":{"href":"https://github.com/Bl41r/http_server/pull/3#discussion_r75584986"},"pull_request":{"href":"https://api.github.com/repos/Bl41r/http_server/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/Bl41r/http_server/pulls/3","id":82067660,"html_url":"https://github.com/Bl41r/http_server/pull/3","diff_url":"https://github.com/Bl41r/http_server/pull/3.diff","patch_url":"https://github.com/Bl41r/http_server/pull/3.patch","issue_url":"https://api.github.com/repos/Bl41r/http_server/issues/3","number":3,"state":"closed","locked":false,"title":"Step2","user":{"login":"vbenavente","id":15848808,"avatar_url":"https://avatars.githubusercontent.com/u/15848808?v=3","gravatar_id":"","url":"https://api.github.com/users/vbenavente","html_url":"https://github.com/vbenavente","followers_url":"https://api.github.com/users/vbenavente/followers","following_url":"https://api.github.com/users/vbenavente/following{/other_user}","gists_url":"https://api.github.com/users/vbenavente/gists{/gist_id}","starred_url":"https://api.github.com/users/vbenavente/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbenavente/subscriptions","organizations_url":"https://api.github.com/users/vbenavente/orgs","repos_url":"https://api.github.com/users/vbenavente/repos","events_url":"https://api.github.com/users/vbenavente/events{/privacy}","received_events_url":"https://api.github.com/users/vbenavente/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-20T03:35:24Z","updated_at":"2016-08-20T21:19:49Z","closed_at":"2016-08-20T03:35:46Z","merged_at":"2016-08-20T03:35:46Z","merge_commit_sha":"dab809b256f07f29a04bf45fa6a4d3caeee1a782","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Bl41r/http_server/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Bl41r/http_server/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Bl41r/http_server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bl41r/http_server/issues/3/comments","statuses_url":"https://api.github.com/repos/Bl41r/http_server/statuses/b69d7b84cd759c67229ff24375cb7156592a6033","head":{"label":"Bl41r:step2","ref":"step2","sha":"b69d7b84cd759c67229ff24375cb7156592a6033","user":{"login":"Bl41r","id":18507197,"avatar_url":"https://avatars.githubusercontent.com/u/18507197?v=3","gravatar_id":"","url":"https://api.github.com/users/Bl41r","html_url":"https://github.com/Bl41r","followers_url":"https://api.github.com/users/Bl41r/followers","following_url":"https://api.github.com/users/Bl41r/following{/other_user}","gists_url":"https://api.github.com/users/Bl41r/gists{/gist_id}","starred_url":"https://api.github.com/users/Bl41r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bl41r/subscriptions","organizations_url":"https://api.github.com/users/Bl41r/orgs","repos_url":"https://api.github.com/users/Bl41r/repos","events_url":"https://api.github.com/users/Bl41r/events{/privacy}","received_events_url":"https://api.github.com/users/Bl41r/received_events","type":"User","site_admin":false},"repo":{"id":65770623,"name":"http_server","full_name":"Bl41r/http_server","owner":{"login":"Bl41r","id":18507197,"avatar_url":"https://avatars.githubusercontent.com/u/18507197?v=3","gravatar_id":"","url":"https://api.github.com/users/Bl41r","html_url":"https://github.com/Bl41r","followers_url":"https://api.github.com/users/Bl41r/followers","following_url":"https://api.github.com/users/Bl41r/following{/other_user}","gists_url":"https://api.github.com/users/Bl41r/gists{/gist_id}","starred_url":"https://api.github.com/users/Bl41r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bl41r/subscriptions","organizations_url":"https://api.github.com/users/Bl41r/orgs","repos_url":"https://api.github.com/users/Bl41r/repos","events_url":"https://api.github.com/users/Bl41r/events{/privacy}","received_events_url":"https://api.github.com/users/Bl41r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bl41r/http_server","description":"An http server written in Python","fork":false,"url":"https://api.github.com/repos/Bl41r/http_server","forks_url":"https://api.github.com/repos/Bl41r/http_server/forks","keys_url":"https://api.github.com/repos/Bl41r/http_server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bl41r/http_server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bl41r/http_server/teams","hooks_url":"https://api.github.com/repos/Bl41r/http_server/hooks","issue_events_url":"https://api.github.com/repos/Bl41r/http_server/issues/events{/number}","events_url":"https://api.github.com/repos/Bl41r/http_server/events","assignees_url":"https://api.github.com/repos/Bl41r/http_server/assignees{/user}","branches_url":"https://api.github.com/repos/Bl41r/http_server/branches{/branch}","tags_url":"https://api.github.com/repos/Bl41r/http_server/tags","blobs_url":"https://api.github.com/repos/Bl41r/http_server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bl41r/http_server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bl41r/http_server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bl41r/http_server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bl41r/http_server/statuses/{sha}","languages_url":"https://api.github.com/repos/Bl41r/http_server/languages","stargazers_url":"https://api.github.com/repos/Bl41r/http_server/stargazers","contributors_url":"https://api.github.com/repos/Bl41r/http_server/contributors","subscribers_url":"https://api.github.com/repos/Bl41r/http_server/subscribers","subscription_url":"https://api.github.com/repos/Bl41r/http_server/subscription","commits_url":"https://api.github.com/repos/Bl41r/http_server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bl41r/http_server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bl41r/http_server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bl41r/http_server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bl41r/http_server/contents/{+path}","compare_url":"https://api.github.com/repos/Bl41r/http_server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bl41r/http_server/merges","archive_url":"https://api.github.com/repos/Bl41r/http_server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bl41r/http_server/downloads","issues_url":"https://api.github.com/repos/Bl41r/http_server/issues{/number}","pulls_url":"https://api.github.com/repos/Bl41r/http_server/pulls{/number}","milestones_url":"https://api.github.com/repos/Bl41r/http_server/milestones{/number}","notifications_url":"https://api.github.com/repos/Bl41r/http_server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bl41r/http_server/labels{/name}","releases_url":"https://api.github.com/repos/Bl41r/http_server/releases{/id}","deployments_url":"https://api.github.com/repos/Bl41r/http_server/deployments","created_at":"2016-08-15T22:58:44Z","updated_at":"2016-08-20T02:41:41Z","pushed_at":"2016-08-20T03:35:47Z","git_url":"git://github.com/Bl41r/http_server.git","ssh_url":"git@github.com:Bl41r/http_server.git","clone_url":"https://github.com/Bl41r/http_server.git","svn_url":"https://github.com/Bl41r/http_server","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Bl41r:master","ref":"master","sha":"1cf7ad4a0282206ed9d987b77be648358c1737e7","user":{"login":"Bl41r","id":18507197,"avatar_url":"https://avatars.githubusercontent.com/u/18507197?v=3","gravatar_id":"","url":"https://api.github.com/users/Bl41r","html_url":"https://github.com/Bl41r","followers_url":"https://api.github.com/users/Bl41r/followers","following_url":"https://api.github.com/users/Bl41r/following{/other_user}","gists_url":"https://api.github.com/users/Bl41r/gists{/gist_id}","starred_url":"https://api.github.com/users/Bl41r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bl41r/subscriptions","organizations_url":"https://api.github.com/users/Bl41r/orgs","repos_url":"https://api.github.com/users/Bl41r/repos","events_url":"https://api.github.com/users/Bl41r/events{/privacy}","received_events_url":"https://api.github.com/users/Bl41r/received_events","type":"User","site_admin":false},"repo":{"id":65770623,"name":"http_server","full_name":"Bl41r/http_server","owner":{"login":"Bl41r","id":18507197,"avatar_url":"https://avatars.githubusercontent.com/u/18507197?v=3","gravatar_id":"","url":"https://api.github.com/users/Bl41r","html_url":"https://github.com/Bl41r","followers_url":"https://api.github.com/users/Bl41r/followers","following_url":"https://api.github.com/users/Bl41r/following{/other_user}","gists_url":"https://api.github.com/users/Bl41r/gists{/gist_id}","starred_url":"https://api.github.com/users/Bl41r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bl41r/subscriptions","organizations_url":"https://api.github.com/users/Bl41r/orgs","repos_url":"https://api.github.com/users/Bl41r/repos","events_url":"https://api.github.com/users/Bl41r/events{/privacy}","received_events_url":"https://api.github.com/users/Bl41r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Bl41r/http_server","description":"An http server written in Python","fork":false,"url":"https://api.github.com/repos/Bl41r/http_server","forks_url":"https://api.github.com/repos/Bl41r/http_server/forks","keys_url":"https://api.github.com/repos/Bl41r/http_server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bl41r/http_server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bl41r/http_server/teams","hooks_url":"https://api.github.com/repos/Bl41r/http_server/hooks","issue_events_url":"https://api.github.com/repos/Bl41r/http_server/issues/events{/number}","events_url":"https://api.github.com/repos/Bl41r/http_server/events","assignees_url":"https://api.github.com/repos/Bl41r/http_server/assignees{/user}","branches_url":"https://api.github.com/repos/Bl41r/http_server/branches{/branch}","tags_url":"https://api.github.com/repos/Bl41r/http_server/tags","blobs_url":"https://api.github.com/repos/Bl41r/http_server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bl41r/http_server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bl41r/http_server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bl41r/http_server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bl41r/http_server/statuses/{sha}","languages_url":"https://api.github.com/repos/Bl41r/http_server/languages","stargazers_url":"https://api.github.com/repos/Bl41r/http_server/stargazers","contributors_url":"https://api.github.com/repos/Bl41r/http_server/contributors","subscribers_url":"https://api.github.com/repos/Bl41r/http_server/subscribers","subscription_url":"https://api.github.com/repos/Bl41r/http_server/subscription","commits_url":"https://api.github.com/repos/Bl41r/http_server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bl41r/http_server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bl41r/http_server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bl41r/http_server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bl41r/http_server/contents/{+path}","compare_url":"https://api.github.com/repos/Bl41r/http_server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bl41r/http_server/merges","archive_url":"https://api.github.com/repos/Bl41r/http_server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bl41r/http_server/downloads","issues_url":"https://api.github.com/repos/Bl41r/http_server/issues{/number}","pulls_url":"https://api.github.com/repos/Bl41r/http_server/pulls{/number}","milestones_url":"https://api.github.com/repos/Bl41r/http_server/milestones{/number}","notifications_url":"https://api.github.com/repos/Bl41r/http_server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bl41r/http_server/labels{/name}","releases_url":"https://api.github.com/repos/Bl41r/http_server/releases{/id}","deployments_url":"https://api.github.com/repos/Bl41r/http_server/deployments","created_at":"2016-08-15T22:58:44Z","updated_at":"2016-08-20T02:41:41Z","pushed_at":"2016-08-20T03:35:47Z","git_url":"git://github.com/Bl41r/http_server.git","ssh_url":"git@github.com:Bl41r/http_server.git","clone_url":"https://github.com/Bl41r/http_server.git","svn_url":"https://github.com/Bl41r/http_server","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Bl41r/http_server/pulls/3"},"html":{"href":"https://github.com/Bl41r/http_server/pull/3"},"issue":{"href":"https://api.github.com/repos/Bl41r/http_server/issues/3"},"comments":{"href":"https://api.github.com/repos/Bl41r/http_server/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Bl41r/http_server/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Bl41r/http_server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bl41r/http_server/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Bl41r/http_server/statuses/b69d7b84cd759c67229ff24375cb7156592a6033"}}}}
{"actor":{"display_login":"cewing"}}