File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff 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():
246265def 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
You can’t perform that action at this time.
0 commit comments