{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments/31869563","id":31869563,"diff_hunk":"@@ -213,13 +228,13 @@ Fetch pending messages for a pull subscription:\n \n .. doctest::\n \n-   >>> from gcloud.pubsub import Topic\n-   >>> from gcloud.pubsub import Subscription\n-   >>> topic = Topic('topic_name')\n-   >>> subscription = Subscription('subscription_name', topic)\n-   >>> with topic:\n-   ...     topic.publish('this is the first message_payload')\n-   ...     topic.publish('this is the second message_payload',\n+   >>> from gcloud import pubsub\n+   >>> client = pubsub.Client()\n+   >>> topic = client.topic('topic_name')\n+   >>> subscription = pubsub.Subscription('subscription_name', topic)\n+   >>> with topic.batch() as batch:\n+   ...     batch.publish('this is the first message_payload')\n+   ...     batch.publish('this is the second message_payload',\n    ...                   attr1='value1', attr2='value2')\n    >>> received = subscription.pull()  # API request","path":"docs/pubsub-usage.rst","position":290,"original_position":290,"commit_id":"838392f4164a6a47d1c037f3ca06377a2bcc8c66","original_commit_id":"7262118a5e0c0c9804b8067fbebacfd768de922f","user":{"login":"jgeewax","id":112928,"avatar_url":"https://avatars.githubusercontent.com/u/112928?v=3","gravatar_id":"","url":"https://api.github.com/users/jgeewax","html_url":"https://github.com/jgeewax","followers_url":"https://api.github.com/users/jgeewax/followers","following_url":"https://api.github.com/users/jgeewax/following{/other_user}","gists_url":"https://api.github.com/users/jgeewax/gists{/gist_id}","starred_url":"https://api.github.com/users/jgeewax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgeewax/subscriptions","organizations_url":"https://api.github.com/users/jgeewax/orgs","repos_url":"https://api.github.com/users/jgeewax/repos","events_url":"https://api.github.com/users/jgeewax/events{/privacy}","received_events_url":"https://api.github.com/users/jgeewax/received_events","type":"User","site_admin":false},"body":"Ha - yes... you nailed it right on the head. Updating my comment to be PEP8 and not Node/Java","created_at":"2015-06-06T16:51:40Z","updated_at":"2015-06-06T16:51:40Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/910#discussion_r31869563","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/910","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments/31869563"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/910#discussion_r31869563"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/910"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/910","id":37085285,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/910","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/910.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/910.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/910","number":910,"state":"open","locked":false,"title":"Attempt at implementing clients for Pub/Sub","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"body":"- It doesn't seem that in pub/sub there was ever a use of `_LocalStack` so the worries about the welded on client and batching don't seem to manifest in the `pubsub` subpackage.\r\n- I tried to make the commits as small and reviewable as possible.\r\n- I'm happy to split this up into many PRs to make review / commenting easier.\r\n- The `Using client on all Topic methods.` and `Using client on all Subscription methods.` commits are a bit longer than the rest. I'm also happy to break them up method-by-method if it makes review easier.\r\n- I didn't look too closely, but there may be some superfluous connection vs. client tests that exist as artifacts of the old / transition states of the code.","created_at":"2015-06-06T05:22:35Z","updated_at":"2015-06-06T16:51:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19203d2d3e30f3ef30ffbcb04ea66e0b44a498b1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/910/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/910/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/910/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/838392f4164a6a47d1c037f3ca06377a2bcc8c66","head":{"label":"dhermes:pubsub-client-approach","ref":"pubsub-client-approach","sha":"838392f4164a6a47d1c037f3ca06377a2bcc8c66","user":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"repo":{"id":23001795,"name":"gcloud-python","full_name":"dhermes/gcloud-python","owner":{"login":"dhermes","id":520669,"avatar_url":"https://avatars.githubusercontent.com/u/520669?v=3","gravatar_id":"","url":"https://api.github.com/users/dhermes","html_url":"https://github.com/dhermes","followers_url":"https://api.github.com/users/dhermes/followers","following_url":"https://api.github.com/users/dhermes/following{/other_user}","gists_url":"https://api.github.com/users/dhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/dhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhermes/subscriptions","organizations_url":"https://api.github.com/users/dhermes/orgs","repos_url":"https://api.github.com/users/dhermes/repos","events_url":"https://api.github.com/users/dhermes/events{/privacy}","received_events_url":"https://api.github.com/users/dhermes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhermes/gcloud-python","description":"Google Cloud Python Client Library","fork":true,"url":"https://api.github.com/repos/dhermes/gcloud-python","forks_url":"https://api.github.com/repos/dhermes/gcloud-python/forks","keys_url":"https://api.github.com/repos/dhermes/gcloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhermes/gcloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhermes/gcloud-python/teams","hooks_url":"https://api.github.com/repos/dhermes/gcloud-python/hooks","issue_events_url":"https://api.github.com/repos/dhermes/gcloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/dhermes/gcloud-python/events","assignees_url":"https://api.github.com/repos/dhermes/gcloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/dhermes/gcloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/dhermes/gcloud-python/tags","blobs_url":"https://api.github.com/repos/dhermes/gcloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhermes/gcloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhermes/gcloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhermes/gcloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhermes/gcloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/dhermes/gcloud-python/languages","stargazers_url":"https://api.github.com/repos/dhermes/gcloud-python/stargazers","contributors_url":"https://api.github.com/repos/dhermes/gcloud-python/contributors","subscribers_url":"https://api.github.com/repos/dhermes/gcloud-python/subscribers","subscription_url":"https://api.github.com/repos/dhermes/gcloud-python/subscription","commits_url":"https://api.github.com/repos/dhermes/gcloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhermes/gcloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhermes/gcloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhermes/gcloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhermes/gcloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/dhermes/gcloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhermes/gcloud-python/merges","archive_url":"https://api.github.com/repos/dhermes/gcloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhermes/gcloud-python/downloads","issues_url":"https://api.github.com/repos/dhermes/gcloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/dhermes/gcloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/dhermes/gcloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/dhermes/gcloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhermes/gcloud-python/labels{/name}","releases_url":"https://api.github.com/repos/dhermes/gcloud-python/releases{/id}","created_at":"2014-08-15T20:18:30Z","updated_at":"2015-05-07T17:34:12Z","pushed_at":"2015-06-06T16:46:58Z","git_url":"git://github.com/dhermes/gcloud-python.git","ssh_url":"git@github.com:dhermes/gcloud-python.git","clone_url":"https://github.com/dhermes/gcloud-python.git","svn_url":"https://github.com/dhermes/gcloud-python","homepage":"http://googlecloudplatform.github.io/gcloud-python/","size":11574,"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":"GoogleCloudPlatform:master","ref":"master","sha":"3e86aaed3c7e192a17d9b790f90a41cc2b7baa6a","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":16316451,"name":"gcloud-python","full_name":"GoogleCloudPlatform/gcloud-python","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-python","description":"Google Cloud Client Library for Python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/releases{/id}","created_at":"2014-01-28T15:51:47Z","updated_at":"2015-06-02T19:39:41Z","pushed_at":"2015-06-06T16:46:59Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-python.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-python.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-python.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-python","homepage":"https://googlecloudplatform.github.io/gcloud-python/","size":37639,"stargazers_count":174,"watchers_count":174,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":92,"mirror_url":null,"open_issues_count":86,"forks":92,"open_issues":86,"watchers":174,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/910"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/910"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/910"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/910/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/910/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/910/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/838392f4164a6a47d1c037f3ca06377a2bcc8c66"}}}}