Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Naomi 2013-02-15 17:06:42 -05:00
commit e3f4e91bef
1 changed files with 6 additions and 2 deletions

View File

@ -112,7 +112,9 @@ class RequestProvider(object):
def __init__(self, cfg):
self.config = cfg
self.requests = {}
self.url = ApcUrl("http://%s:%s/%s/%s/%s" \
if self.config["base_dir"].startswith("/"):
self.config["base_dir"] = self.config["base_dir"][1:]
self.url = ApcUrl("http://%s:%s/%s%s/%s" \
% (self.config["host"], str(self.config["base_port"]),
self.config["base_dir"], self.config["api_base"],
'%%action%%'))
@ -243,7 +245,9 @@ class AirtimeApiClient(object):
def construct_url(self,config_action_key):
"""Constructs the base url for every request"""
# TODO : Make other methods in this class use this this method.
url = "http://%s:%s/%s/%s/%s" % \
if self.config["base_dir"].startswith("/"):
self.config["base_dir"] = self.config["base_dir"][1:]
url = "http://%s:%s/%s%s/%s" % \
(self.config["host"], str(self.config["base_port"]),
self.config["base_dir"], self.config["api_base"],
self.config[config_action_key])