{"action":"created","comment":{"url":"https://api.github.com/repos/dbcli/mycli/pulls/comments/36268886","id":36268886,"diff_hunk":"@@ -166,11 +170,16 @@ def read_my_cnf_files(self, files, keys):\n                 cnf.merge(e.config)\n                 pass\n \n+        sections = ['client']\n+        if self.defaults_suffix:\n+            sections.append('client{0}'.format(self.defaults_suffix))\n+\n         def get(key):\n-            try:\n-                return cnf['client'][key]\n-            except KeyError:\n-                return None\n+            result = None\n+            for sect in sections:\n+                if sect in cnf and key in cnf[sect]:\n+                    result = cnf[sect][key]","path":"mycli/main.py","position":56,"original_position":56,"commit_id":"24651d4ee5d3a3bd42d7e2b094e777276d3d1ac9","original_commit_id":"24651d4ee5d3a3bd42d7e2b094e777276d3d1ac9","user":{"login":"amjith","id":49260,"avatar_url":"https://avatars.githubusercontent.com/u/49260?v=3","gravatar_id":"","url":"https://api.github.com/users/amjith","html_url":"https://github.com/amjith","followers_url":"https://api.github.com/users/amjith/followers","following_url":"https://api.github.com/users/amjith/following{/other_user}","gists_url":"https://api.github.com/users/amjith/gists{/gist_id}","starred_url":"https://api.github.com/users/amjith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amjith/subscriptions","organizations_url":"https://api.github.com/users/amjith/orgs","repos_url":"https://api.github.com/users/amjith/repos","events_url":"https://api.github.com/users/amjith/events{/privacy}","received_events_url":"https://api.github.com/users/amjith/received_events","type":"User","site_admin":false},"body":"Should this have an early return inside the for loop so it returns as soon as the key is found? ","created_at":"2015-08-05T04:39:16Z","updated_at":"2015-08-05T04:39:16Z","html_url":"https://github.com/dbcli/mycli/pull/116#discussion_r36268886","pull_request_url":"https://api.github.com/repos/dbcli/mycli/pulls/116","_links":{"self":{"href":"https://api.github.com/repos/dbcli/mycli/pulls/comments/36268886"},"html":{"href":"https://github.com/dbcli/mycli/pull/116#discussion_r36268886"},"pull_request":{"href":"https://api.github.com/repos/dbcli/mycli/pulls/116"}}},"pull_request":{"url":"https://api.github.com/repos/dbcli/mycli/pulls/116","id":41595999,"html_url":"https://github.com/dbcli/mycli/pull/116","diff_url":"https://github.com/dbcli/mycli/pull/116.diff","patch_url":"https://github.com/dbcli/mycli/pull/116.patch","issue_url":"https://api.github.com/repos/dbcli/mycli/issues/116","number":116,"state":"open","locked":false,"title":"Defaults group suffix","user":{"login":"j-bennet","id":637013,"avatar_url":"https://avatars.githubusercontent.com/u/637013?v=3","gravatar_id":"","url":"https://api.github.com/users/j-bennet","html_url":"https://github.com/j-bennet","followers_url":"https://api.github.com/users/j-bennet/followers","following_url":"https://api.github.com/users/j-bennet/following{/other_user}","gists_url":"https://api.github.com/users/j-bennet/gists{/gist_id}","starred_url":"https://api.github.com/users/j-bennet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-bennet/subscriptions","organizations_url":"https://api.github.com/users/j-bennet/orgs","repos_url":"https://api.github.com/users/j-bennet/repos","events_url":"https://api.github.com/users/j-bennet/events{/privacy}","received_events_url":"https://api.github.com/users/j-bennet/received_events","type":"User","site_admin":false},"body":"This addresses issue #95.","created_at":"2015-08-04T17:35:43Z","updated_at":"2015-08-05T04:39:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b66a1343911cdffb9e8ca119b484aa380972906e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dbcli/mycli/pulls/116/commits","review_comments_url":"https://api.github.com/repos/dbcli/mycli/pulls/116/comments","review_comment_url":"https://api.github.com/repos/dbcli/mycli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dbcli/mycli/issues/116/comments","statuses_url":"https://api.github.com/repos/dbcli/mycli/statuses/24651d4ee5d3a3bd42d7e2b094e777276d3d1ac9","head":{"label":"j-bennet:defaults-group-suffix","ref":"defaults-group-suffix","sha":"24651d4ee5d3a3bd42d7e2b094e777276d3d1ac9","user":{"login":"j-bennet","id":637013,"avatar_url":"https://avatars.githubusercontent.com/u/637013?v=3","gravatar_id":"","url":"https://api.github.com/users/j-bennet","html_url":"https://github.com/j-bennet","followers_url":"https://api.github.com/users/j-bennet/followers","following_url":"https://api.github.com/users/j-bennet/following{/other_user}","gists_url":"https://api.github.com/users/j-bennet/gists{/gist_id}","starred_url":"https://api.github.com/users/j-bennet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-bennet/subscriptions","organizations_url":"https://api.github.com/users/j-bennet/orgs","repos_url":"https://api.github.com/users/j-bennet/repos","events_url":"https://api.github.com/users/j-bennet/events{/privacy}","received_events_url":"https://api.github.com/users/j-bennet/received_events","type":"User","site_admin":false},"repo":{"id":40037432,"name":"mycli","full_name":"j-bennet/mycli","owner":{"login":"j-bennet","id":637013,"avatar_url":"https://avatars.githubusercontent.com/u/637013?v=3","gravatar_id":"","url":"https://api.github.com/users/j-bennet","html_url":"https://github.com/j-bennet","followers_url":"https://api.github.com/users/j-bennet/followers","following_url":"https://api.github.com/users/j-bennet/following{/other_user}","gists_url":"https://api.github.com/users/j-bennet/gists{/gist_id}","starred_url":"https://api.github.com/users/j-bennet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-bennet/subscriptions","organizations_url":"https://api.github.com/users/j-bennet/orgs","repos_url":"https://api.github.com/users/j-bennet/repos","events_url":"https://api.github.com/users/j-bennet/events{/privacy}","received_events_url":"https://api.github.com/users/j-bennet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/j-bennet/mycli","description":"A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.","fork":true,"url":"https://api.github.com/repos/j-bennet/mycli","forks_url":"https://api.github.com/repos/j-bennet/mycli/forks","keys_url":"https://api.github.com/repos/j-bennet/mycli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/j-bennet/mycli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/j-bennet/mycli/teams","hooks_url":"https://api.github.com/repos/j-bennet/mycli/hooks","issue_events_url":"https://api.github.com/repos/j-bennet/mycli/issues/events{/number}","events_url":"https://api.github.com/repos/j-bennet/mycli/events","assignees_url":"https://api.github.com/repos/j-bennet/mycli/assignees{/user}","branches_url":"https://api.github.com/repos/j-bennet/mycli/branches{/branch}","tags_url":"https://api.github.com/repos/j-bennet/mycli/tags","blobs_url":"https://api.github.com/repos/j-bennet/mycli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/j-bennet/mycli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/j-bennet/mycli/git/refs{/sha}","trees_url":"https://api.github.com/repos/j-bennet/mycli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/j-bennet/mycli/statuses/{sha}","languages_url":"https://api.github.com/repos/j-bennet/mycli/languages","stargazers_url":"https://api.github.com/repos/j-bennet/mycli/stargazers","contributors_url":"https://api.github.com/repos/j-bennet/mycli/contributors","subscribers_url":"https://api.github.com/repos/j-bennet/mycli/subscribers","subscription_url":"https://api.github.com/repos/j-bennet/mycli/subscription","commits_url":"https://api.github.com/repos/j-bennet/mycli/commits{/sha}","git_commits_url":"https://api.github.com/repos/j-bennet/mycli/git/commits{/sha}","comments_url":"https://api.github.com/repos/j-bennet/mycli/comments{/number}","issue_comment_url":"https://api.github.com/repos/j-bennet/mycli/issues/comments{/number}","contents_url":"https://api.github.com/repos/j-bennet/mycli/contents/{+path}","compare_url":"https://api.github.com/repos/j-bennet/mycli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/j-bennet/mycli/merges","archive_url":"https://api.github.com/repos/j-bennet/mycli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/j-bennet/mycli/downloads","issues_url":"https://api.github.com/repos/j-bennet/mycli/issues{/number}","pulls_url":"https://api.github.com/repos/j-bennet/mycli/pulls{/number}","milestones_url":"https://api.github.com/repos/j-bennet/mycli/milestones{/number}","notifications_url":"https://api.github.com/repos/j-bennet/mycli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/j-bennet/mycli/labels{/name}","releases_url":"https://api.github.com/repos/j-bennet/mycli/releases{/id}","created_at":"2015-08-01T06:15:52Z","updated_at":"2015-08-01T06:15:53Z","pushed_at":"2015-08-04T17:32:21Z","git_url":"git://github.com/j-bennet/mycli.git","ssh_url":"git@github.com:j-bennet/mycli.git","clone_url":"https://github.com/j-bennet/mycli.git","svn_url":"https://github.com/j-bennet/mycli","homepage":"","size":620,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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":"dbcli:master","ref":"master","sha":"214ade39e83607563559ec975c2f3fb0b12c511f","user":{"login":"dbcli","id":11810727,"avatar_url":"https://avatars.githubusercontent.com/u/11810727?v=3","gravatar_id":"","url":"https://api.github.com/users/dbcli","html_url":"https://github.com/dbcli","followers_url":"https://api.github.com/users/dbcli/followers","following_url":"https://api.github.com/users/dbcli/following{/other_user}","gists_url":"https://api.github.com/users/dbcli/gists{/gist_id}","starred_url":"https://api.github.com/users/dbcli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbcli/subscriptions","organizations_url":"https://api.github.com/users/dbcli/orgs","repos_url":"https://api.github.com/users/dbcli/repos","events_url":"https://api.github.com/users/dbcli/events{/privacy}","received_events_url":"https://api.github.com/users/dbcli/received_events","type":"Organization","site_admin":false},"repo":{"id":33457642,"name":"mycli","full_name":"dbcli/mycli","owner":{"login":"dbcli","id":11810727,"avatar_url":"https://avatars.githubusercontent.com/u/11810727?v=3","gravatar_id":"","url":"https://api.github.com/users/dbcli","html_url":"https://github.com/dbcli","followers_url":"https://api.github.com/users/dbcli/followers","following_url":"https://api.github.com/users/dbcli/following{/other_user}","gists_url":"https://api.github.com/users/dbcli/gists{/gist_id}","starred_url":"https://api.github.com/users/dbcli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbcli/subscriptions","organizations_url":"https://api.github.com/users/dbcli/orgs","repos_url":"https://api.github.com/users/dbcli/repos","events_url":"https://api.github.com/users/dbcli/events{/privacy}","received_events_url":"https://api.github.com/users/dbcli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dbcli/mycli","description":"A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.","fork":false,"url":"https://api.github.com/repos/dbcli/mycli","forks_url":"https://api.github.com/repos/dbcli/mycli/forks","keys_url":"https://api.github.com/repos/dbcli/mycli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dbcli/mycli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dbcli/mycli/teams","hooks_url":"https://api.github.com/repos/dbcli/mycli/hooks","issue_events_url":"https://api.github.com/repos/dbcli/mycli/issues/events{/number}","events_url":"https://api.github.com/repos/dbcli/mycli/events","assignees_url":"https://api.github.com/repos/dbcli/mycli/assignees{/user}","branches_url":"https://api.github.com/repos/dbcli/mycli/branches{/branch}","tags_url":"https://api.github.com/repos/dbcli/mycli/tags","blobs_url":"https://api.github.com/repos/dbcli/mycli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dbcli/mycli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dbcli/mycli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dbcli/mycli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dbcli/mycli/statuses/{sha}","languages_url":"https://api.github.com/repos/dbcli/mycli/languages","stargazers_url":"https://api.github.com/repos/dbcli/mycli/stargazers","contributors_url":"https://api.github.com/repos/dbcli/mycli/contributors","subscribers_url":"https://api.github.com/repos/dbcli/mycli/subscribers","subscription_url":"https://api.github.com/repos/dbcli/mycli/subscription","commits_url":"https://api.github.com/repos/dbcli/mycli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dbcli/mycli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dbcli/mycli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dbcli/mycli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dbcli/mycli/contents/{+path}","compare_url":"https://api.github.com/repos/dbcli/mycli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dbcli/mycli/merges","archive_url":"https://api.github.com/repos/dbcli/mycli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dbcli/mycli/downloads","issues_url":"https://api.github.com/repos/dbcli/mycli/issues{/number}","pulls_url":"https://api.github.com/repos/dbcli/mycli/pulls{/number}","milestones_url":"https://api.github.com/repos/dbcli/mycli/milestones{/number}","notifications_url":"https://api.github.com/repos/dbcli/mycli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dbcli/mycli/labels{/name}","releases_url":"https://api.github.com/repos/dbcli/mycli/releases{/id}","created_at":"2015-04-05T22:39:49Z","updated_at":"2015-08-05T04:35:55Z","pushed_at":"2015-08-05T04:13:22Z","git_url":"git://github.com/dbcli/mycli.git","ssh_url":"git@github.com:dbcli/mycli.git","clone_url":"https://github.com/dbcli/mycli.git","svn_url":"https://github.com/dbcli/mycli","homepage":"","size":1118,"stargazers_count":1456,"watchers_count":1456,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":29,"forks":59,"open_issues":29,"watchers":1456,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dbcli/mycli/pulls/116"},"html":{"href":"https://github.com/dbcli/mycli/pull/116"},"issue":{"href":"https://api.github.com/repos/dbcli/mycli/issues/116"},"comments":{"href":"https://api.github.com/repos/dbcli/mycli/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/dbcli/mycli/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/dbcli/mycli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dbcli/mycli/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/dbcli/mycli/statuses/24651d4ee5d3a3bd42d7e2b094e777276d3d1ac9"}}}}