[gnoduino] fix bootloader burning
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnoduino] fix bootloader burning
- Date: Fri, 6 Apr 2012 20:22:03 +0000 (UTC)
commit 3dcb3212484c3fb39a9653069a55f3c3560893ad
Author: Lucian Langa <lucilanga gnome org>
Date: Fri Apr 6 21:58:43 2012 +0200
fix bootloader burning
src/programmer.py | 12 +++++++++---
src/ui.py | 6 +++---
2 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/programmer.py b/src/programmer.py
index f067908..259be09 100644
--- a/src/programmer.py
+++ b/src/programmer.py
@@ -73,16 +73,22 @@ class Programmer(object):
return config.cur_programmer
def getCommunication(self, id):
- return self.programmers[id]['communication']
+ try:
+ return self.programmers[id]['communication']
+ except KeyError: return ""
def getProtocol(self, id):
return self.programmers[id]['protocol']
def getSpeed(self, id):
- return self.programmers[id]['speed']
+ try:
+ return self.programmers[id]['speed']
+ except KeyError: return 0
def getForce(self, id):
- return self.programmers[id]['force']
+ try:
+ return self.programmers[id]['force']
+ except KeyError: return "false"
def setProgrammer(self, id):
config.cur_programmer = (id - 1)
diff --git a/src/ui.py b/src/ui.py
index fdad5c2..2d403b9 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -378,9 +378,9 @@ def cserial(w, st, data=None):
vbox.remove(scon)
vbox.add(con)
-def burnBootloader(w, id):
+def burnBootloader(w):
startSpinner()
- uploader.burnBootloader(ser, tw, sb, id)
+ uploader.burnBootloader(ser, tw, sb, pgm.getProgrammer())
stopSpinner()
def setBaud(w, data=None):
@@ -818,7 +818,7 @@ def run():
menuItem.connect('activate', selectProgrammer, i['id'])
sub.append(menuItem)
gui.get_object("programmer").set_submenu(sub)
- gui.get_object("burn").connect('activate', burnBootloader, sub)
+ gui.get_object("burn").connect('activate', burnBootloader)
nb = gtk.Notebook()
nb.connect("switch-page", setupPage)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]