{"action":"opened","number":8773,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8773","id":126178825,"html_url":"https://github.com/matplotlib/matplotlib/pull/8773","diff_url":"https://github.com/matplotlib/matplotlib/pull/8773.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/8773.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8773","number":8773,"state":"open","locked":false,"title":"Backend class","user":{"login":"anntzer","id":1322974,"avatar_url":"https://avatars3.githubusercontent.com/u/1322974?v=3","gravatar_id":"","url":"https://api.github.com/users/anntzer","html_url":"https://github.com/anntzer","followers_url":"https://api.github.com/users/anntzer/followers","following_url":"https://api.github.com/users/anntzer/following{/other_user}","gists_url":"https://api.github.com/users/anntzer/gists{/gist_id}","starred_url":"https://api.github.com/users/anntzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anntzer/subscriptions","organizations_url":"https://api.github.com/users/anntzer/orgs","repos_url":"https://api.github.com/users/anntzer/repos","events_url":"https://api.github.com/users/anntzer/events{/privacy}","received_events_url":"https://api.github.com/users/anntzer/received_events","type":"User","site_admin":false},"body":"This is the second part of #8771, split out for simpler review (note that it also includes the first part, which is the object of #8772; thus, I would suggest specifically looking at the diff of the *last* commit).\r\n\r\nCurrently, backend modules need to define a number of classes (`FigureCanvas`, `FigureManager`) and functions (`new_figure_manager`, `new_figure_manager_given_figure`, `show`, `draw_if_interactive`) with specified names, which leads to some serious copy-pasting between the modules, as well as seemingly unused imports (see e.g. \"not used\" comment in backend_qt5agg.py).  Instead, use a class-based approach: the `_Backend` class can be subclassed to define these functions (and provides some templates for them); then a special decorator re-exports the attributes and methods of the `_Backend` class to the backend-defining module.","created_at":"2017-06-18T06:27:21Z","updated_at":"2017-06-18T06:27:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8773/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8773/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/8773/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/bf2977a0ed11edfe87f00bc9cbeb73bcfc73d3f4","head":{"label":"anntzer:backend-class","ref":"backend-class","sha":"bf2977a0ed11edfe87f00bc9cbeb73bcfc73d3f4","user":{"login":"anntzer","id":1322974,"avatar_url":"https://avatars3.githubusercontent.com/u/1322974?v=3","gravatar_id":"","url":"https://api.github.com/users/anntzer","html_url":"https://github.com/anntzer","followers_url":"https://api.github.com/users/anntzer/followers","following_url":"https://api.github.com/users/anntzer/following{/other_user}","gists_url":"https://api.github.com/users/anntzer/gists{/gist_id}","starred_url":"https://api.github.com/users/anntzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anntzer/subscriptions","organizations_url":"https://api.github.com/users/anntzer/orgs","repos_url":"https://api.github.com/users/anntzer/repos","events_url":"https://api.github.com/users/anntzer/events{/privacy}","received_events_url":"https://api.github.com/users/anntzer/received_events","type":"User","site_admin":false},"repo":{"id":7439715,"name":"matplotlib","full_name":"anntzer/matplotlib","owner":{"login":"anntzer","id":1322974,"avatar_url":"https://avatars3.githubusercontent.com/u/1322974?v=3","gravatar_id":"","url":"https://api.github.com/users/anntzer","html_url":"https://github.com/anntzer","followers_url":"https://api.github.com/users/anntzer/followers","following_url":"https://api.github.com/users/anntzer/following{/other_user}","gists_url":"https://api.github.com/users/anntzer/gists{/gist_id}","starred_url":"https://api.github.com/users/anntzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anntzer/subscriptions","organizations_url":"https://api.github.com/users/anntzer/orgs","repos_url":"https://api.github.com/users/anntzer/repos","events_url":"https://api.github.com/users/anntzer/events{/privacy}","received_events_url":"https://api.github.com/users/anntzer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anntzer/matplotlib","description":null,"fork":true,"url":"https://api.github.com/repos/anntzer/matplotlib","forks_url":"https://api.github.com/repos/anntzer/matplotlib/forks","keys_url":"https://api.github.com/repos/anntzer/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anntzer/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anntzer/matplotlib/teams","hooks_url":"https://api.github.com/repos/anntzer/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/anntzer/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/anntzer/matplotlib/events","assignees_url":"https://api.github.com/repos/anntzer/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/anntzer/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/anntzer/matplotlib/tags","blobs_url":"https://api.github.com/repos/anntzer/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anntzer/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anntzer/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/anntzer/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anntzer/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/anntzer/matplotlib/languages","stargazers_url":"https://api.github.com/repos/anntzer/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/anntzer/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/anntzer/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/anntzer/matplotlib/subscription","commits_url":"https://api.github.com/repos/anntzer/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/anntzer/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/anntzer/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/anntzer/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/anntzer/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/anntzer/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anntzer/matplotlib/merges","archive_url":"https://api.github.com/repos/anntzer/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anntzer/matplotlib/downloads","issues_url":"https://api.github.com/repos/anntzer/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/anntzer/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/anntzer/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/anntzer/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anntzer/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/anntzer/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/anntzer/matplotlib/deployments","created_at":"2013-01-04T12:08:11Z","updated_at":"2015-05-05T17:32:26Z","pushed_at":"2017-06-18T06:17:57Z","git_url":"git://github.com/anntzer/matplotlib.git","ssh_url":"git@github.com:anntzer/matplotlib.git","clone_url":"https://github.com/anntzer/matplotlib.git","svn_url":"https://github.com/anntzer/matplotlib","homepage":"","size":306801,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"6ff34d421ce11318fe56bcde6f0c72899118fe06","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars3.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://avatars3.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}","deployments_url":"https://api.github.com/repos/matplotlib/matplotlib/deployments","created_at":"2011-02-19T03:17:12Z","updated_at":"2017-06-18T05:31:29Z","pushed_at":"2017-06-18T06:21:13Z","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":306571,"stargazers_count":5408,"watchers_count":5408,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2613,"mirror_url":null,"open_issues_count":1216,"forks":2613,"open_issues":1216,"watchers":5408,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8773"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/8773"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/8773"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/8773/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8773/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/8773/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/bf2977a0ed11edfe87f00bc9cbeb73bcfc73d3f4"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":4,"additions":618,"deletions":1148,"changed_files":26}}
{"actor":{"display_login":"anntzer"}}