1
0
forked from VimPlug/jedi

Progress when working with evaluators

This commit is contained in:
Dave Halter
2017-11-17 01:21:38 +01:00
parent 4136dcaf08
commit 73576b2a8b
5 changed files with 134 additions and 24 deletions

View File

@@ -1,5 +1,23 @@
import sys
from jedi.evaluate import compiled
def get_sys_path():
return sys.path
def import_module(evaluator, handles, path=None, name=None):
compiled_object = compiled.load_module(evaluator, path=path, name=name)
if compiled_object is None:
return None
return handles.create(compiled_object)
def get_compiled_property(evaluator, handles, id, attribute):
compiled_object = handles.get_compiled_object(id)
return getattr(compiled_object, attribute)
def get_compiled_method_return(evaluator, handles, id, attribute, *args, **kwargs):
compiled_object = handles.get_compiled_object(id)
return getattr(compiled_object, attribute)(*args, **kwargs)