[gnoduino] more example parsing fixes



commit 95f705a7f59a7b27760c1f208f553df0c8fdd0d5
Author: Lucian Langa <lucilanga gnome org>
Date:   Sun Apr 8 23:10:27 2012 +0200

    more example parsing fixes

 src/ui.py |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/ui.py b/src/ui.py
index a585ed3..28ce761 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -691,13 +691,9 @@ def populateExamples():
 		paths.extend(i.strip() for i in config.user_library.split(';'))
 	for p in paths:
 		if os.path.exists(p):
-			d = os.listdir(p)
-		else: continue
-		q = []
-		for i in d:
-			f = os.path.join(p, i)
-			if os.path.isdir(os.path.join(f, "examples")):
-				q.append(f)
+			q = []
+			if os.path.isdir(os.path.join(p, "examples")):
+				q.append(p)
 		for c in sorted(q): populateExampleLine(c, submenu)
 	ex = gtk.MenuItem(_("E_xamples"), use_underline=True)
 	ex.set_submenu(submenu)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]