-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.py
32 lines (24 loc) · 858 Bytes
/
model.py
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
26
27
28
29
30
31
32
class Project(object):
version = ""
artifact_id = ""
group = ""
path = None
def __init__(self, artifact_id, group, version, path):
self.version = version
self.artifact_id = artifact_id
self.group = group
self.path = path
def __str__(self):
return "{}:{}:{}".format(self.group, self.artifact_id, self.version)
def get_path(self):
return self.path
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self.path == other.path) and (self.artifact_id == other.artifact_id)
return NotImplemented
def __ne__(self, other):
if isinstance(other, self.__class__):
return not self.__eq__(other)
return NotImplemented
def __hash__(self):
return (hash(self.path) * 13) + hash(self.artifact_id)