'Initialize Addr from string.'

@classmethod
def fromstring(cls, str_addr):

    parts = str_addr.split('    ')
    ssl = False
    default = False
    host = ''
    port = ''
    addr = parts.pop(0)
    if addr.startswith('unix:'):
        return None
    tup = addr.partition(':')
    if re.match('^\\d+$', tup[0]):
        host = ''
        port = tup[0]
    else:
        host = tup[0]
        port = tup[2]
    while (len(parts) > 0):
        nextpart = parts.pop()
        if (nextpart == 'ssl'):
            ssl = True
        elif (nextpart == 'default_server'):
            default = True
    return cls(host, port, ssl, default)
