{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/33408057","id":33408057,"diff_hunk":"@@ -14,22 +14,21 @@\n            'new_figure_manager', 'backend_version']\n \n backend = matplotlib.get_backend() # validates, to match all_backends\n+if backend.startswith('module://'):\n+    backend_name = backend[9:]\n+else:\n+    backend_name = 'matplotlib.backends.backend_' + backend.lower()\n \n-def pylab_setup():\n-    'return new_figure_manager, draw_if_interactive and show for pylab'\n+def get_backend():","path":"lib/matplotlib/backends/__init__.py","position":11,"original_position":11,"commit_id":"4e799010e8e438f4002ab925af078bc381fee9f7","original_commit_id":"df0931d4a25481be08283b40a48f12ce6577bcb1","user":{"login":"OceanWolf","id":3758703,"avatar_url":"https://avatars.githubusercontent.com/u/3758703?v=3","gravatar_id":"","url":"https://api.github.com/users/OceanWolf","html_url":"https://github.com/OceanWolf","followers_url":"https://api.github.com/users/OceanWolf/followers","following_url":"https://api.github.com/users/OceanWolf/following{/other_user}","gists_url":"https://api.github.com/users/OceanWolf/gists{/gist_id}","starred_url":"https://api.github.com/users/OceanWolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OceanWolf/subscriptions","organizations_url":"https://api.github.com/users/OceanWolf/orgs","repos_url":"https://api.github.com/users/OceanWolf/repos","events_url":"https://api.github.com/users/OceanWolf/events{/privacy}","received_events_url":"https://api.github.com/users/OceanWolf/received_events","type":"User","site_admin":false},"body":"I don't fully understand the difference between ``matplotlib.use`` and ``matplotlib.pyplot.swtich_backend``, I think for now we could make ``matplotlib.backends.get_backend`` a private method and leave the rest of the discussion for a later PR?","created_at":"2015-06-27T01:48:13Z","updated_at":"2015-06-27T01:48:13Z","html_url":"https://github.com/matplotlib/matplotlib/pull/4143#discussion_r33408057","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4143","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/33408057"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/4143#discussion_r33408057"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4143"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4143","id":29763186,"html_url":"https://github.com/matplotlib/matplotlib/pull/4143","diff_url":"https://github.com/matplotlib/matplotlib/pull/4143.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/4143.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4143","number":4143,"state":"open","locked":false,"title":"MEP27 Decouple pyplot from backends (refactoring Gcf out of backend code)","user":{"login":"OceanWolf","id":3758703,"avatar_url":"https://avatars.githubusercontent.com/u/3758703?v=3","gravatar_id":"","url":"https://api.github.com/users/OceanWolf","html_url":"https://github.com/OceanWolf","followers_url":"https://api.github.com/users/OceanWolf/followers","following_url":"https://api.github.com/users/OceanWolf/following{/other_user}","gists_url":"https://api.github.com/users/OceanWolf/gists{/gist_id}","starred_url":"https://api.github.com/users/OceanWolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OceanWolf/subscriptions","organizations_url":"https://api.github.com/users/OceanWolf/orgs","repos_url":"https://api.github.com/users/OceanWolf/repos","events_url":"https://api.github.com/users/OceanWolf/events{/privacy}","received_events_url":"https://api.github.com/users/OceanWolf/received_events","type":"User","site_admin":false},"body":"**TODO Before Merge** Merge https://github.com/OceanWolf/matplotlib/pull/4 into this branch\r\n\r\nThis PR exists as an alternative to https://github.com/matplotlib/matplotlib/pull/2624\r\n\r\nSee https://github.com/OceanWolf/matplotlib/blob/backend-refactor/doc/devel/MEP/MEP27.rst for details.\r\n\r\nTl;dr:\r\n``FigureManagerBase`` :arrow_right: ``FigureManager`` + ``WindowBase``\r\n``ShowBase`` :arrow_right: ``Gcf.show_all`` + ``MainLoopBase``\r\n\r\nThe main refactor (+gtk3 as an example) goes here, and will have no effect on the individual backends, work for other backends will occur in separate branches as indicated.\r\n\r\n- [ ] ``MacOSX``\r\n- [ ] ``CocoaAgg``\r\n- [ ] ``GTK``\r\n  - [ ] ``GTKCairo``\r\n  - [ ] ``GTKAgg``\r\n- [ ] ``NbAgg``\r\n- [x] ``WebAgg``  https://github.com/OceanWolf/matplotlib/compare/backend-refactor...OceanWolf:backend-refactor-webagg (still W-I-P, but will deal with last items in its PR)\r\n- [x] ``Wx`` https://github.com/OceanWolf/matplotlib/compare/backend-refactor...backend-refactor-wx\r\n  - [x] ``WxAgg``\r\n- [x] ``Qt`` https://github.com/OceanWolf/matplotlib/compare/backend-refactor...OceanWolf:backend-refactor-qt\r\n  - [x] ``Qt4Agg``\r\n  - [x] ``Qt5Agg``\r\n- [x] ``TkAgg`` https://github.com/OceanWolf/matplotlib/compare/backend-refactor...OceanWolf:backend-refactor-tkagg\r\n  - [ ] Remove tools.SaveFigureBase\r\n- [x] ``GTK3`` in this branch\r\n  - [x] ``GTK3Cairo``\r\n  - [x] ``GTK3Agg``\r\n\r\nTo accomplish this, we shall do this in two passes:\r\n1. The first pass we refactor out all generic backend code out of the ``gtk3`` backend, replacing these with common methods, i.e. we refactor out ``Gcf`` to ``backend_bases.py``.\r\n2. The second pass we then refactor ``Gcf``  out from ``backend_bases.py``.\r\n3. Other backends in separate branches, see list above for progress and make changes to this PR for global changes (none since the 2nd backend).","created_at":"2015-02-22T00:40:12Z","updated_at":"2015-06-27T01:48:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8fec6a42a6e19521880e8716952770bf64dad2f","assignee":{"login":"OceanWolf","id":3758703,"avatar_url":"https://avatars.githubusercontent.com/u/3758703?v=3","gravatar_id":"","url":"https://api.github.com/users/OceanWolf","html_url":"https://github.com/OceanWolf","followers_url":"https://api.github.com/users/OceanWolf/followers","following_url":"https://api.github.com/users/OceanWolf/following{/other_user}","gists_url":"https://api.github.com/users/OceanWolf/gists{/gist_id}","starred_url":"https://api.github.com/users/OceanWolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OceanWolf/subscriptions","organizations_url":"https://api.github.com/users/OceanWolf/orgs","repos_url":"https://api.github.com/users/OceanWolf/repos","events_url":"https://api.github.com/users/OceanWolf/events{/privacy}","received_events_url":"https://api.github.com/users/OceanWolf/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/18","html_url":"https://github.com/matplotlib/matplotlib/milestones/next%20point%20release","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/18/labels","id":970105,"number":18,"title":"next point release","description":"Next minor release.","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":159,"closed_issues":190,"state":"open","created_at":"2015-02-07T21:22:30Z","updated_at":"2015-06-26T21:18:42Z","due_on":"2015-07-06T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4143/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4143/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/4143/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/4e799010e8e438f4002ab925af078bc381fee9f7","head":{"label":"OceanWolf:backend-refactor","ref":"backend-refactor","sha":"4e799010e8e438f4002ab925af078bc381fee9f7","user":{"login":"OceanWolf","id":3758703,"avatar_url":"https://avatars.githubusercontent.com/u/3758703?v=3","gravatar_id":"","url":"https://api.github.com/users/OceanWolf","html_url":"https://github.com/OceanWolf","followers_url":"https://api.github.com/users/OceanWolf/followers","following_url":"https://api.github.com/users/OceanWolf/following{/other_user}","gists_url":"https://api.github.com/users/OceanWolf/gists{/gist_id}","starred_url":"https://api.github.com/users/OceanWolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OceanWolf/subscriptions","organizations_url":"https://api.github.com/users/OceanWolf/orgs","repos_url":"https://api.github.com/users/OceanWolf/repos","events_url":"https://api.github.com/users/OceanWolf/events{/privacy}","received_events_url":"https://api.github.com/users/OceanWolf/received_events","type":"User","site_admin":false},"repo":{"id":22261480,"name":"matplotlib","full_name":"OceanWolf/matplotlib","owner":{"login":"OceanWolf","id":3758703,"avatar_url":"https://avatars.githubusercontent.com/u/3758703?v=3","gravatar_id":"","url":"https://api.github.com/users/OceanWolf","html_url":"https://github.com/OceanWolf","followers_url":"https://api.github.com/users/OceanWolf/followers","following_url":"https://api.github.com/users/OceanWolf/following{/other_user}","gists_url":"https://api.github.com/users/OceanWolf/gists{/gist_id}","starred_url":"https://api.github.com/users/OceanWolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OceanWolf/subscriptions","organizations_url":"https://api.github.com/users/OceanWolf/orgs","repos_url":"https://api.github.com/users/OceanWolf/repos","events_url":"https://api.github.com/users/OceanWolf/events{/privacy}","received_events_url":"https://api.github.com/users/OceanWolf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OceanWolf/matplotlib","description":"matplotlib: plotting with Python","fork":true,"url":"https://api.github.com/repos/OceanWolf/matplotlib","forks_url":"https://api.github.com/repos/OceanWolf/matplotlib/forks","keys_url":"https://api.github.com/repos/OceanWolf/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OceanWolf/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OceanWolf/matplotlib/teams","hooks_url":"https://api.github.com/repos/OceanWolf/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/OceanWolf/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/OceanWolf/matplotlib/events","assignees_url":"https://api.github.com/repos/OceanWolf/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/OceanWolf/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/OceanWolf/matplotlib/tags","blobs_url":"https://api.github.com/repos/OceanWolf/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OceanWolf/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OceanWolf/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/OceanWolf/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OceanWolf/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/OceanWolf/matplotlib/languages","stargazers_url":"https://api.github.com/repos/OceanWolf/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/OceanWolf/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/OceanWolf/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/OceanWolf/matplotlib/subscription","commits_url":"https://api.github.com/repos/OceanWolf/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/OceanWolf/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/OceanWolf/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/OceanWolf/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/OceanWolf/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/OceanWolf/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OceanWolf/matplotlib/merges","archive_url":"https://api.github.com/repos/OceanWolf/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OceanWolf/matplotlib/downloads","issues_url":"https://api.github.com/repos/OceanWolf/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/OceanWolf/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/OceanWolf/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/OceanWolf/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OceanWolf/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/OceanWolf/matplotlib/releases{/id}","created_at":"2014-07-25T15:25:52Z","updated_at":"2014-05-29T16:57:27Z","pushed_at":"2015-06-27T01:34:41Z","git_url":"git://github.com/OceanWolf/matplotlib.git","ssh_url":"git@github.com:OceanWolf/matplotlib.git","clone_url":"https://github.com/OceanWolf/matplotlib.git","svn_url":"https://github.com/OceanWolf/matplotlib","homepage":"http://matplotlib.org/","size":216307,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"42f09b6e223a1dff8df47261153bf5bb3e89a1b9","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","created_at":"2011-02-19T03:17:12Z","updated_at":"2015-06-26T06:55:28Z","pushed_at":"2015-06-27T01:34:45Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":266586,"stargazers_count":2602,"watchers_count":2602,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1330,"mirror_url":null,"open_issues_count":546,"forks":1330,"open_issues":546,"watchers":2602,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4143"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/4143"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/4143"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/4143/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4143/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/4143/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/4e799010e8e438f4002ab925af078bc381fee9f7"}}}}