[gnoduino] fix reading custom items
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnoduino] fix reading custom items
- Date: Sat, 24 Mar 2012 22:56:34 +0000 (UTC)
commit d1e80a17ccc101f1e3e178dcad00d0a3f48e732c
Author: Lucian Langa <lucilanga gnome org>
Date: Sat Mar 24 23:54:39 2012 +0100
fix reading custom items
src/board.py | 4 +++-
src/programmer.py | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/board.py b/src/board.py
index d7f1ad4..4469ba7 100644
--- a/src/board.py
+++ b/src/board.py
@@ -54,12 +54,14 @@ class Board(object):
return misc.readArduinoConfFile(misc.getArduinoFile("hardware/arduino/boards.txt"))
def readCustomBoards(self):
+ custom = []
p = prefs.preferences()
d = os.path.join(p.getValue("sketchbook.path"), "hardware")
try:
for i in os.listdir(d):
if os.path.exists(os.path.join(d, i, "boards.txt")):
- return misc.readArduinoConfFile(os.path.join(d, i, "boards.txt"))
+ custom.extend(misc.readArduinoConfFile(os.path.join(d, i, "boards.txt")))
+ return custom
except: return None
def getBoards(self):
diff --git a/src/programmer.py b/src/programmer.py
index ec8e51a..f067908 100644
--- a/src/programmer.py
+++ b/src/programmer.py
@@ -56,12 +56,14 @@ class Programmer(object):
return misc.readArduinoConfFile(misc.getArduinoFile("hardware/arduino/programmers.txt"))
def readCustomProgrammers(self):
+ custom = []
p = prefs.preferences()
d = os.path.join(p.getValue("sketchbook.path"), "hardware")
try:
for i in os.listdir(d):
if os.path.exists(os.path.join(d, i, "programmers.txt")):
- return misc.readArduinoConfFile(os.path.join(d, i, "programmers.txt"))
+ custom.extend(misc.readArduinoConfFile(os.path.join(d, i, "programmers.txt")))
+ return custom
except: return None
def getProgrammers(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]