Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions raspiwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '...'

Expand All @@ -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':
Expand Down Expand Up @@ -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###################################################################'
Expand Down