{"action":"created","comment":{"url":"https://api.github.com/repos/sampsyo/beets/pulls/comments/23839641","id":23839641,"diff_hunk":"@@ -357,6 +357,13 @@ def human_seconds_short(interval):\n                 \"fuchsia\", \"turquoise\", \"white\"]\n RESET_COLOR = COLOR_ESCAPE + \"39;49;00m\"\n \n+# Map the color names to the configured colors in a dict\n+COLOR_NAMES = ['text_success', 'text_warning', 'text_error', 'text_highlight',\n+               'text_highlight_minor', 'action_default', 'action']\n+COLORS = dict(zip(COLOR_NAMES,\n+                  map(lambda x: config['ui']['colors'][x].get(str),\n+                      COLOR_NAMES)))","path":"beets/ui/__init__.py","position":27,"original_position":27,"commit_id":"f483012183b1f56456c2c7005a5fbf5244f63b5e","original_commit_id":"f483012183b1f56456c2c7005a5fbf5244f63b5e","user":{"login":"tomjaspers","id":1549375,"avatar_url":"https://avatars.githubusercontent.com/u/1549375?v=3","gravatar_id":"","url":"https://api.github.com/users/tomjaspers","html_url":"https://github.com/tomjaspers","followers_url":"https://api.github.com/users/tomjaspers/followers","following_url":"https://api.github.com/users/tomjaspers/following{/other_user}","gists_url":"https://api.github.com/users/tomjaspers/gists{/gist_id}","starred_url":"https://api.github.com/users/tomjaspers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomjaspers/subscriptions","organizations_url":"https://api.github.com/users/tomjaspers/orgs","repos_url":"https://api.github.com/users/tomjaspers/repos","events_url":"https://api.github.com/users/tomjaspers/events{/privacy}","received_events_url":"https://api.github.com/users/tomjaspers/received_events","type":"User","site_admin":false},"body":"Dictionary comprehension doesn't work in 2.6 though. But yes, I'll make make sure `COLORS` only gets computed once in that way, thanks. I'll merge this in a bit.","created_at":"2015-01-30T12:38:52Z","updated_at":"2015-01-30T12:38:52Z","html_url":"https://github.com/sampsyo/beets/pull/1281#discussion_r23839641","pull_request_url":"https://api.github.com/repos/sampsyo/beets/pulls/1281","_links":{"self":{"href":"https://api.github.com/repos/sampsyo/beets/pulls/comments/23839641"},"html":{"href":"https://github.com/sampsyo/beets/pull/1281#discussion_r23839641"},"pull_request":{"href":"https://api.github.com/repos/sampsyo/beets/pulls/1281"}}},"pull_request":{"url":"https://api.github.com/repos/sampsyo/beets/pulls/1281","id":28279418,"html_url":"https://github.com/sampsyo/beets/pull/1281","diff_url":"https://github.com/sampsyo/beets/pull/1281.diff","patch_url":"https://github.com/sampsyo/beets/pull/1281.patch","issue_url":"https://api.github.com/repos/sampsyo/beets/issues/1281","number":1281,"state":"open","locked":false,"title":"Colors are user configurable","user":{"login":"tomjaspers","id":1549375,"avatar_url":"https://avatars.githubusercontent.com/u/1549375?v=3","gravatar_id":"","url":"https://api.github.com/users/tomjaspers","html_url":"https://github.com/tomjaspers","followers_url":"https://api.github.com/users/tomjaspers/followers","following_url":"https://api.github.com/users/tomjaspers/following{/other_user}","gists_url":"https://api.github.com/users/tomjaspers/gists{/gist_id}","starred_url":"https://api.github.com/users/tomjaspers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomjaspers/subscriptions","organizations_url":"https://api.github.com/users/tomjaspers/orgs","repos_url":"https://api.github.com/users/tomjaspers/repos","events_url":"https://api.github.com/users/tomjaspers/events{/privacy}","received_events_url":"https://api.github.com/users/tomjaspers/received_events","type":"User","site_admin":false},"body":"- Add `colors` option under `ui` option to allow users to choose their own color scheme\r\n- Config option `color` is now nested under `ui` (moved from top-level). A deprecation warning is shown if top-level `color` configuration is used (but it will be respected)\r\n- Documentation has been updated *(not sure if its clear enough though?)*\r\n- The method `colorize` is to be called with an abstract color_name, e.g., `colorize('text_success', 'hello world')`. It can still take an actual color (e.g., 'red'), just in case there are some 3rd party plugins counting on this (no idea if this is the case).\r\n\r\nThese are all the abstract color names (and their defaults) that a user can configure:\r\n\r\n```yaml\r\nui:\r\n  color: yes\r\n  colors:\r\n    text_success: green\r\n    text_warning: yellow\r\n    text_error: red\r\n    text_highlight: red\r\n    text_highlight_minor: lightgray\r\n    action_default: turquoise\r\n    action: blue\r\n```\r\nSee #1238 ","created_at":"2015-01-29T13:46:26Z","updated_at":"2015-01-30T12:38:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sampsyo/beets/pulls/1281/commits","review_comments_url":"https://api.github.com/repos/sampsyo/beets/pulls/1281/comments","review_comment_url":"https://api.github.com/repos/sampsyo/beets/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sampsyo/beets/issues/1281/comments","statuses_url":"https://api.github.com/repos/sampsyo/beets/statuses/f483012183b1f56456c2c7005a5fbf5244f63b5e","head":{"label":"tomjaspers:configurable-colors","ref":"configurable-colors","sha":"f483012183b1f56456c2c7005a5fbf5244f63b5e","user":{"login":"tomjaspers","id":1549375,"avatar_url":"https://avatars.githubusercontent.com/u/1549375?v=3","gravatar_id":"","url":"https://api.github.com/users/tomjaspers","html_url":"https://github.com/tomjaspers","followers_url":"https://api.github.com/users/tomjaspers/followers","following_url":"https://api.github.com/users/tomjaspers/following{/other_user}","gists_url":"https://api.github.com/users/tomjaspers/gists{/gist_id}","starred_url":"https://api.github.com/users/tomjaspers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomjaspers/subscriptions","organizations_url":"https://api.github.com/users/tomjaspers/orgs","repos_url":"https://api.github.com/users/tomjaspers/repos","events_url":"https://api.github.com/users/tomjaspers/events{/privacy}","received_events_url":"https://api.github.com/users/tomjaspers/received_events","type":"User","site_admin":false},"repo":{"id":28516119,"name":"beets","full_name":"tomjaspers/beets","owner":{"login":"tomjaspers","id":1549375,"avatar_url":"https://avatars.githubusercontent.com/u/1549375?v=3","gravatar_id":"","url":"https://api.github.com/users/tomjaspers","html_url":"https://github.com/tomjaspers","followers_url":"https://api.github.com/users/tomjaspers/followers","following_url":"https://api.github.com/users/tomjaspers/following{/other_user}","gists_url":"https://api.github.com/users/tomjaspers/gists{/gist_id}","starred_url":"https://api.github.com/users/tomjaspers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomjaspers/subscriptions","organizations_url":"https://api.github.com/users/tomjaspers/orgs","repos_url":"https://api.github.com/users/tomjaspers/repos","events_url":"https://api.github.com/users/tomjaspers/events{/privacy}","received_events_url":"https://api.github.com/users/tomjaspers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomjaspers/beets","description":"music library manager and MusicBrainz tagger","fork":true,"url":"https://api.github.com/repos/tomjaspers/beets","forks_url":"https://api.github.com/repos/tomjaspers/beets/forks","keys_url":"https://api.github.com/repos/tomjaspers/beets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomjaspers/beets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomjaspers/beets/teams","hooks_url":"https://api.github.com/repos/tomjaspers/beets/hooks","issue_events_url":"https://api.github.com/repos/tomjaspers/beets/issues/events{/number}","events_url":"https://api.github.com/repos/tomjaspers/beets/events","assignees_url":"https://api.github.com/repos/tomjaspers/beets/assignees{/user}","branches_url":"https://api.github.com/repos/tomjaspers/beets/branches{/branch}","tags_url":"https://api.github.com/repos/tomjaspers/beets/tags","blobs_url":"https://api.github.com/repos/tomjaspers/beets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomjaspers/beets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomjaspers/beets/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomjaspers/beets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomjaspers/beets/statuses/{sha}","languages_url":"https://api.github.com/repos/tomjaspers/beets/languages","stargazers_url":"https://api.github.com/repos/tomjaspers/beets/stargazers","contributors_url":"https://api.github.com/repos/tomjaspers/beets/contributors","subscribers_url":"https://api.github.com/repos/tomjaspers/beets/subscribers","subscription_url":"https://api.github.com/repos/tomjaspers/beets/subscription","commits_url":"https://api.github.com/repos/tomjaspers/beets/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomjaspers/beets/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomjaspers/beets/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomjaspers/beets/issues/comments/{number}","contents_url":"https://api.github.com/repos/tomjaspers/beets/contents/{+path}","compare_url":"https://api.github.com/repos/tomjaspers/beets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomjaspers/beets/merges","archive_url":"https://api.github.com/repos/tomjaspers/beets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomjaspers/beets/downloads","issues_url":"https://api.github.com/repos/tomjaspers/beets/issues{/number}","pulls_url":"https://api.github.com/repos/tomjaspers/beets/pulls{/number}","milestones_url":"https://api.github.com/repos/tomjaspers/beets/milestones{/number}","notifications_url":"https://api.github.com/repos/tomjaspers/beets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomjaspers/beets/labels{/name}","releases_url":"https://api.github.com/repos/tomjaspers/beets/releases{/id}","created_at":"2014-12-26T16:58:52Z","updated_at":"2015-01-26T21:19:34Z","pushed_at":"2015-01-29T13:36:32Z","git_url":"git://github.com/tomjaspers/beets.git","ssh_url":"git@github.com:tomjaspers/beets.git","clone_url":"https://github.com/tomjaspers/beets.git","svn_url":"https://github.com/tomjaspers/beets","homepage":"http://beets.radbox.org/","size":14556,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sampsyo:master","ref":"master","sha":"fc82f2bb894e368fbf31ac9baf9a4bfe4d16530e","user":{"login":"sampsyo","id":188033,"avatar_url":"https://avatars.githubusercontent.com/u/188033?v=3","gravatar_id":"","url":"https://api.github.com/users/sampsyo","html_url":"https://github.com/sampsyo","followers_url":"https://api.github.com/users/sampsyo/followers","following_url":"https://api.github.com/users/sampsyo/following{/other_user}","gists_url":"https://api.github.com/users/sampsyo/gists{/gist_id}","starred_url":"https://api.github.com/users/sampsyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sampsyo/subscriptions","organizations_url":"https://api.github.com/users/sampsyo/orgs","repos_url":"https://api.github.com/users/sampsyo/repos","events_url":"https://api.github.com/users/sampsyo/events{/privacy}","received_events_url":"https://api.github.com/users/sampsyo/received_events","type":"User","site_admin":false},"repo":{"id":827590,"name":"beets","full_name":"sampsyo/beets","owner":{"login":"sampsyo","id":188033,"avatar_url":"https://avatars.githubusercontent.com/u/188033?v=3","gravatar_id":"","url":"https://api.github.com/users/sampsyo","html_url":"https://github.com/sampsyo","followers_url":"https://api.github.com/users/sampsyo/followers","following_url":"https://api.github.com/users/sampsyo/following{/other_user}","gists_url":"https://api.github.com/users/sampsyo/gists{/gist_id}","starred_url":"https://api.github.com/users/sampsyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sampsyo/subscriptions","organizations_url":"https://api.github.com/users/sampsyo/orgs","repos_url":"https://api.github.com/users/sampsyo/repos","events_url":"https://api.github.com/users/sampsyo/events{/privacy}","received_events_url":"https://api.github.com/users/sampsyo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sampsyo/beets","description":"music library manager and MusicBrainz tagger","fork":false,"url":"https://api.github.com/repos/sampsyo/beets","forks_url":"https://api.github.com/repos/sampsyo/beets/forks","keys_url":"https://api.github.com/repos/sampsyo/beets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sampsyo/beets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sampsyo/beets/teams","hooks_url":"https://api.github.com/repos/sampsyo/beets/hooks","issue_events_url":"https://api.github.com/repos/sampsyo/beets/issues/events{/number}","events_url":"https://api.github.com/repos/sampsyo/beets/events","assignees_url":"https://api.github.com/repos/sampsyo/beets/assignees{/user}","branches_url":"https://api.github.com/repos/sampsyo/beets/branches{/branch}","tags_url":"https://api.github.com/repos/sampsyo/beets/tags","blobs_url":"https://api.github.com/repos/sampsyo/beets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sampsyo/beets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sampsyo/beets/git/refs{/sha}","trees_url":"https://api.github.com/repos/sampsyo/beets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sampsyo/beets/statuses/{sha}","languages_url":"https://api.github.com/repos/sampsyo/beets/languages","stargazers_url":"https://api.github.com/repos/sampsyo/beets/stargazers","contributors_url":"https://api.github.com/repos/sampsyo/beets/contributors","subscribers_url":"https://api.github.com/repos/sampsyo/beets/subscribers","subscription_url":"https://api.github.com/repos/sampsyo/beets/subscription","commits_url":"https://api.github.com/repos/sampsyo/beets/commits{/sha}","git_commits_url":"https://api.github.com/repos/sampsyo/beets/git/commits{/sha}","comments_url":"https://api.github.com/repos/sampsyo/beets/comments{/number}","issue_comment_url":"https://api.github.com/repos/sampsyo/beets/issues/comments/{number}","contents_url":"https://api.github.com/repos/sampsyo/beets/contents/{+path}","compare_url":"https://api.github.com/repos/sampsyo/beets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sampsyo/beets/merges","archive_url":"https://api.github.com/repos/sampsyo/beets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sampsyo/beets/downloads","issues_url":"https://api.github.com/repos/sampsyo/beets/issues{/number}","pulls_url":"https://api.github.com/repos/sampsyo/beets/pulls{/number}","milestones_url":"https://api.github.com/repos/sampsyo/beets/milestones{/number}","notifications_url":"https://api.github.com/repos/sampsyo/beets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sampsyo/beets/labels{/name}","releases_url":"https://api.github.com/repos/sampsyo/beets/releases{/id}","created_at":"2010-08-09T23:17:20Z","updated_at":"2015-01-30T05:56:45Z","pushed_at":"2015-01-28T19:44:12Z","git_url":"git://github.com/sampsyo/beets.git","ssh_url":"git@github.com:sampsyo/beets.git","clone_url":"https://github.com/sampsyo/beets.git","svn_url":"https://github.com/sampsyo/beets","homepage":"http://beets.radbox.org/","size":23298,"stargazers_count":3630,"watchers_count":3630,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":551,"mirror_url":null,"open_issues_count":279,"forks":551,"open_issues":279,"watchers":3630,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sampsyo/beets/pulls/1281"},"html":{"href":"https://github.com/sampsyo/beets/pull/1281"},"issue":{"href":"https://api.github.com/repos/sampsyo/beets/issues/1281"},"comments":{"href":"https://api.github.com/repos/sampsyo/beets/issues/1281/comments"},"review_comments":{"href":"https://api.github.com/repos/sampsyo/beets/pulls/1281/comments"},"review_comment":{"href":"https://api.github.com/repos/sampsyo/beets/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sampsyo/beets/pulls/1281/commits"},"statuses":{"href":"https://api.github.com/repos/sampsyo/beets/statuses/f483012183b1f56456c2c7005a5fbf5244f63b5e"}}}}