Created
November 12, 2012 11:44
-
-
Save symm/4058889 to your computer and use it in GitHub Desktop.
Hack in Zip file support to gromlist (http://mundogeek.net/gromlist/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /usr/lib/gromlist/gromlist.py 2012-11-12 11:36:55.697698407 +0000 | |
+++ gromlist.py 2012-11-12 11:41:32.703071996 +0000 | |
@@ -1,4 +1,4 @@ | |
-#!/usr/bin/env python | |
+#:!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
### | |
# | |
@@ -1047,8 +1047,21 @@ | |
# Calculate the CRC of the files in the rom folder | |
statusbar.push(statusbar.get_context_id("Calculating CRC"), _("Calculating CRC")) | |
crcs = {} | |
-for rom_file in os.listdir(rom_folder): | |
- crcs[get_crc(rom_folder + "/" + rom_file)] = rom_folder + "/" + rom_file | |
+zfile = ZipFile | |
+for root,dirs,files in os.walk(rom_folder): | |
+ for f in files: | |
+ fullpath = os.path.join(root,f) | |
+ if os.path.splitext(f)[1] == ".zip": | |
+ zfile = ZipFile(fullpath) | |
+ for info in zfile.infolist(): | |
+ if os.path.splitext(info.filename)[1] == ".nds": | |
+ crcs["%X" % info.CRC] = fullpath | |
+ zfile.close() | |
+ elif os.path.splitext(fullpath)[1] == ".nds": | |
+ crcs[get_crc(fullpath)] = fullpath | |
+ elif os.path.splitext(fullpath)[1] == ".rar": | |
+ print "DEBUG: %s rar not supported yet..." % fullpath | |
+ | |
# Search for the dat to load by default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment