MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / Find

Function Find

_pydev_bundle/_pydev_imports_tipper.py:88–120  ·  view source on GitHub ↗
(name, log=None)

Source from the content-addressed store, hash-verified

86
87
88def Find(name, log=None):
89 f = None
90
91 mod = _imp(name, log)
92 parent = mod
93 foundAs = ""
94
95 if inspect.ismodule(mod):
96 f = get_file(mod)
97
98 components = name.split(".")
99
100 old_comp = None
101 for comp in components[1:]:
102 try:
103 # this happens in the following case:
104 # we have mx.DateTime.mxDateTime.mxDateTime.pyd
105 # but after importing it, mx.DateTime.mxDateTime shadows access to mxDateTime.pyd
106 mod = getattr(mod, comp)
107 except AttributeError:
108 if old_comp != comp:
109 raise
110
111 if inspect.ismodule(mod):
112 f = get_file(mod)
113 else:
114 if len(foundAs) > 0:
115 foundAs = foundAs + "."
116 foundAs = foundAs + comp
117
118 old_comp = comp
119
120 return f, mod, parent, foundAs
121
122
123def search_definition(data):

Callers 2

search_definitionFunction · 0.70
generate_tipFunction · 0.70

Calls 2

get_fileFunction · 0.85
_impFunction · 0.70

Tested by

no test coverage detected