-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataObjects.py
58 lines (46 loc) · 1.56 KB
/
DataObjects.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class User:
"""
Note:
This class may be changed into a user manager, controlling the extraction and boolean logics.
"""
def __init__(self, name, password, dob, artist, genre):
self.username = name
self.password = password
self.dob = dob
self.artist = artist
self.genre = genre
def confirmUser(self, username, password):
if (self.username == username) and (self.password == password):
return True
return False
def get_name(self):
return self.username
def get_password(self):
return self.password
def get_fav_artist(self):
return self.artist
def get_fav_genre(self):
return self.genre
class Song:
def __init__(self, title, length, genre, artist):
self.title = title
self.length = length
self.genre = genre
self.artist = artist
def get_title(self):return self.title
def get_length(self): return self.length
def get_genre(self): return self.genre
def get_artist(self): return self.artist
def set_title(self, new_title): self.title = new_title
def set_length(self, new_length): self.length = new_length
def set_genre(self, new_genre): self.genre = new_genre
def set_artist(self, new_artist): self.artist = new_artist
class Playlist:
def __init__(self, title, length, genre, artist):
self.title = title
self.songs = []
self.length = length
self.genre = genre
self.artist = artist
def auto_generate(self, songs):
return False