File tree 3 files changed +3
-19
lines changed
3 files changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,7 @@ def list_topics():
30
30
"""Lists all Pub/Sub topics in the current project."""
31
31
pubsub_client = pubsub .Client ()
32
32
33
- topics = []
34
- next_page_token = None
35
- while True :
36
- page , next_page_token = pubsub_client .list_topics ()
37
- topics .extend (page )
38
- if not next_page_token :
39
- break
40
-
41
- for topic in topics :
33
+ for topic in pubsub_client .list_topics ():
42
34
print (topic .name )
43
35
44
36
Original file line number Diff line number Diff line change 1
- google-cloud-pubsub == 0.20 .0
1
+ google-cloud-pubsub == 0.21 .0
Original file line number Diff line number Diff line change @@ -31,15 +31,7 @@ def list_subscriptions(topic_name):
31
31
pubsub_client = pubsub .Client ()
32
32
topic = pubsub_client .topic (topic_name )
33
33
34
- subscriptions = []
35
- next_page_token = None
36
- while True :
37
- page , next_page_token = topic .list_subscriptions ()
38
- subscriptions .extend (page )
39
- if not next_page_token :
40
- break
41
-
42
- for subscription in subscriptions :
34
+ for subscription in topic .list_subscriptions ():
43
35
print (subscription .name )
44
36
45
37
You can’t perform that action at this time.
0 commit comments