diff --git a/raspiwrite.py b/raspiwrite.py index eeb6eb4..4061a68 100755 --- a/raspiwrite.py +++ b/raspiwrite.py @@ -178,6 +178,11 @@ def transfer(file,archiveType,obtain,SD,URL): #unzips the disk image #path = file.replace(".zip", "") + '/' + file.replace(".zip", ".img") <- my old code path = file.replace(".zip", "") + '/' + os.path.basename(file).replace(".zip", ".img") #Thanks to Lewis Boon extractCMD = 'unzip ' + file + + if archiveType == 'img': + path = file; + extractCMD = 'echo No extracttion required for ' + file + if archiveType == 'gz': path = file.replace(".gz", "") #<-- verify extractCMD = 'gunzip ' + file @@ -338,7 +343,11 @@ def getImage(SD): #gives the user a bunch of options to download an image, or se matchZip = re.match('^.*\.zip$',userLocate) matchGzip = re.match('^.*\.img.gz$',userLocate) matchBzip = re.match('^.*\.tar.bz2$',userLocate) + matchImg = re.match('^.*\.img$',userLocate) + if matchImg is not None: + print 'Found Image file' + transfer(userLocate,'img','usr',SD,'none') if matchZip is not None: print 'Found Zip' transfer(userLocate,'zip','usr',SD,'none') @@ -426,4 +435,4 @@ def driveTest(SD): driveTest(manualID) else: #otherwise... SD = matchSD(volumes).group(1) #selects the first SD/USB drive located - driveTest(SD) #action gets delegated to driveTest, which then leads on to the next step, I found this to be the easiest way \ No newline at end of file + driveTest(SD) #action gets delegated to driveTest, which then leads on to the next step, I found this to be the easiest way