API: Rename list_subscriptions to get_subscriptions.

This commit is contained in:
rht 2021-03-09 23:16:47 -05:00 committed by Tim Abbott
parent 503e8ed82d
commit 57e8886dfe
4 changed files with 5 additions and 5 deletions

View file

@ -36,7 +36,7 @@ class IRCBot(irc.bot.SingleServerIRCBot):
print("Listening now. Please send an IRC message to verify operation") print("Listening now. Please send an IRC message to verify operation")
def check_subscription_or_die(self) -> None: def check_subscription_or_die(self) -> None:
resp = self.zulip_client.list_subscriptions() resp = self.zulip_client.get_subscriptions()
if resp["result"] != "success": if resp["result"] != "success":
print("ERROR: %s" % (resp["msg"],)) print("ERROR: %s" % (resp["msg"],))
exit(1) exit(1)

View file

@ -275,7 +275,7 @@ def get_rooms(zulipToJabber: ZulipToJabberBot) -> List[str]:
if options.mode == 'public': if options.mode == 'public':
stream_infos = get_stream_infos("streams", zulipToJabber.client.get_streams) stream_infos = get_stream_infos("streams", zulipToJabber.client.get_streams)
else: else:
stream_infos = get_stream_infos("subscriptions", zulipToJabber.client.list_subscriptions) stream_infos = get_stream_infos("subscriptions", zulipToJabber.client.get_subscriptions)
rooms = [] # type: List[str] rooms = [] # type: List[str]
for stream_info in stream_infos: for stream_info in stream_infos:

View file

@ -1278,9 +1278,9 @@ class Client:
} }
) )
def list_subscriptions(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: def get_subscriptions(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
''' '''
See examples/list-subscriptions for example usage. See examples/get-subscriptions for example usage.
''' '''
return self.call_endpoint( return self.call_endpoint(
url='users/me/subscriptions', url='users/me/subscriptions',

View file

@ -18,4 +18,4 @@ options = parser.parse_args()
client = zulip.init_from_options(options) client = zulip.init_from_options(options)
print(client.list_subscriptions()) print(client.get_subscriptions())