summaryrefslogtreecommitdiffstats
path: root/get-google-files
diff options
context:
space:
mode:
authorctso <ctsoyars@gmail.com>2010-06-30 05:52:16 +0000
committerctso <ctsoyars@gmail.com>2010-06-30 06:33:27 +0000
commita73c687596c2fd66afb50aac1844d2c3e5a5fcd3 (patch)
treee90a65963e1de31cb17adb948110834f317e760c /get-google-files
parent042f09fa0faef673968b3ed753f23fc9b752548b (diff)
downloadvendor_replicant-a73c687596c2fd66afb50aac1844d2c3e5a5fcd3.zip
vendor_replicant-a73c687596c2fd66afb50aac1844d2c3e5a5fcd3.tar.gz
vendor_replicant-a73c687596c2fd66afb50aac1844d2c3e5a5fcd3.tar.bz2
More get-google-files bugfixes.
Diffstat (limited to 'get-google-files')
-rwxr-xr-xget-google-files11
1 files changed, 7 insertions, 4 deletions
diff --git a/get-google-files b/get-google-files
index 153f9f4..fa3c561 100755
--- a/get-google-files
+++ b/get-google-files
@@ -15,7 +15,6 @@ def download():
os.makedirs("proprietary")
except:
pass
- os.chdir("proprietary")
if len(MIRRORS) > 1:
i = random.randrange(0, len(MIRRORS)-1)
else:
@@ -27,11 +26,15 @@ def download():
zip = zipfile.ZipFile(StringIO.StringIO(data),'r')
for filename in zip.namelist():
- if filename.split("/")[0] == "system":
+ if filename.split("/")[0] == "system" and filename[-1] != "/":
print "Extracting %s" % filename
try:
- zip.extract(filename)
- except:
+ bytes = zip.read(filename)
+ fd = open("proprietary/"+os.path.basename(filename),"wb")
+ fd.write(bytes)
+ fd.close()
+ except Exception, e:
+ print e
pass
def main():