mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-19 23:09:43 +08:00
Remove a function that is no longer needed
This commit is contained in:
@@ -96,23 +96,10 @@ class ModuleContext(TreeContext):
|
|||||||
# All the additional module attributes are strings.
|
# All the additional module attributes are strings.
|
||||||
return dict((n, _ModuleAttributeName(self, n)) for n in names)
|
return dict((n, _ModuleAttributeName(self, n)) for n in names)
|
||||||
|
|
||||||
@property
|
|
||||||
def _string_name(self):
|
|
||||||
""" This is used for the goto functions. """
|
|
||||||
# TODO It's ugly that we even use this, the name is usually well known
|
|
||||||
# ahead so just pass it when create a ModuleContext.
|
|
||||||
if self._path is None:
|
|
||||||
return '' # no path -> empty name
|
|
||||||
else:
|
|
||||||
sep = (re.escape(os.path.sep),) * 2
|
|
||||||
r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path)
|
|
||||||
# Remove PEP 3149 names
|
|
||||||
return re.sub(r'\.[a-z]+-\d{2}[mud]{0,3}$', '', r.group(1))
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@evaluator_method_cache()
|
@evaluator_method_cache()
|
||||||
def name(self):
|
def name(self):
|
||||||
return ModuleName(self, self._string_name)
|
return ModuleName(self, self.py__name__())
|
||||||
|
|
||||||
def _get_init_directory(self):
|
def _get_init_directory(self):
|
||||||
"""
|
"""
|
||||||
@@ -221,7 +208,7 @@ class ModuleContext(TreeContext):
|
|||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<%s: %s@%s-%s is_stub=%s>" % (
|
return "<%s: %s@%s-%s is_stub=%s>" % (
|
||||||
self.__class__.__name__, self._string_name,
|
self.__class__.__name__, self.py__name__(),
|
||||||
self.tree_node.start_pos[0], self.tree_node.end_pos[0],
|
self.tree_node.start_pos[0], self.tree_node.end_pos[0],
|
||||||
self._path is not None and self._path.endswith('.pyi')
|
self._path is not None and self._path.endswith('.pyi')
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user