File: axolotladdress.py

package info (click to toggle)
python-axolotl 0.2.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 592 kB
  • sloc: python: 2,962; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class AxolotlAddress(object):
    def __init__(self, name, deviceId):
        self.name = name
        self.deviceId = deviceId

    def getName(self):
        return self.name

    def getDeviceId(self):
        return self.deviceId

    def __str__(self):
        return "%s;%s" % (self.name, self.deviceId)

    def __eq__(self, other):
        if other is None:
            return False

        if other.__class__ != AxolotlAddress:
            return False

        return self.name == other.getName() and self.deviceId == other.getDeviceId()

    def __hash__(self):
        return hash(self.name) ^ self.deviceId