| 1 |
"""
|
| 2 |
|
| 3 |
ZipSize.py
|
| 4 |
|
| 5 |
Created by
|
| 6 |
Emanuel Borges
|
| 7 |
11.28.2012
|
| 8 |
|
| 9 |
This program will return the uncompressed size of a zip file. This will actually run on LN and be called
|
| 10 |
through expedat."""
|
| 11 |
|
| 12 |
import zipfile, sys
|
| 13 |
|
| 14 |
def GetZipSize(zipFile):
|
| 15 |
tempZipSize = 0
|
| 16 |
tempZip = zipfile.ZipFile(zipFile,'r')
|
| 17 |
for zipInfo in tempZip.infolist():
|
| 18 |
tempZipSize = tempZipSize + zipInfo.file_size
|
| 19 |
tempZip.close()
|
| 20 |
return tempZipSize
|
| 21 |
#totalSize.inc(tempZipSize)
|
| 22 |
|
| 23 |
if __name__=="__main__":
|
| 24 |
zipFile = sys.argv[1]
|
| 25 |
size = GetZipSize(zipFile)
|
| 26 |
print size |