From: <lu...@us...> - 2008-09-15 12:54:38
|
Revision: 241 http://s3tools.svn.sourceforge.net/s3tools/?rev=241&view=rev Author: ludvigm Date: 2008-09-15 12:54:36 +0000 (Mon, 15 Sep 2008) Log Message: ----------- * Merge from trunk, revision 240: * S3/S3.py: Don't run into ZeroDivisionError when speed counter returns 0s elapsed on upload/download file Revision Links: -------------- http://s3tools.svn.sourceforge.net/s3tools/?rev=240&view=rev Modified Paths: -------------- s3cmd/branches/0.9.8.x/ChangeLog s3cmd/branches/0.9.8.x/S3/S3.py Modified: s3cmd/branches/0.9.8.x/ChangeLog =================================================================== --- s3cmd/branches/0.9.8.x/ChangeLog 2008-09-15 12:51:41 UTC (rev 240) +++ s3cmd/branches/0.9.8.x/ChangeLog 2008-09-15 12:54:36 UTC (rev 241) @@ -1,3 +1,9 @@ +2008-09-16 Michal Ludvig <mi...@lo...> + + * Merge from trunk, revision 240: + * S3/S3.py: Don't run into ZeroDivisionError when speed counter + returns 0s elapsed on upload/download file + 2008-09-15 Michal Ludvig <mi...@lo...> * Merge from trunk, revision 238: Modified: s3cmd/branches/0.9.8.x/S3/S3.py =================================================================== --- s3cmd/branches/0.9.8.x/S3/S3.py 2008-09-15 12:51:41 UTC (rev 240) +++ s3cmd/branches/0.9.8.x/S3/S3.py 2008-09-15 12:54:36 UTC (rev 241) @@ -362,7 +362,7 @@ size_left -= len(data) if throttle: time.sleep(throttle) - info("Sent %d bytes (%d %% of %d)" % ( + debug("Sent %d bytes (%d %% of %d)" % ( (size_total - size_left), (size_total - size_left) * 100 / size_total, size_total)) @@ -376,7 +376,7 @@ response["data"] = http_response.read() response["elapsed"] = timestamp_end - timestamp_start response["size"] = size_total - response["speed"] = float(response["size"]) / response["elapsed"] + response["speed"] = response["elapsed"] and float(response["size"]) / response["elapsed"] or float(-1) conn.close() if response["status"] == 307: @@ -445,7 +445,7 @@ stream.write(data) md5_hash.update(data) size_recvd += len(data) - info("Received %d bytes (%d %% of %d)" % ( + debug("Received %d bytes (%d %% of %d)" % ( size_recvd, size_recvd * 100 / size_total, size_total)) @@ -455,7 +455,7 @@ response["md5match"] = response["headers"]["etag"].find(response["md5"]) >= 0 response["elapsed"] = timestamp_end - timestamp_start response["size"] = size_recvd - response["speed"] = float(response["size"]) / response["elapsed"] + response["speed"] = response["elapsed"] and float(response["size"]) / response["elapsed"] or float(-1) if response["size"] != long(response["headers"]["content-length"]): warning("Reported size (%s) does not match received size (%s)" % ( response["headers"]["content-length"], response["size"])) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |