36 "JavaScript": [".js"], |
36 "JavaScript": [".js"], |
37 } |
37 } |
38 |
38 |
39 |
39 |
40 def readmodule(module, path=[], isPyFile=False): |
40 def readmodule(module, path=[], isPyFile=False): |
41 ''' |
41 """ |
42 Read a source file and return a dictionary of classes, functions, modules, etc. . |
42 Read a source file and return a dictionary of classes, functions, modules, |
|
43 etc. . |
43 |
44 |
44 The real work of parsing the source file is delegated to the individual file |
45 The real work of parsing the source file is delegated to the individual |
45 parsers. |
46 file parsers. |
46 |
47 |
47 @param module name of the source file (string) |
48 @param module name of the source file (string) |
48 @param path path the file should be searched in (list of strings) |
49 @param path path the file should be searched in (list of strings) |
|
50 @param isPyFile flag indicating a Python file (boolean) |
49 @return the resulting dictionary |
51 @return the resulting dictionary |
50 ''' |
52 """ |
51 ext = os.path.splitext(module)[1].lower() |
53 ext = os.path.splitext(module)[1].lower() |
52 |
54 |
53 if ext in __extensions["IDL"]: |
55 if ext in __extensions["IDL"]: |
54 from . import idlclbr |
56 from . import idlclbr |
55 dict = idlclbr.readmodule_ex(module, path) |
57 dict = idlclbr.readmodule_ex(module, path) |
86 implemented in the imp module is used. For all other supported files |
88 implemented in the imp module is used. For all other supported files |
87 only path is searched. |
89 only path is searched. |
88 |
90 |
89 @param name filename or modulename to search for (string) |
91 @param name filename or modulename to search for (string) |
90 @param path search path (list of strings) |
92 @param path search path (list of strings) |
|
93 @param isPyFile flag indicating a Python file (boolean) |
91 @return tuple of the open file, pathname and description. Description |
94 @return tuple of the open file, pathname and description. Description |
92 is a tuple of file suffix, file mode and file type) |
95 is a tuple of file suffix, file mode and file type) |
93 @exception ImportError The file or module wasn't found. |
96 @exception ImportError The file or module wasn't found. |
94 """ |
97 """ |
95 ext = os.path.splitext(name)[1].lower() |
98 ext = os.path.splitext(name)[1].lower() |