API bindings: Raise error if site param not defined.

Stops defaulting the site parameter to the now-nonexistent
https://zulip.com, and ask the user to enter the site via --site or
~/.zuliprc if not provided.

Fixes #2039.
This commit is contained in:
reyha 2016-10-18 19:12:15 +00:00 committed by Tim Abbott
parent 7187c2ef5e
commit 4cdc59a3e4

View file

@ -219,9 +219,9 @@ class Client(object):
site = site.rstrip("/") site = site.rstrip("/")
self.base_url = site self.base_url = site
else: else:
self.base_url = "https://api.zulip.com" raise RuntimeError("Missing Zulip server URL; specify via --site or ~/.zuliprc.")
if self.base_url != "https://api.zulip.com" and not self.base_url.endswith("/api"): if not self.base_url.endswith("/api"):
self.base_url += "/api" self.base_url += "/api"
self.base_url += "/" self.base_url += "/"
self.retry_on_errors = retry_on_errors self.retry_on_errors = retry_on_errors