From ba873dd63c21db21b0cec3430ef0aa691ff93878 Mon Sep 17 00:00:00 2001 From: lisa ballard Date: Sat, 20 Oct 2012 12:24:46 -0700 Subject: [PATCH 1/2] fixed a couple of syntax and spacing errors --- raspiwrite.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/raspiwrite.py b/raspiwrite.py index 054f93a..e2036ea 100755 --- a/raspiwrite.py +++ b/raspiwrite.py @@ -174,7 +174,7 @@ def run ( self ): global path if OS[0] != 'Darwin': copyString = 'dd bs=1M if=%s of=%s' % (path,SDsnip) - else + else: copyString = 'dd bs=1m if=%s of=%s' % (path,SDsnip) print 'Running ' + copyString + '...' @@ -270,12 +270,12 @@ def transfer(file,archiveType,obtain,SD,URL): #unzips the disk image global SDsnip if (SD.find("/dev/mmcblk") + 1): SDsnip = "/dev/mmcblk" + SD[11] - else: + else: if OS[0] != 'Darwin': - SDsnip = SD.replace(' ', '')[:-1] + SDsnip = SD.replace(' ', '')[:-1] else: # remove weird partition notation in OS X partition names - SDsnip = SD.replace(' ', '')[:-2] + SDsnip = SD.replace(' ', '')[:-2] print path print '\n\n###################################################################' From 90344b1fd60f9834af39244a6635aa73d71247ce Mon Sep 17 00:00:00 2001 From: kotiya Date: Fri, 26 Oct 2012 13:17:55 -0700 Subject: [PATCH 2/2] Update raspiwrite.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The img unzip from .zip is in the same location as zip file. Tested on official image of Raspbian “wheezy”.   --- raspiwrite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/raspiwrite.py b/raspiwrite.py index e2036ea..784077c 100755 --- a/raspiwrite.py +++ b/raspiwrite.py @@ -186,7 +186,7 @@ def transfer(file,archiveType,obtain,SD,URL): #unzips the disk image global path if archiveType == 'zip': #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 + path = file.replace(".zip", ".img") #Thanks to Lewis Boon extractCMD = 'unzip ' + file if archiveType == 'img':