def _download_img(self):
gobject.idle_add(self.progwin.show)
fn = "%s.img" % self.rtype
try:
s = serial.Serial(port=self.rport,
baudrate=RADIOS[self.rtype].BAUD_RATE,
timeout=0.5)
radio = RADIOS[self.rtype](s)
radio.status_fn = self.update_status
radio.sync_in()
print "Sync done, saving to: %s" % fn
radio.save_mmap(fn)
self.refresh_radio()
except serial.SerialException, e:
gobject.idle_add(self.mainwin.set_status,
"Error: Unable to open serial port")
except Exception, e:
gobject.idle_add(self.mainwin.set_status,
"Error: %s" % e)
try:
s.close()
except Exception:
pass
gobject.idle_add(self.progwin.hide)
评论列表
文章目录