
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/ba00a72c8008/ Changeset: ba00a72c8008 User: greg Date: 2013-06-06 21:05:10 Summary: A slight variation on Nick Soranzo's pull request # 176 for fixing large file downloades using download_by_url. Affected #: 3 files diff -r 5de636ce68faededc52d7b0c16167fbef98be786 -r ba00a72c8008bdec310b69ccf980d374341f0113 lib/tool_shed/galaxy_install/tool_dependencies/common_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py @@ -222,9 +222,13 @@ dst = None try: src = urllib2.urlopen( download_url ) - data = src.read() - dst = open( file_path,'wb' ) - dst.write( data ) + dst = open( file_path, 'wb' ) + while True: + chunk = src.read( suc.CHUNK_SIZE ) + if chunk: + dst.write( chunk ) + else: + break except: raise finally: diff -r 5de636ce68faededc52d7b0c16167fbef98be786 -r ba00a72c8008bdec310b69ccf980d374341f0113 lib/tool_shed/util/commit_util.py --- a/lib/tool_shed/util/commit_util.py +++ b/lib/tool_shed/util/commit_util.py @@ -21,7 +21,6 @@ UNDESIRABLE_DIRS = [ '.hg', '.svn', '.git', '.cvs' ] UNDESIRABLE_FILES = [ '.hg_archival.txt', 'hgrc', '.DS_Store' ] -CHUNK_SIZE = 2**20 # 1Mb def check_archive( archive ): for member in archive.getmembers(): @@ -86,7 +85,7 @@ bzipped_file = bz2.BZ2File( uploaded_file_name, 'rb' ) while 1: try: - chunk = bzipped_file.read( CHUNK_SIZE ) + chunk = bzipped_file.read( suc.CHUNK_SIZE ) except IOError: os.close( fd ) os.remove( uncompressed ) @@ -170,7 +169,7 @@ gzipped_file = gzip.GzipFile( uploaded_file_name, 'rb' ) while 1: try: - chunk = gzipped_file.read( CHUNK_SIZE ) + chunk = gzipped_file.read( suc.CHUNK_SIZE ) except IOError, e: os.close( fd ) os.remove( uncompressed ) diff -r 5de636ce68faededc52d7b0c16167fbef98be786 -r ba00a72c8008bdec310b69ccf980d374341f0113 lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -29,6 +29,7 @@ log = logging.getLogger( __name__ ) +CHUNK_SIZE = 2**20 # 1Mb INITIAL_CHANGELOG_HASH = '000000000000' MAX_CONTENT_SIZE = 1048576 MAX_DISPLAY_SIZE = 32768 https://bitbucket.org/galaxy/galaxy-central/commits/68db2c690037/ Changeset: 68db2c690037 Branch: stable User: greg Date: 2013-06-06 21:05:10 Summary: A slight variation on Nick Soranzo's pull request # 176 for fixing large file downloades using download_by_url. Affected #: 3 files diff -r 2a1459ef5bc402c585f24c904e0d5ad82a7326db -r 68db2c6900376fb8b56dae6b501c68cb598fd153 lib/tool_shed/galaxy_install/tool_dependencies/common_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py @@ -222,9 +222,13 @@ dst = None try: src = urllib2.urlopen( download_url ) - data = src.read() - dst = open( file_path,'wb' ) - dst.write( data ) + dst = open( file_path, 'wb' ) + while True: + chunk = src.read( suc.CHUNK_SIZE ) + if chunk: + dst.write( chunk ) + else: + break except: raise finally: diff -r 2a1459ef5bc402c585f24c904e0d5ad82a7326db -r 68db2c6900376fb8b56dae6b501c68cb598fd153 lib/tool_shed/util/commit_util.py --- a/lib/tool_shed/util/commit_util.py +++ b/lib/tool_shed/util/commit_util.py @@ -21,7 +21,6 @@ UNDESIRABLE_DIRS = [ '.hg', '.svn', '.git', '.cvs' ] UNDESIRABLE_FILES = [ '.hg_archival.txt', 'hgrc', '.DS_Store' ] -CHUNK_SIZE = 2**20 # 1Mb def check_archive( archive ): for member in archive.getmembers(): @@ -86,7 +85,7 @@ bzipped_file = bz2.BZ2File( uploaded_file_name, 'rb' ) while 1: try: - chunk = bzipped_file.read( CHUNK_SIZE ) + chunk = bzipped_file.read( suc.CHUNK_SIZE ) except IOError: os.close( fd ) os.remove( uncompressed ) @@ -170,7 +169,7 @@ gzipped_file = gzip.GzipFile( uploaded_file_name, 'rb' ) while 1: try: - chunk = gzipped_file.read( CHUNK_SIZE ) + chunk = gzipped_file.read( suc.CHUNK_SIZE ) except IOError, e: os.close( fd ) os.remove( uncompressed ) diff -r 2a1459ef5bc402c585f24c904e0d5ad82a7326db -r 68db2c6900376fb8b56dae6b501c68cb598fd153 lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -29,6 +29,7 @@ log = logging.getLogger( __name__ ) +CHUNK_SIZE = 2**20 # 1Mb INITIAL_CHANGELOG_HASH = '000000000000' MAX_CONTENT_SIZE = 1048576 MAX_DISPLAY_SIZE = 32768 Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.