def ip_list(_): ips = [] for ip in _.split(' '): if not ip: continue elif isip(ip): ips.append(IP.create(ip)) else: raise TypeError('ip %s is invalid' % ip) return ips
def ip_list (_): ips = [] for ip in _.split(' '): if not ip: continue elif isip(ip): ips.append(IP.create(ip)) else: raise TypeError('ip %s is invalid' % ip) return ips
def optional_ip (_): if not _ or isip(_): return _ raise TypeError('ip %s is invalid' % _)
def ip (_): if isip(_): return _ raise TypeError('ip %s is invalid' % _)