55 """ |
55 """ |
56 ext = os.path.splitext(module)[1].lower() |
56 ext = os.path.splitext(module)[1].lower() |
57 |
57 |
58 if ext in __extensions["IDL"]: |
58 if ext in __extensions["IDL"]: |
59 from . import idlclbr |
59 from . import idlclbr |
60 dict = idlclbr.readmodule_ex(module, path) |
60 dictionary = idlclbr.readmodule_ex(module, path) |
61 idlclbr._modules.clear() |
61 idlclbr._modules.clear() |
62 elif ext in __extensions["Ruby"]: |
62 elif ext in __extensions["Ruby"]: |
63 from . import rbclbr |
63 from . import rbclbr |
64 dict = rbclbr.readmodule_ex(module, path) |
64 dictionary = rbclbr.readmodule_ex(module, path) |
65 rbclbr._modules.clear() |
65 rbclbr._modules.clear() |
66 elif ext in __extensions["JavaScript"] and sys.version_info[0] == 3: |
66 elif ext in __extensions["JavaScript"] and sys.version_info[0] == 3: |
67 from . import jsclbr |
67 from . import jsclbr |
68 dict = jsclbr.readmodule_ex(module, path) |
68 dictionary = jsclbr.readmodule_ex(module, path) |
69 jsclbr._modules.clear() |
69 jsclbr._modules.clear() |
70 elif ext in Preferences.getPython("PythonExtensions") or \ |
70 elif ext in Preferences.getPython("PythonExtensions") or \ |
71 ext in Preferences.getPython("Python3Extensions") or \ |
71 ext in Preferences.getPython("Python3Extensions") or \ |
72 isPyFile: |
72 isPyFile: |
73 from . import pyclbr |
73 from . import pyclbr |
74 dict = pyclbr.readmodule_ex(module, path, isPyFile=isPyFile) |
74 dictionary = pyclbr.readmodule_ex(module, path, isPyFile=isPyFile) |
75 pyclbr._modules.clear() |
75 pyclbr._modules.clear() |
76 else: |
76 else: |
77 # try Python if it is without extension |
77 # try Python if it is without extension |
78 from . import pyclbr |
78 from . import pyclbr |
79 dict = pyclbr.readmodule_ex(module, path) |
79 dictionary = pyclbr.readmodule_ex(module, path) |
80 pyclbr._modules.clear() |
80 pyclbr._modules.clear() |
81 |
81 |
82 return dict |
82 return dictionary |
83 |
83 |
84 |
84 |
85 def find_module(name, path, isPyFile=False): |
85 def find_module(name, path, isPyFile=False): |
86 """ |
86 """ |
87 Module function to extend the Python module finding mechanism. |
87 Module function to extend the Python module finding mechanism. |