@@ -145,8 +145,6 @@ def get(self, requested_filepath):
145145 # make path in zip file relative
146146 rel_path = os .path .relpath (full_path , filepath )
147147 zf .write (full_path , rel_path )
148- with open ("/tmp/stefan.log" , "a" ) as f :
149- f .write ("üüüüüüüü da bin ich baff=%s %s\n " % (full_path , rel_path ))
150148 memfile .seek (0 )
151149 self .set_header ('Content-Type' , 'application/zip' )
152150 self .set_header ('Content-Disposition' ,
@@ -176,14 +174,19 @@ def get(self, requested_filepath):
176174 fp_subdir = os .path .relpath (filepath , basedatadir )
177175
178176 # above function adds filepath to located files, which is
179- # different from the non-nginx version. Correct here:
177+ # different from the non-nginx version, e.g.
178+ # fp = /protected/job/2_test_folder/testdir/fileA.txt
179+ # fp_name = job/2_test_folder/testdir/fileA.txt
180+ # where "job/2_test_folder" is what user requested and
181+ # "testdir/fileA.txt" is a file within this directory.
182+ # When extracting by qiita_client, the "job/2_test_folder"
183+ # part would be added twice (one by user request, second by
184+ # unzipping). Therefore, we need to correct these names here:
180185 to_download = [
181186 (fp , os .path .relpath (fp_name , fp_subdir ), fp_checksum ,
182187 fp_size )
183188 for fp , fp_name , fp_checksum , fp_size
184189 in to_download ]
185- with open ("/tmp/stefan.log" , "a" ) as f :
186- f .write ("üüüüüüüü to_download=%s\n " % to_download )
187190 BaseHandlerDownload ._write_nginx_file_list (self , to_download )
188191 BaseHandlerDownload ._set_nginx_headers (
189192 self , filename_directory )
@@ -239,8 +242,6 @@ def post(self):
239242 zf .extractall (filepath )
240243 stored_directories .append (filepath )
241244 else :
242- with open ("/tmp/stefan.log" , "a" ) as f :
243- f .write ("üüüüüüüü qiita filepath=%s\n " % filepath )
244245 with open (filepath , "wb" ) as f :
245246 f .write (file ['body' ])
246247 stored_files .append (filepath )
0 commit comments