|
@@ -5,8 +5,12 @@ from urllib2 import urlopen, URLError
|
|
|
|
|
|
|
|
|
class BatcaveClient(object):
|
|
|
- def __init__(self, base_url):
|
|
|
- self.base_url = base_url
|
|
|
+ def __init__(self, url):
|
|
|
+ assert url.startswith("http://") or url.startswith("https://"), \
|
|
|
+ "BATCAVE URL must use http(s) protocol"
|
|
|
+ assert url.endswith("/"), "BATCAVE URL must end with slash."
|
|
|
+
|
|
|
+ self.base_url = url
|
|
|
self.logger = logging.getLogger('BATCAVE')
|
|
|
|
|
|
def __load_response(self, url, error_context):
|