Skip to content

Commit ff39a92

Browse files
committed
Removing unused implict code in pubsub.
1 parent d8626ef commit ff39a92

5 files changed

Lines changed: 0 additions & 286 deletions

File tree

docs/pubsub-api.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
Pub/Sub
66
-------
77

8-
:mod:`gcloud.pubsub`
9-
~~~~~~~~~~~~~~~~~~~~~~~
10-
11-
.. automodule:: gcloud.pubsub
12-
:members: get_connection, get_default_connection,
13-
set_default_connection, set_defaults
14-
158
Connections
169
~~~~~~~~~~~
1710

gcloud/pubsub/__init__.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
"""GCloud Pubsub API wrapper.
1616
17-
1817
The main concepts with this API are:
1918
2019
- :class:`gcloud.pubsub.topic.Topic` represents an endpoint to which messages
@@ -24,52 +23,6 @@
2423
subscription (either pull or push) to a topic.
2524
"""
2625

27-
from gcloud._helpers import get_default_project
28-
from gcloud._helpers import set_default_project
29-
from gcloud.pubsub import _implicit_environ
30-
from gcloud.pubsub._implicit_environ import get_default_connection
3126
from gcloud.pubsub.connection import SCOPE
32-
from gcloud.pubsub.connection import Connection
3327
from gcloud.pubsub.subscription import Subscription
3428
from gcloud.pubsub.topic import Topic
35-
36-
37-
def set_default_connection(connection=None):
38-
"""Set default connection either explicitly or implicitly as fall-back.
39-
40-
:type connection: :class:`gcloud.pubsub.connection.Connection`
41-
:param connection: A connection provided to be the default.
42-
"""
43-
_implicit_environ._DEFAULTS.connection = connection or get_connection()
44-
45-
46-
def set_defaults(project=None, connection=None):
47-
"""Set defaults either explicitly or implicitly as fall-back.
48-
49-
Uses the arguments to call the individual default methods.
50-
51-
:type project: string
52-
:param project: Optional. The name of the project to connect to.
53-
54-
:type connection: :class:`gcloud.pubsub.connection.Connection`
55-
:param connection: Optional. A connection provided to be the default.
56-
"""
57-
set_default_project(project=project)
58-
set_default_connection(connection=connection)
59-
60-
61-
def get_connection():
62-
"""Shortcut method to establish a connection to Cloud Storage.
63-
64-
Use this if you are going to access several buckets with the same
65-
set of credentials:
66-
67-
>>> from gcloud import pubsub
68-
>>> connection = pubsub.get_connection()
69-
>>> bucket1 = pubsub.get_bucket('bucket1', connection=connection)
70-
>>> bucket2 = pubsub.get_bucket('bucket2', connection=connection)
71-
72-
:rtype: :class:`gcloud.pubsub.connection.Connection`
73-
:returns: A connection defined with the proper credentials.
74-
"""
75-
return Connection.from_environment()

gcloud/pubsub/_implicit_environ.py

Lines changed: 0 additions & 61 deletions
This file was deleted.

gcloud/pubsub/test___init__.py

Lines changed: 0 additions & 114 deletions
This file was deleted.

gcloud/pubsub/test__implicit_environ.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)