-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.py
108 lines (69 loc) · 3.83 KB
/
App.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This is the main Class Index of the app
# Always remember to use snake_case with python
from Model import song, artist, favorite, info, dashboard, lyrics, page, UI
song = song.Song()
artist = artist.Artist()
favorite = favorite.Favorite()
info = info.Info()
dashboard = dashboard.Dashboard()
lyrics = lyrics.Lyrics()
page = page.Page()
UI = UI.UserInterface()
# Main App
class App:
def __init__(self) -> None:
pass
def app_loop():
info_folder = info()
song_object = song(info.Infofile())
artist_object = artist(info.Infofile(),
info.Linklist())
favorite_object = favorite(info.Linklist())
lyrics_object = lyrics()
page_object = page(song.Songlist(),
artist.Artistlist(),
artist.Artistsonglist(song.Songlist(),
artist.Artistlist()))
function = dashboard(info.Linklist())
ui = UI(song.Songlist(),
artist.Artistlist(),
artist.Artistsonglist(song.Songlist(),
artist.Artistlist()))
while True:
selection = input("songs artists likelist\n")
if selection == "songs":
songlist = song.Songlist() # song list
print(ui.Show(songlist, "songs"))
songname = input("songname:\n") # song name
songindex = songlist.index(songname) # song index
function.Play(songlink) # select button
elif selection == "artists":
artistlist = artist.Artistlist() # artist list
print(ui.Show(artistlist, "artists"))
artistname = input("artistname:\n") # artist name
artistindex = artistlist.index(artistname) # artist index
songlist = page.Artistsongpage(artistindex) # song list
print(ui.Show(songlist, "songs"))
songindex = songlist.index(input("songname:\n")) # song index
artistsonglist = artist.Artistsonglinklist(artist.Artistsonglist(song.Songlist(),
artist.Artistlist()))
linklist = artistsonglist[artistindex] # link list
songlink = linklist[songindex] # song link
function.Play(songlink) # select button
elif selection == "likelist":
songlist = favorite.Likelist() # song list
print(ui.Show(songlist, "song"))
songname = input()
songindex = songlist.index(songname) # song index
linklist = favorite.Linklist(favorite.Likelist()) # link list
songlink = linklist[songindex] # song link
function.Play(songlink) # select button
## control function
def control_finction(action):
return function.Select(function.Push(action))
while True:
action = input()
control = control_finction(action)
function.Play(songlink)
if __name__ == "__main__":
App()