-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.py
40 lines (27 loc) · 822 Bytes
/
classes.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
33
34
35
36
37
38
39
40
class Song():
"""represents the songs that are passed to gplay music"""
def __init__(self, title, artist, duration, songID):
self.title = title
self.artist = artist
self.duration = duration
self.songID = songID
self.votes = 0
def vote(self):
self.votes += 1
class User():
"""Stores user data"""
def __init__(self, phoneNumber):
self.userID = phoneNumber
self.votedSongs = []
def voteSong(self, songID):
if (songID in self.votedSongs):
return 0
else:
self.votedSongs.append(songID)
return 0
class Message():
"""Stores Message Data"""
def __init__(self, mSSID, query, fromNum):
self.mSSID = mSSID
self.query = query
self.fromNum = fromNum