[hg] galaxy 3166: Add error handling to upload's check_zip.
details: http://www.bx.psu.edu/hg/galaxy/rev/0ba4a2b77f65 changeset: 3166:0ba4a2b77f65 user: Greg Von Kuster <greg@bx.psu.edu> date: Wed Dec 09 16:20:12 2009 -0500 description: Add error handling to upload's check_zip. diffstat: lib/galaxy/datatypes/binary.py | 2 +- tools/data_source/upload.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diffs (27 lines): diff -r a1c6f236ab02 -r 0ba4a2b77f65 lib/galaxy/datatypes/binary.py --- a/lib/galaxy/datatypes/binary.py Wed Dec 09 15:44:10 2009 -0500 +++ b/lib/galaxy/datatypes/binary.py Wed Dec 09 16:20:12 2009 -0500 @@ -99,7 +99,7 @@ stderr_name = tempfile.NamedTemporaryFile( prefix = "bam_index_stderr" ).name command = 'samtools index %s %s' % ( dataset.file_name, index_file.file_name ) proc = subprocess.Popen( args=command, shell=True, stderr=open( stderr_name, 'wb' ) ) - + proc.wait() #Did index succeed? stderr = open( stderr_name ).read().strip() if stderr: diff -r a1c6f236ab02 -r 0ba4a2b77f65 tools/data_source/upload.py --- a/tools/data_source/upload.py Wed Dec 09 15:44:10 2009 -0500 +++ b/tools/data_source/upload.py Wed Dec 09 16:20:12 2009 -0500 @@ -118,7 +118,10 @@ # 1. Archives can only include .ab1, .scf or .txt files # 2. All file extensions within an archive must be the same name = zip_file.namelist()[0] - test_ext = name.split( "." )[1].strip().lower() + try: + test_ext = name.split( "." )[1].strip().lower() + except: + return ( True, False, None ) if not ( test_ext in unsniffable_binary_formats or test_ext == 'txt' ): return ( True, False, test_ext ) for name in zip_file.namelist():
participants (1)
-
Greg Von Kuster