def equals(self, raw_value):
"""Compares this IP address to a given one, OR
Checks this IP address matchtype.
Suported matchtypes: 'private', 'public'.
raw_value -- Specific IP address, OR matchtype of IP.
"""
if self.value is None:
output = False
elif raw_value == 'private':
output = (self.value.iptype() == 'PRIVATE')
elif raw_value == 'public':
output = (self.value.iptype() == 'PUBLIC')
else:
value = self.load(raw_value)
output = (self.value == value)
return output
评论列表
文章目录