mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Convert more things to Python 3 idioms
This commit is contained in:
@@ -106,7 +106,16 @@ class Project:
|
||||
with open(self._get_json_path(self._path), 'w') as f:
|
||||
return json.dump((_SERIALIZER_VERSION, data), f)
|
||||
|
||||
def __init__(self, path, **kwargs):
|
||||
def __init__(
|
||||
self,
|
||||
path,
|
||||
*,
|
||||
environment_path=None,
|
||||
load_unsafe_extensions=False,
|
||||
sys_path=None,
|
||||
added_sys_path=(),
|
||||
smart_sys_path=True,
|
||||
) -> None:
|
||||
"""
|
||||
:param path: The base path for this project.
|
||||
:param environment_path: The Python executable path, typically the path
|
||||
@@ -125,8 +134,7 @@ class Project:
|
||||
local directories. Otherwise you will have to rely on your packages
|
||||
being properly configured on the ``sys.path``.
|
||||
"""
|
||||
def py2_comp(path, environment_path=None, load_unsafe_extensions=False,
|
||||
sys_path=None, added_sys_path=(), smart_sys_path=True):
|
||||
|
||||
if isinstance(path, str):
|
||||
path = Path(path).absolute()
|
||||
self._path = path
|
||||
@@ -143,8 +151,6 @@ class Project:
|
||||
self.added_sys_path = list(map(str, added_sys_path))
|
||||
"""The sys path that is going to be added at the end of the """
|
||||
|
||||
py2_comp(path, **kwargs)
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
"""
|
||||
|
||||
@@ -106,10 +106,7 @@ def dbg(message, *args, color='GREEN'):
|
||||
debug_function(color, i + 'dbg: ' + message % tuple(repr(a) for a in args))
|
||||
|
||||
|
||||
def warning(message, *args, **kwargs):
|
||||
format = kwargs.pop('format', True)
|
||||
assert not kwargs
|
||||
|
||||
def warning(message, *args, format=True):
|
||||
if debug_function and enable_warning:
|
||||
i = ' ' * _debug_indent
|
||||
if format:
|
||||
|
||||
Reference in New Issue
Block a user