File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ def ping():
2222def convert ():
2323 kwargs = request .get_json (force = True )
2424 input_tar = kwargs ['input' ]
25+ archive_name = kwargs ['options' ].get ('filename' , 'hepdata-converter-ws-data' )
2526 output = StringIO .StringIO ()
2627
2728 tmp_output_dir = tempfile .mkdtemp ()
@@ -41,19 +42,17 @@ def convert():
4142
4243 else :
4344 pass
44- hepdata_converter .convert (conversion_input + '/hepdata-converter-ws-data /' ,
45+ hepdata_converter .convert (conversion_input + '/' + archive_name + ' /' ,
4546 conversion_output ,
4647 kwargs .get ('options' , {}))
4748
4849 output_format = kwargs .get ('options' , {}).get ('output_format' , '' )
4950
5051 if not os .path .isdir (conversion_output ):
51- arcname = 'hepdata-converter-ws-data.' + output_format
52- else :
53- arcname = 'hepdata-converter-ws-data'
52+ archive_name = archive_name + '.' + output_format
5453
5554 with tarfile .open (mode = 'w:gz' , fileobj = output ) as tar :
56- tar .add (conversion_output , arcname = arcname )
55+ tar .add (conversion_output , arcname = archive_name )
5756
5857 finally :
5958 shutil .rmtree (tmp_dir , ignore_errors = True )
You can’t perform that action at this time.
0 commit comments