Skip to content

Commit b0b6403

Browse files
author
Antonino Tramontana
committed
fixed routine for deleting a package
1 parent 24448d5 commit b0b6403

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

api.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,25 @@ def updateFromPackage():
173173
os.system('sudo reboot')
174174
return 200
175175

176+
def updatePackages():
177+
"""
178+
Add a musical package an save the list of available packages on disk
179+
also add sounds and directory
180+
"""
181+
"""zipName = request.args.get("zipname")
182+
"""
183+
file_to_upload = connexion.request.files['file_to_upload']
184+
print("adding " +str(file_to_upload))
185+
print("adding " + file_to_upload.filename)
186+
file_to_upload.save(os.path.join('./updatePackages/', file_to_upload.filename))
187+
musicPkg = MusicPackageManager.get_instance()
188+
response = musicPkg.addPackage(file_to_upload.filename)
189+
if response == 1:
190+
return 200
191+
elif response == 2:
192+
return 2
193+
elif response == 3:
194+
return 3
176195

177196

178197
## Programs
@@ -246,4 +265,4 @@ def reset():
246265
def testCoderbot(data):
247266
# taking first JSON key value (varargin)
248267
tests_state = runCoderbotTestUnit(data[list(data.keys())[0]])
249-
return tests_state
268+
return tests_state

0 commit comments

Comments
 (0)