Skip to content
Snippets Groups Projects
Commit 68c0f1c7 authored by hdd29's avatar hdd29
Browse files

clean up unecessary comments

parent a167c607
No related branches found
No related tags found
No related merge requests found
......@@ -3,10 +3,6 @@
import sys
import argparse
import os
#from . import classDef
#from classDef import Album
class Album():
......@@ -68,9 +64,6 @@ for i in inBlank[::-1]:
inBlank.pop(inBlank.index(i))
lineList.pop(i-1)
#print(f'updated inBlank: {inBlank}')
#Iterate through list of index of blank lines and store info in album class data structure
count = 0
for index in inBlank[0:-1]:
......@@ -90,10 +83,6 @@ for index in inBlank[0:-1]:
count += 1
#for artist in albumDict.keys():
# for album in albumDict[artist]:
# print(album)
for artist in albumDict.keys():
albumDict[artist] = sorted(albumDict[artist], key=lambda album: album.date)
......@@ -130,12 +119,6 @@ def artistMenu(albumDict, purpose):
except ValueError:
print(f'Invalid input: Please enter an integer between 1 and {len(albumDict.keys())}')
#elif isinstance(artistChosen, int):
#if artistChosen < (len(albumDict.keys())+1) and artistChosen > 0 :
#err = False
#return artistList[int(artistChosen) - 1] #name of artist chosen
#else:
#print(f'Invalid input: Please enter an integer between 1 and {len(albumDict.keys())}')
def listAlbums(res, albumDict, purpose):
......@@ -166,20 +149,6 @@ def listAlbums(res, albumDict, purpose):
# if str(albumchosen) != 'a': #used to be == a
# if isinstance(albumchosen, int):
# if albumchosen < (len(albumList)+1) and albumchosen > 0 :
# err = False
# return albumchosen #res is the string of name of artistchosen
# else:
# print(f'Invalid input: please enter an interger between 1 and {len(albumList)}')
# else:
# print(f'Invalid input: Your input is not an integer. Please enter an integer between 1 and {len(albumList)})')
# else:
# err = False
# return 0
def lUti(albumDict):
albumchosen = 0
......@@ -195,9 +164,9 @@ def lUti(albumDict):
for song in albumList[int(albumchosen)-1].songs:
print(song)
res3 = input(str('Return to the previous (the album) menu or quit? (press any key = return, 0 = quit)\n'))
if res3 == '0': ########EXIT HERE!!!!!! REMEMBER TO CHECK AGAIN
if res3 == '0':
sys.exit()
else: ################### res3 invalid key
else:
albumchosen = listAlbums(artistchosen, albumDict, 'song listing')
while albumchosen == 0:
artistchosen= artistMenu(albumDict, 'listing')
......@@ -206,7 +175,6 @@ def lUti(albumDict):
albumchosen = listAlbums(artistchosen, albumDict, 'song listing')
#the Delete function
def delete(albumDict):
albumchosen = 0
while albumchosen == 0:
......@@ -218,10 +186,6 @@ def delete(albumDict):
albumchosen = listAlbums(artistchosen, albumDict, 'album deletion')
del albumDict[artistchosen][int(albumchosen) -1]
#for k in albumDict.keys():
#for album in albumDict[k]:
#print(album)
def add(albumDict):
......@@ -251,11 +215,6 @@ def add(albumDict):
albumDict[new.artist].append(new)
#for k in albumDict.keys():
# for album in albumDict[k]:
# print(album)
def helpmsg():
print('usage: parseCDDB.py [-h] -F\n')
print('Purpose: To manage a CD database')
......@@ -267,6 +226,11 @@ def helpmsg():
print('-h : Display official help message')
print('PLEASE REFER TO THE -h OPTION FOR OFFICIAL HELP MESSAGE!!!')
#after processing information all within the scope of this script, thinsg need to be written out in temp_cddb, then eventually replacing cddb
def update(albumDict):
temp = open('temp_cddb', 'a')
for key in albumDict.keys():
......@@ -289,20 +253,12 @@ def update(albumDict):
for line in tempLines:
cddb.write("%s" % line)
with open("temp_old", 'a') as old:
with open("temp_old", 'w') as old:
for line in cdLine:
old.write("%s" % line)
#lUti(albumDict)
#add(albumDict)
#update(albumDict)
def main():
parser=argparse.ArgumentParser(description="A command line utility to manage a CD database")
parser.add_argument("-l", '--list', help="List all the songs in an album. Provide 2 step-choosing mechanism: \n 1. to choose the artist, and 2. choose the album to display", action="store_true")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment