Private
Public Access
1
0

improved zip processing

This commit is contained in:
Sander Roosendaal
2017-04-13 14:34:03 +02:00
parent 3ec060e30e
commit ccd4603c05
6 changed files with 30 additions and 11 deletions

View File

@@ -572,9 +572,15 @@ def new_workout_from_file(r,f2,
with zipfile.ZipFile(f2) as z:
# for now, we're getting only the first file
# from the NK zip file (issue #69 on bitbucket)
f2 = z.extract(z.namelist()[0],path='media/')
fileformat = fileformat[2]
for fname in z.namelist():
f3 = z.extract(fname,path='media/')
id,message,f2 = new_workout_from_file(r,f3,
workouttype=workouttype,
makeprivate=makeprivate,
title = title,
notes='')
os.remove(f_to_be_deleted)
return id,message,f2
# Some people try to upload Concept2 logbook summaries
if fileformat == 'c2log':