{"action":"opened","number":24,"pull_request":{"url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls/24","id":95190994,"html_url":"https://github.com/rawrgulmuffins/bugzillatools/pull/24","diff_url":"https://github.com/rawrgulmuffins/bugzillatools/pull/24.diff","patch_url":"https://github.com/rawrgulmuffins/bugzillatools/pull/24.patch","issue_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/issues/24","number":24,"state":"open","locked":false,"title":"Add a class to handle a list of Bugs","user":{"login":"ThomasFaivre","id":5682339,"avatar_url":"https://avatars.githubusercontent.com/u/5682339?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasFaivre","html_url":"https://github.com/ThomasFaivre","followers_url":"https://api.github.com/users/ThomasFaivre/followers","following_url":"https://api.github.com/users/ThomasFaivre/following{/other_user}","gists_url":"https://api.github.com/users/ThomasFaivre/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasFaivre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasFaivre/subscriptions","organizations_url":"https://api.github.com/users/ThomasFaivre/orgs","repos_url":"https://api.github.com/users/ThomasFaivre/repos","events_url":"https://api.github.com/users/ThomasFaivre/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasFaivre/received_events","type":"User","site_admin":false},"body":"Hello!\r\n\r\nI noticed something while automating some stuff with Bugzilla, if we want to get or update data from several bugs, it can take quite some time. This comes from the fact that for each bug, a RPC request is sent although the RPC API allows the use of a list of bugs id for some method (mainly get and update).\r\n\r\nSo I have written a class that can use this feature. This class inherits from a list (functional append, extend, insert, ...), gets data from server lazily and is much much faster when handling a large number of bugs:\r\n\r\n```\r\nimport timeit\r\n>>> setup = \"\"\"\r\n... from bzlib.bugzilla import Bugzilla\r\n... from bzlib.config import Config\r\n... from bzlib.bug import Bug, Bugs\r\n...\r\n... bz = Bugzilla.from_config(Config.get_config(\"~/.bugzillarc\"),\r\n...                           server=None, url=None, user=None, password=None)\r\n... \"\"\"\r\n\r\n# 10 Bugs\r\n>>> timeit.timeit(stmt='Bugs(bz, *range(50000,50010)).data', setup=setup, number=1)\r\n1.1943719387054443\r\n>>> timeit.timeit(stmt='for num in range(50000, 50010): Bug(bz, num).data', setup=setup, number=1)\r\n8.836580991744995\r\n\r\n# 100 Bugs\r\n>>> timeit.timeit(stmt='Bugs(bz, *range(50000,50100)).data', setup=setup, number=1)\r\n1.8374311923980713\r\n>>> timeit.timeit(stmt='for num in range(50000, 50100): Bug(bz, num).data', setup=setup, number=1)`\r\n67.8080358505249`\r\n```\r\n\r\nIt is only the base of the class, it is missing some method like the `set_*` of the Bug class but the main is here and the rest can be easily added.\r\n\r\nI also added a small patch to make bugzilla, bug and config modules public when importing bzlib alone. They are the most used modules of the library (the rest is for the cli so not really public) so I thought it would be nice to have this.\r\n\r\nThanks!","created_at":"2016-11-24T14:49:59Z","updated_at":"2016-11-24T14:49:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls/24/commits","review_comments_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls/24/comments","review_comment_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/issues/24/comments","statuses_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/statuses/1dcdfbda98eb8a23272283db055f7b712d37c733","head":{"label":"ThomasFaivre:list_bugs","ref":"list_bugs","sha":"1dcdfbda98eb8a23272283db055f7b712d37c733","user":{"login":"ThomasFaivre","id":5682339,"avatar_url":"https://avatars.githubusercontent.com/u/5682339?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasFaivre","html_url":"https://github.com/ThomasFaivre","followers_url":"https://api.github.com/users/ThomasFaivre/followers","following_url":"https://api.github.com/users/ThomasFaivre/following{/other_user}","gists_url":"https://api.github.com/users/ThomasFaivre/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasFaivre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasFaivre/subscriptions","organizations_url":"https://api.github.com/users/ThomasFaivre/orgs","repos_url":"https://api.github.com/users/ThomasFaivre/repos","events_url":"https://api.github.com/users/ThomasFaivre/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasFaivre/received_events","type":"User","site_admin":false},"repo":{"id":73301154,"name":"bugzillatools","full_name":"ThomasFaivre/bugzillatools","owner":{"login":"ThomasFaivre","id":5682339,"avatar_url":"https://avatars.githubusercontent.com/u/5682339?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasFaivre","html_url":"https://github.com/ThomasFaivre","followers_url":"https://api.github.com/users/ThomasFaivre/followers","following_url":"https://api.github.com/users/ThomasFaivre/following{/other_user}","gists_url":"https://api.github.com/users/ThomasFaivre/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasFaivre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasFaivre/subscriptions","organizations_url":"https://api.github.com/users/ThomasFaivre/orgs","repos_url":"https://api.github.com/users/ThomasFaivre/repos","events_url":"https://api.github.com/users/ThomasFaivre/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasFaivre/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ThomasFaivre/bugzillatools","description":"CLI and Python library for interacting with Bugzilla","fork":true,"url":"https://api.github.com/repos/ThomasFaivre/bugzillatools","forks_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/forks","keys_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/teams","hooks_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/hooks","issue_events_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/issues/events{/number}","events_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/events","assignees_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/assignees{/user}","branches_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/branches{/branch}","tags_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/tags","blobs_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/statuses/{sha}","languages_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/languages","stargazers_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/stargazers","contributors_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/contributors","subscribers_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/subscribers","subscription_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/subscription","commits_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/contents/{+path}","compare_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/merges","archive_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/downloads","issues_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/issues{/number}","pulls_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/pulls{/number}","milestones_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/milestones{/number}","notifications_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/labels{/name}","releases_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/releases{/id}","deployments_url":"https://api.github.com/repos/ThomasFaivre/bugzillatools/deployments","created_at":"2016-11-09T16:26:17Z","updated_at":"2016-11-09T16:26:18Z","pushed_at":"2016-11-24T14:20:45Z","git_url":"git://github.com/ThomasFaivre/bugzillatools.git","ssh_url":"git@github.com:ThomasFaivre/bugzillatools.git","clone_url":"https://github.com/ThomasFaivre/bugzillatools.git","svn_url":"https://github.com/ThomasFaivre/bugzillatools","homepage":null,"size":159,"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":"rawrgulmuffins:0.6.0.dev","ref":"0.6.0.dev","sha":"21e526e3b3e14f9b5f4d79bc429eb86f2730938d","user":{"login":"rawrgulmuffins","id":1521575,"avatar_url":"https://avatars.githubusercontent.com/u/1521575?v=3","gravatar_id":"","url":"https://api.github.com/users/rawrgulmuffins","html_url":"https://github.com/rawrgulmuffins","followers_url":"https://api.github.com/users/rawrgulmuffins/followers","following_url":"https://api.github.com/users/rawrgulmuffins/following{/other_user}","gists_url":"https://api.github.com/users/rawrgulmuffins/gists{/gist_id}","starred_url":"https://api.github.com/users/rawrgulmuffins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawrgulmuffins/subscriptions","organizations_url":"https://api.github.com/users/rawrgulmuffins/orgs","repos_url":"https://api.github.com/users/rawrgulmuffins/repos","events_url":"https://api.github.com/users/rawrgulmuffins/events{/privacy}","received_events_url":"https://api.github.com/users/rawrgulmuffins/received_events","type":"User","site_admin":false},"repo":{"id":9538238,"name":"bugzillatools","full_name":"rawrgulmuffins/bugzillatools","owner":{"login":"rawrgulmuffins","id":1521575,"avatar_url":"https://avatars.githubusercontent.com/u/1521575?v=3","gravatar_id":"","url":"https://api.github.com/users/rawrgulmuffins","html_url":"https://github.com/rawrgulmuffins","followers_url":"https://api.github.com/users/rawrgulmuffins/followers","following_url":"https://api.github.com/users/rawrgulmuffins/following{/other_user}","gists_url":"https://api.github.com/users/rawrgulmuffins/gists{/gist_id}","starred_url":"https://api.github.com/users/rawrgulmuffins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawrgulmuffins/subscriptions","organizations_url":"https://api.github.com/users/rawrgulmuffins/orgs","repos_url":"https://api.github.com/users/rawrgulmuffins/repos","events_url":"https://api.github.com/users/rawrgulmuffins/events{/privacy}","received_events_url":"https://api.github.com/users/rawrgulmuffins/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rawrgulmuffins/bugzillatools","description":"CLI and Python library for interacting with Bugzilla","fork":false,"url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools","forks_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/forks","keys_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/teams","hooks_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/hooks","issue_events_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/issues/events{/number}","events_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/events","assignees_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/assignees{/user}","branches_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/branches{/branch}","tags_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/tags","blobs_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/git/refs{/sha}","trees_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/statuses/{sha}","languages_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/languages","stargazers_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/stargazers","contributors_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/contributors","subscribers_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/subscribers","subscription_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/subscription","commits_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/commits{/sha}","git_commits_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/git/commits{/sha}","comments_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/comments{/number}","issue_comment_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/issues/comments{/number}","contents_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/contents/{+path}","compare_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/merges","archive_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/downloads","issues_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/issues{/number}","pulls_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls{/number}","milestones_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/milestones{/number}","notifications_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/labels{/name}","releases_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/releases{/id}","deployments_url":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/deployments","created_at":"2013-04-19T04:58:24Z","updated_at":"2016-05-18T06:20:59Z","pushed_at":"2016-11-24T14:49:59Z","git_url":"git://github.com/rawrgulmuffins/bugzillatools.git","ssh_url":"git@github.com:rawrgulmuffins/bugzillatools.git","clone_url":"https://github.com/rawrgulmuffins/bugzillatools.git","svn_url":"https://github.com/rawrgulmuffins/bugzillatools","homepage":null,"size":177,"stargazers_count":18,"watchers_count":18,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":8,"forks":11,"open_issues":8,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls/24"},"html":{"href":"https://github.com/rawrgulmuffins/bugzillatools/pull/24"},"issue":{"href":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/issues/24"},"comments":{"href":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/rawrgulmuffins/bugzillatools/statuses/1dcdfbda98eb8a23272283db055f7b712d37c733"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":141,"deletions":0,"changed_files":2}}
{"actor":{"display_login":"ThomasFaivre"}}