{"action":"opened","number":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":"Refactoring Gcf out of backend code (W-I-P)","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":"This PR exists as an alternative to https://github.com/matplotlib/matplotlib/pull/2624\r\n\r\nOkay, the plan here to refactor out ``_pylab_helpers``, which the backends use to get ``Gcf`` out of the backend code, because, ahem, it has nothing to do with the backends.\r\n\r\nTo accomplish this, we shall do this in two passes:\r\nThe first pass we refactor out all generic backend code out of ``matplotlib.backends.*``, replacing these with common methods, i.e. refactor out ``Gcf`` to ``backend_bases.py``.\r\nThe second pass we then refactor ``Gcf``  out from ``backend_bases.py``.\r\n\r\nTo accomplish this goal, we first recognise that by definition, the ``FigureManagerBase`` exists as a \"Helper class for pyplot mode, wraps everything up into a neat bundle\", and thus should not contain backend specific code.  This should like in the parts it wraps, namely the Canvas, the Toolbar, and the Window.\r\n\r\nTherefore we move all windowing code into a new class ``WindowBase``, and leave FigureManager to carry out its mission, dropping the ``Base`` as it no longer contains backend specific code.  In this PR we just focus on ``GTK3``.\r\n\r\nBecause ``FigureManager`` retains all of its methods, it *should* have no problem with backwards compatibility, and it also allows us to convert one backend at a time to refactor, not affecting other backends.  Atm I have left the old backend code in place, so that we can deprecate it in case anyone manually creates a ``FigureManagerGtk3`` instance.","created_at":"2015-02-22T00:40:12Z","updated_at":"2015-02-22T00:40:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":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/00a2252f7f438f75af14481e01095e2e9fa3c9f5","head":{"label":"OceanWolf:backend-refactor","ref":"backend-refactor","sha":"00a2252f7f438f75af14481e01095e2e9fa3c9f5","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-02-22T00:16:05Z","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":201433,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"1fe5b9c95d362a3902e5de532f86abd2accc8b6d","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-02-21T16:55:29Z","pushed_at":"2015-02-19T03:57:24Z","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":258230,"stargazers_count":2272,"watchers_count":2272,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1130,"mirror_url":null,"open_issues_count":457,"forks":1130,"open_issues":457,"watchers":2272,"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/00a2252f7f438f75af14481e01095e2e9fa3c9f5"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":245,"deletions":5,"changed_files":3}}