def __init__()

in dubbo_client/common.py [0:0]


    def __init__(self, url):
        result = urlparse(url)
        self.protocol = result[0]
        self.location = result[1]
        self.path = result[2]
        if self.location.find(':') > -1:
            self.ip, self.port = result[1].split(':')
        params = parse_qsl(result[4])
        for key, value in params:
            # url has a default.timeout property, but it can not add in python object
            # so keep the last one
            pos = key.find('.')
            if pos > -1:
                key = key[pos + 1:]
            # print key
            if key == 'disabled':
                value = value.lower() == 'true' if value else False
                self.has_disable_value = True
            elif key == 'weight':
                value = int(value) if value else 100
                self.has_weight_value = True
            self.__dict__[key] = value