Add support for .7z file extensions.
authorPat Downey <patd@symbian.org>
Fri, 02 Jul 2010 15:54:46 +0100
changeset 303 988ad79e9989
parent 302 c1b745b16f58
Add support for .7z file extensions.
downloadkit/downloadkit.py
--- a/downloadkit/downloadkit.py	Wed Jun 30 16:19:02 2010 +0100
+++ b/downloadkit/downloadkit.py	Fri Jul 02 15:54:46 2010 +0100
@@ -151,7 +151,7 @@
 		subzips = []
 		for line in filelist.readlines():
 			# Extracting  src_oss_app_webuis.zip
-			match = re.match(r"^Extracting\s+(\S+.zip)$", line)
+			match = re.match(r"^Extracting\s+(\S+.(7z|zip))$", line)
 			if match is None: continue
 			subzips.append(match.group(1))
 		topstatus = filelist.close()
@@ -481,7 +481,7 @@
 	# let's hope the HTML format never changes...
 	# <a href='download.php?id=27&cid=60&iid=270' title='src_oss_mw.zip'> ...</a> 
 	threadlist = []
-	results=soup.findAll('a', href=re.compile("^download"), title=re.compile("\.(zip|xml)$"))
+	results=soup.findAll('a', href=re.compile("^download"), title=re.compile("\.(7z|zip|xml)$"))
 	results.sort(orderResults)
 	for result in results:
 		downloadurl = urlbase + result['href']
@@ -493,7 +493,7 @@
 			continue 	# no winscw emulator...
 		if options.noarmv5 and re.search(r"armv5", filename) :
 			continue 	# no armv5 emulator...
-		if options.noarmv5 and options.nowinscw and re.search(r"binaries_epoc.zip|binaries_epoc_sdk", filename) :
+		if options.noarmv5 and options.nowinscw and re.search(r"binaries_epoc.(7z|zip)|binaries_epoc_sdk", filename) :
 			continue 	# skip binaries_epoc and binaries_sdk ...
 		if download_file(filename, downloadurl) != True :
 			failure_list.append(filename)
@@ -505,11 +505,11 @@
 			
 		if re.match(r"release_metadata", filename):
 			parse_release_metadata(filename)	# read the md5 checksums etc
-		elif re.match(r"(bin|tools).*\.zip", filename):
+		elif re.match(r"(bin|tools).*\.(7z|zip)", filename):
 			schedule_unzip(filename, 1, 0)   # unzip once, don't delete
-		elif re.match(r"src_.*\.zip", filename):
+		elif re.match(r"src_.*\.(7z|zip)", filename):
 			schedule_unzip(filename, 1, 1)   # zip of zips, delete top level
-		elif re.match(r"build_BOM.zip", filename):
+		elif re.match(r"build_BOM.(7z|zip)", filename):
 			schedule_unzip(filename, 1, 1)   # unpack then delete zip as it's not needed again
 
 	# wait for the unzipping threads to complete