{"action":"created","comment":{"url":"https://api.github.com/repos/liushuigs/cavat/pulls/comments/60601977","id":60601977,"diff_hunk":"@@ -0,0 +1,19 @@\n+from os.path import join, abspath, dirname\n+from ConfigParser import SafeConfigParser\n+\n+\n+class CvConfig(object):\n+    def get(self, item, key):\n+        return self.parser.get(item, key)\n+        pass\n+\n+    def __init__(self):\n+        config_file = join(dirname(dirname(dirname(abspath(__file__)))),\n+                           'configs', 'dev.config.ini')\n+        self.parser = SafeConfigParser()\n+        self.parser.read(config_file)\n+\n+if __name__ == '__main__':\n+    config = CvConfig()\n+    print config.get('db', 'db_host')\n+    print config.get('db', 'db_user')","path":"crawler/cv/util/config.py","position":19,"original_position":19,"commit_id":"5d908f868df796357c3ec1fa80adecf0f30f8bb6","original_commit_id":"ef3a4ccecd59bd86e83aaec053083a64345fe819","user":{"login":"liushuigs","id":2782956,"avatar_url":"https://avatars.githubusercontent.com/u/2782956?v=3","gravatar_id":"","url":"https://api.github.com/users/liushuigs","html_url":"https://github.com/liushuigs","followers_url":"https://api.github.com/users/liushuigs/followers","following_url":"https://api.github.com/users/liushuigs/following{/other_user}","gists_url":"https://api.github.com/users/liushuigs/gists{/gist_id}","starred_url":"https://api.github.com/users/liushuigs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liushuigs/subscriptions","organizations_url":"https://api.github.com/users/liushuigs/orgs","repos_url":"https://api.github.com/users/liushuigs/repos","events_url":"https://api.github.com/users/liushuigs/events{/privacy}","received_events_url":"https://api.github.com/users/liushuigs/received_events","type":"User","site_admin":false},"body":"sure, 16-19 lines should be removed","created_at":"2016-04-21T15:29:22Z","updated_at":"2016-04-21T15:29:22Z","html_url":"https://github.com/liushuigs/cavat/pull/10#discussion_r60601977","pull_request_url":"https://api.github.com/repos/liushuigs/cavat/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/liushuigs/cavat/pulls/comments/60601977"},"html":{"href":"https://github.com/liushuigs/cavat/pull/10#discussion_r60601977"},"pull_request":{"href":"https://api.github.com/repos/liushuigs/cavat/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/liushuigs/cavat/pulls/10","id":67308381,"html_url":"https://github.com/liushuigs/cavat/pull/10","diff_url":"https://github.com/liushuigs/cavat/pull/10.diff","patch_url":"https://github.com/liushuigs/cavat/pull/10.patch","issue_url":"https://api.github.com/repos/liushuigs/cavat/issues/10","number":10,"state":"open","locked":false,"title":"Feature/crawler config normalize","user":{"login":"liushuigs","id":2782956,"avatar_url":"https://avatars.githubusercontent.com/u/2782956?v=3","gravatar_id":"","url":"https://api.github.com/users/liushuigs","html_url":"https://github.com/liushuigs","followers_url":"https://api.github.com/users/liushuigs/followers","following_url":"https://api.github.com/users/liushuigs/following{/other_user}","gists_url":"https://api.github.com/users/liushuigs/gists{/gist_id}","starred_url":"https://api.github.com/users/liushuigs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liushuigs/subscriptions","organizations_url":"https://api.github.com/users/liushuigs/orgs","repos_url":"https://api.github.com/users/liushuigs/repos","events_url":"https://api.github.com/users/liushuigs/events{/privacy}","received_events_url":"https://api.github.com/users/liushuigs/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-21T07:28:19Z","updated_at":"2016-04-21T15:29:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20bdbfa71801964656b2122d3ee68b5423f3824a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/liushuigs/cavat/pulls/10/commits","review_comments_url":"https://api.github.com/repos/liushuigs/cavat/pulls/10/comments","review_comment_url":"https://api.github.com/repos/liushuigs/cavat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/liushuigs/cavat/issues/10/comments","statuses_url":"https://api.github.com/repos/liushuigs/cavat/statuses/5d908f868df796357c3ec1fa80adecf0f30f8bb6","head":{"label":"liushuigs:feature/crawler-config-normalize","ref":"feature/crawler-config-normalize","sha":"5d908f868df796357c3ec1fa80adecf0f30f8bb6","user":{"login":"liushuigs","id":2782956,"avatar_url":"https://avatars.githubusercontent.com/u/2782956?v=3","gravatar_id":"","url":"https://api.github.com/users/liushuigs","html_url":"https://github.com/liushuigs","followers_url":"https://api.github.com/users/liushuigs/followers","following_url":"https://api.github.com/users/liushuigs/following{/other_user}","gists_url":"https://api.github.com/users/liushuigs/gists{/gist_id}","starred_url":"https://api.github.com/users/liushuigs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liushuigs/subscriptions","organizations_url":"https://api.github.com/users/liushuigs/orgs","repos_url":"https://api.github.com/users/liushuigs/repos","events_url":"https://api.github.com/users/liushuigs/events{/privacy}","received_events_url":"https://api.github.com/users/liushuigs/received_events","type":"User","site_admin":false},"repo":{"id":56025379,"name":"cavat","full_name":"liushuigs/cavat","owner":{"login":"liushuigs","id":2782956,"avatar_url":"https://avatars.githubusercontent.com/u/2782956?v=3","gravatar_id":"","url":"https://api.github.com/users/liushuigs","html_url":"https://github.com/liushuigs","followers_url":"https://api.github.com/users/liushuigs/followers","following_url":"https://api.github.com/users/liushuigs/following{/other_user}","gists_url":"https://api.github.com/users/liushuigs/gists{/gist_id}","starred_url":"https://api.github.com/users/liushuigs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liushuigs/subscriptions","organizations_url":"https://api.github.com/users/liushuigs/orgs","repos_url":"https://api.github.com/users/liushuigs/repos","events_url":"https://api.github.com/users/liushuigs/events{/privacy}","received_events_url":"https://api.github.com/users/liushuigs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liushuigs/cavat","description":"","fork":false,"url":"https://api.github.com/repos/liushuigs/cavat","forks_url":"https://api.github.com/repos/liushuigs/cavat/forks","keys_url":"https://api.github.com/repos/liushuigs/cavat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liushuigs/cavat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liushuigs/cavat/teams","hooks_url":"https://api.github.com/repos/liushuigs/cavat/hooks","issue_events_url":"https://api.github.com/repos/liushuigs/cavat/issues/events{/number}","events_url":"https://api.github.com/repos/liushuigs/cavat/events","assignees_url":"https://api.github.com/repos/liushuigs/cavat/assignees{/user}","branches_url":"https://api.github.com/repos/liushuigs/cavat/branches{/branch}","tags_url":"https://api.github.com/repos/liushuigs/cavat/tags","blobs_url":"https://api.github.com/repos/liushuigs/cavat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liushuigs/cavat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liushuigs/cavat/git/refs{/sha}","trees_url":"https://api.github.com/repos/liushuigs/cavat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liushuigs/cavat/statuses/{sha}","languages_url":"https://api.github.com/repos/liushuigs/cavat/languages","stargazers_url":"https://api.github.com/repos/liushuigs/cavat/stargazers","contributors_url":"https://api.github.com/repos/liushuigs/cavat/contributors","subscribers_url":"https://api.github.com/repos/liushuigs/cavat/subscribers","subscription_url":"https://api.github.com/repos/liushuigs/cavat/subscription","commits_url":"https://api.github.com/repos/liushuigs/cavat/commits{/sha}","git_commits_url":"https://api.github.com/repos/liushuigs/cavat/git/commits{/sha}","comments_url":"https://api.github.com/repos/liushuigs/cavat/comments{/number}","issue_comment_url":"https://api.github.com/repos/liushuigs/cavat/issues/comments{/number}","contents_url":"https://api.github.com/repos/liushuigs/cavat/contents/{+path}","compare_url":"https://api.github.com/repos/liushuigs/cavat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liushuigs/cavat/merges","archive_url":"https://api.github.com/repos/liushuigs/cavat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liushuigs/cavat/downloads","issues_url":"https://api.github.com/repos/liushuigs/cavat/issues{/number}","pulls_url":"https://api.github.com/repos/liushuigs/cavat/pulls{/number}","milestones_url":"https://api.github.com/repos/liushuigs/cavat/milestones{/number}","notifications_url":"https://api.github.com/repos/liushuigs/cavat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liushuigs/cavat/labels{/name}","releases_url":"https://api.github.com/repos/liushuigs/cavat/releases{/id}","deployments_url":"https://api.github.com/repos/liushuigs/cavat/deployments","created_at":"2016-04-12T02:47:56Z","updated_at":"2016-04-12T08:21:35Z","pushed_at":"2016-04-21T07:28:19Z","git_url":"git://github.com/liushuigs/cavat.git","ssh_url":"git@github.com:liushuigs/cavat.git","clone_url":"https://github.com/liushuigs/cavat.git","svn_url":"https://github.com/liushuigs/cavat","homepage":null,"size":30,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"liushuigs:master","ref":"master","sha":"1b91f28b5bfac36b217c3718e031712bf261bde0","user":{"login":"liushuigs","id":2782956,"avatar_url":"https://avatars.githubusercontent.com/u/2782956?v=3","gravatar_id":"","url":"https://api.github.com/users/liushuigs","html_url":"https://github.com/liushuigs","followers_url":"https://api.github.com/users/liushuigs/followers","following_url":"https://api.github.com/users/liushuigs/following{/other_user}","gists_url":"https://api.github.com/users/liushuigs/gists{/gist_id}","starred_url":"https://api.github.com/users/liushuigs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liushuigs/subscriptions","organizations_url":"https://api.github.com/users/liushuigs/orgs","repos_url":"https://api.github.com/users/liushuigs/repos","events_url":"https://api.github.com/users/liushuigs/events{/privacy}","received_events_url":"https://api.github.com/users/liushuigs/received_events","type":"User","site_admin":false},"repo":{"id":56025379,"name":"cavat","full_name":"liushuigs/cavat","owner":{"login":"liushuigs","id":2782956,"avatar_url":"https://avatars.githubusercontent.com/u/2782956?v=3","gravatar_id":"","url":"https://api.github.com/users/liushuigs","html_url":"https://github.com/liushuigs","followers_url":"https://api.github.com/users/liushuigs/followers","following_url":"https://api.github.com/users/liushuigs/following{/other_user}","gists_url":"https://api.github.com/users/liushuigs/gists{/gist_id}","starred_url":"https://api.github.com/users/liushuigs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liushuigs/subscriptions","organizations_url":"https://api.github.com/users/liushuigs/orgs","repos_url":"https://api.github.com/users/liushuigs/repos","events_url":"https://api.github.com/users/liushuigs/events{/privacy}","received_events_url":"https://api.github.com/users/liushuigs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liushuigs/cavat","description":"","fork":false,"url":"https://api.github.com/repos/liushuigs/cavat","forks_url":"https://api.github.com/repos/liushuigs/cavat/forks","keys_url":"https://api.github.com/repos/liushuigs/cavat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liushuigs/cavat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liushuigs/cavat/teams","hooks_url":"https://api.github.com/repos/liushuigs/cavat/hooks","issue_events_url":"https://api.github.com/repos/liushuigs/cavat/issues/events{/number}","events_url":"https://api.github.com/repos/liushuigs/cavat/events","assignees_url":"https://api.github.com/repos/liushuigs/cavat/assignees{/user}","branches_url":"https://api.github.com/repos/liushuigs/cavat/branches{/branch}","tags_url":"https://api.github.com/repos/liushuigs/cavat/tags","blobs_url":"https://api.github.com/repos/liushuigs/cavat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liushuigs/cavat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liushuigs/cavat/git/refs{/sha}","trees_url":"https://api.github.com/repos/liushuigs/cavat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liushuigs/cavat/statuses/{sha}","languages_url":"https://api.github.com/repos/liushuigs/cavat/languages","stargazers_url":"https://api.github.com/repos/liushuigs/cavat/stargazers","contributors_url":"https://api.github.com/repos/liushuigs/cavat/contributors","subscribers_url":"https://api.github.com/repos/liushuigs/cavat/subscribers","subscription_url":"https://api.github.com/repos/liushuigs/cavat/subscription","commits_url":"https://api.github.com/repos/liushuigs/cavat/commits{/sha}","git_commits_url":"https://api.github.com/repos/liushuigs/cavat/git/commits{/sha}","comments_url":"https://api.github.com/repos/liushuigs/cavat/comments{/number}","issue_comment_url":"https://api.github.com/repos/liushuigs/cavat/issues/comments{/number}","contents_url":"https://api.github.com/repos/liushuigs/cavat/contents/{+path}","compare_url":"https://api.github.com/repos/liushuigs/cavat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liushuigs/cavat/merges","archive_url":"https://api.github.com/repos/liushuigs/cavat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liushuigs/cavat/downloads","issues_url":"https://api.github.com/repos/liushuigs/cavat/issues{/number}","pulls_url":"https://api.github.com/repos/liushuigs/cavat/pulls{/number}","milestones_url":"https://api.github.com/repos/liushuigs/cavat/milestones{/number}","notifications_url":"https://api.github.com/repos/liushuigs/cavat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liushuigs/cavat/labels{/name}","releases_url":"https://api.github.com/repos/liushuigs/cavat/releases{/id}","deployments_url":"https://api.github.com/repos/liushuigs/cavat/deployments","created_at":"2016-04-12T02:47:56Z","updated_at":"2016-04-12T08:21:35Z","pushed_at":"2016-04-21T07:28:19Z","git_url":"git://github.com/liushuigs/cavat.git","ssh_url":"git@github.com:liushuigs/cavat.git","clone_url":"https://github.com/liushuigs/cavat.git","svn_url":"https://github.com/liushuigs/cavat","homepage":null,"size":30,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/liushuigs/cavat/pulls/10"},"html":{"href":"https://github.com/liushuigs/cavat/pull/10"},"issue":{"href":"https://api.github.com/repos/liushuigs/cavat/issues/10"},"comments":{"href":"https://api.github.com/repos/liushuigs/cavat/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/liushuigs/cavat/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/liushuigs/cavat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/liushuigs/cavat/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/liushuigs/cavat/statuses/5d908f868df796357c3ec1fa80adecf0f30f8bb6"}}}}