summaryrefslogtreecommitdiff
path: root/src/mmo/ip.py
blob: e6a81839f7e06f6bfe1b502ae67ad62671036a4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class IP4Address(object):
    ''' print an IP4Address
    '''
    __slots__ = ('_value')
    name = 'IP4Address'
    enabled = True

    def __init__(self, value):
        self._value = value

    def to_string(self):
        addr = self._value['_addr']
        addr = tuple(int(addr[i]) for i in range(4))
        return '%d.%d.%d.%d' % addr