Skip to content

Commit 870e142

Browse files
author
Antonino Tramontana
committed
aggiunta routine per rimozione di un pacchetto musicale
1 parent c5c98f7 commit 870e142

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

musicPackages.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,21 @@ def __init__(self):
110110
if p not in self.packages:
111111
self.packages[p] = mp
112112

113+
114+
def deletePackage(self, packageName):
115+
print("rimozione pacchetto")
116+
if packageName in self.packages:
117+
del self.packages[packageName]
118+
self.updatePackages()
119+
else:
120+
print("errore, il pacchetto " + packageName + " non è stato trovato")
121+
122+
if os.path.exists('./sounds/notes/' + packageName):
123+
os.system('rm -rf ./sounds/notes/' + packageName)
124+
125+
113126
def isPackageAvailable(self,namePackage):
114127
if namePackage in self.packages:
115128
return True
116129
else:
117-
return False
130+
return False

0 commit comments

Comments
 (0)