예제 #1
0
def _get_monhelper_url(name):
    sup_url = supcast.get_url(name)
    url = urllib.parse.urlparse(sup_url)
    port = url.port
    if port is None:
        raise ValueError("no port in url: %s" % sup_url)
    bits = list(url.netloc.partition(str(port)))
    bits[1] = str(port + 1)
    new_url = url._replace(netloc=''.join(bits))
    return urllib.parse.urlunparse(new_url)
예제 #2
0
파일: views.py 프로젝트: dvarrazzo/suponoff
def _get_monhelper_url(name):
    sup_url = supcast.get_url(name)
    url = urllib.parse.urlparse(sup_url)
    port = url.port
    if port is None:
        raise ValueError("no port in url: %s" % sup_url)
    bits = list(url.netloc.partition(str(port)))
    bits[1] = str(port + 1)
    new_url = url._replace(netloc=''.join(bits))
    return urllib.parse.urlunparse(new_url)
예제 #3
0
def _get_supervisor(name):
    url = supcast.get_url(name)
    supervisor = xmlrpc_client.ServerProxy(url, verbose=False)
    return supervisor
예제 #4
0
파일: views.py 프로젝트: dvarrazzo/suponoff
def _get_supervisor(name):
    url = supcast.get_url(name)
    supervisor = xmlrpc_client.ServerProxy(url, verbose=False)
    return supervisor