forked from VimPlug/jedi
Better handling of smart sys path
This commit is contained in:
@@ -93,16 +93,20 @@ class Project(object):
|
|||||||
Keep this method private for all users of jedi. However internally this
|
Keep this method private for all users of jedi. However internally this
|
||||||
one is used like a public method.
|
one is used like a public method.
|
||||||
"""
|
"""
|
||||||
sys_path = list(self._get_base_sys_path(environment))
|
suffixed = []
|
||||||
if evaluator.script_path is None or not self._smart_sys_path:
|
|
||||||
return sys_path
|
|
||||||
|
|
||||||
prefixed = []
|
prefixed = []
|
||||||
|
|
||||||
|
sys_path = list(self._get_base_sys_path(environment))
|
||||||
if self._smart_sys_path:
|
if self._smart_sys_path:
|
||||||
|
if evaluator.script_path is not None:
|
||||||
|
suffixed += detect_additional_paths(evaluator, evaluator.script_path)
|
||||||
|
|
||||||
|
suffixed.append(self._path)
|
||||||
|
|
||||||
if self._django:
|
if self._django:
|
||||||
prefixed.append(self._path)
|
prefixed.append(self._path)
|
||||||
added_paths = detect_additional_paths(evaluator, evaluator.script_path)
|
|
||||||
return _force_unicode_list(prefixed) + sys_path + _force_unicode_list(added_paths)
|
return _force_unicode_list(prefixed) + sys_path + _force_unicode_list(suffixed)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
data = dict(self.__dict__)
|
data = dict(self.__dict__)
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ def detect_additional_paths(evaluator, script_path):
|
|||||||
for path in _get_paths_from_buildout_script(evaluator, buildout_script_path):
|
for path in _get_paths_from_buildout_script(evaluator, buildout_script_path):
|
||||||
buildout_script_paths.add(path)
|
buildout_script_paths.add(path)
|
||||||
|
|
||||||
return list(buildout_script_paths)
|
return buildout_script_paths
|
||||||
|
|
||||||
|
|
||||||
def _get_paths_from_buildout_script(evaluator, buildout_script_path):
|
def _get_paths_from_buildout_script(evaluator, buildout_script_path):
|
||||||
|
|||||||
Reference in New Issue
Block a user