Skip to content

Commit bede80f

Browse files
committed
Consistency: use 'project' everywhere, rather than 'project_id'.
1 parent 3cbfe2f commit bede80f

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/pubsub-usage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Connection / Authorization
88

99
- credentials (derived from GAE / GCE environ if present).
1010

11-
- ``project_id`` (derived from GAE / GCE environ if present).
11+
- ``project`` (derived from GAE / GCE environ if present).
1212

1313
- ``scopes``
1414

@@ -29,7 +29,7 @@ Create a new topic for an explicit project:
2929
.. doctest::
3030

3131
>>> from gcloud.pubsub import Topic
32-
>>> topic = Topic('topic_name', project_id='my.project')
32+
>>> topic = Topic('topic_name', project='my.project')
3333
>>> topic.create() # API request
3434

3535
Check for the existance of a topic:
@@ -54,7 +54,7 @@ List topics for an explicit project:
5454
.. doctest::
5555

5656
>>> from gcloud.pubsub import list_topics
57-
>>> topics = list_topics(project_id='my.project') # API request
57+
>>> topics = list_topics(project='my.project') # API request
5858
>>> [topic.name for topic in topics]
5959
['topic_name']
6060

gcloud/test__helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ def close(self):
340340

341341
class _HTTPConnection(_BaseHTTPConnection):
342342

343-
def __init__(self, status, project_id):
343+
def __init__(self, status, project):
344344
super(_HTTPConnection, self).__init__()
345345
self.status = status
346-
self.project_id = project_id
346+
self.project = project
347347

348348
def getresponse(self):
349-
return _HTTPResponse(self.status, self.project_id)
349+
return _HTTPResponse(self.status, self.project)
350350

351351

352352
class _TimeoutHTTPConnection(_BaseHTTPConnection):

regression/pubsub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def test_list_topics(self):
5757

5858
# Retrieve the topics.
5959
all_topics, _ = pubsub.list_topics()
60-
project_id = pubsub.get_default_project()
60+
project = pubsub.get_default_project()
6161
created = [topic for topic in all_topics
6262
if topic.name in topics_to_create and
63-
topic.project == project_id]
63+
topic.project == project]
6464
self.assertEqual(len(created), len(topics_to_create))
6565

6666
def test_create_subscription(self):

0 commit comments

Comments
 (0)