Utilities/ClassBrowsers/__init__.py

changeset 5651
982465f8389c
parent 5604
b047181a4a33
child 5977
8a0ec75b0f73
equal deleted inserted replaced
5650:4c52f07c186e 5651:982465f8389c
38 "Ruby": [".rb"], 38 "Ruby": [".rb"],
39 "JavaScript": [".js"], 39 "JavaScript": [".js"],
40 } 40 }
41 41
42 42
43 def readmodule(module, path=[], isPyFile=False): 43 def readmodule(module, path=None, isPyFile=False):
44 """ 44 """
45 Read a source file and return a dictionary of classes, functions, modules, 45 Read a source file and return a dictionary of classes, functions, modules,
46 etc. . 46 etc. .
47 47
48 The real work of parsing the source file is delegated to the individual 48 The real work of parsing the source file is delegated to the individual
52 @param path path the file should be searched in (list of strings) 52 @param path path the file should be searched in (list of strings)
53 @param isPyFile flag indicating a Python file (boolean) 53 @param isPyFile flag indicating a Python file (boolean)
54 @return the resulting dictionary 54 @return the resulting dictionary
55 """ 55 """
56 ext = os.path.splitext(module)[1].lower() 56 ext = os.path.splitext(module)[1].lower()
57 path = [] if path is None else path[:]
57 58
58 if ext in __extensions["IDL"]: 59 if ext in __extensions["IDL"]:
59 from . import idlclbr 60 from . import idlclbr
60 dictionary = idlclbr.readmodule_ex(module, path) 61 dictionary = idlclbr.readmodule_ex(module, path)
61 idlclbr._modules.clear() 62 idlclbr._modules.clear()

eric ide

mercurial