@@ -136,11 +136,8 @@ def complete(cursor_offset, line):
136136def find_modules (path ):
137137 """Find all modules (and packages) for a given directory."""
138138
139- global nameSubname
140- nameSubname = []
141-
142- #global pathNameList
143- #pathNameList = []
139+ #global nameSubname
140+ #nameSubname = []
144141
145142 if not os .path .isdir (path ):
146143 # Perhaps a zip file
@@ -199,28 +196,15 @@ def find_modules(path):
199196 else :
200197 if is_package :
201198 pathGood = True
202- #print("pathname:", pathname)
203- #for paths in pathNameList:
204- #print(paths)
205- #print("Hi")
206-
207- #if pathname == paths:
208- #pathGood = False
209- #break
210199
211200 pathList = re .split ("[/]" , pathname )
212201 #print("pathL length:", len(pathList))
213202 #for pathL in pathList:
214203 #print("pathL:", pathL)
215204
216- for folder in range (len (pathList )):
217- for folderT in range (len (pathList )):
218- #print("folder:", folder, "folderT:", folderT)
219- #print("Pathlist Folder:", pathList[folder], "Pathlist FolderT:", pathList[folderT])
220- if folder == folderT :
221- continue
222- elif pathList [folder ] == pathList [folderT ]:
223- pathGood = False
205+ for folder in range (len (pathList ) - 2 ):
206+ if pathList [folder ] == pathList [len (pathList ) - 1 ]:
207+ pathGood = False
224208 #print(pathGood)
225209 #print()
226210 if pathGood :
@@ -242,14 +226,10 @@ def find_modules(path):
242226 #print()
243227 #if not doNotAppend:
244228 #nameSubname.append((name, subname))
245- #print(name, subname)
246- yield "%s.%s" % (name , subname )
229+ print (name , subname )
230+ yield "%s.%s" % (name , subname )
231+ print (name )
247232 yield name
248- for obj in nameSubname :
249- #print(obj[0] + " " + obj[1])
250- pass
251- #print("PathNameList len:", len(pathNameList))
252-
253233
254234def find_all_modules (path = None ):
255235 """Return a list with all modules in `path`, which should be a list of
0 commit comments