Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

You can now have an already unpacked image file #6

Merged
merged 1 commit into from

2 participants

@alecthegeek

You can now have an upacked img file and it will get used if you
specify the correct filename (ending in .img)

@alecthegeek alecthegeek Added support for .img files
You can now have an upacked img file and it will get used if you
specify the correct filename (ending in .img)
1312dc6
@exaviorn exaviorn merged commit f6c034d into exaviorn:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 14, 2012
  1. @alecthegeek

    Added support for .img files

    alecthegeek authored
    You can now have an upacked img file and it will get used if you
    specify the correct filename (ending in .img)
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 1 deletion.
  1. +10 −1 raspiwrite.py
View
11 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
+ driveTest(SD) #action gets delegated to driveTest, which then leads on to the next step, I found this to be the easiest way
Something went wrong with that request. Please try again.