Morpheus / Mbed OS mbed-Client-Morpheus-hg

Dependencies:   mbed-os

Revision:
9:6066c45a1655
Parent:
8:1a673572accd
Child:
10:dc8f1363b424
--- a/neo.py	Wed Mar 30 00:30:25 2016 -0500
+++ b/neo.py	Wed Mar 30 00:46:39 2016 -0500
@@ -67,12 +67,19 @@
         os.chdir(prevdir)
 
 def iterlibs(dir=None):
-    for file in os.listdir(dir or os.getcwd()):
-        if file.startswith('.'):
+    for root, dirs, files in os.walk(dir or os.getcwd()):
+        if os.path.basename(root).startswith('.'):
+            del dirs[:]
             continue
-        elif os.path.isfile(file) and file.endswith('.lib'):
-            with open(file) as f:
-                yield f.read().strip(), file[:-4]
+
+        for file in files:
+            if file.startswith('.'):
+                continue
+            elif file.endswith('.lib'):
+                with open(os.path.join(root, file)) as f:
+                    yield f.read().strip(), os.path.join(root, file[:-4])
+                if file[:-4] in dirs:
+                    dirs.remove(file[:-4])
 
 def savelib(repo):
     print repo.name, '->', repo.url