diff --git a/README.rst b/README.rst index 38f29d6d..d698bc7c 100644 --- a/README.rst +++ b/README.rst @@ -45,7 +45,7 @@ Jedi can currently be used with the following editors/projects: - Gedit (gedi_) - wdb_ - Web Debugger - `Eric IDE`_ (Available as a plugin) -- `Ipython 6.0.0+ `_ +- `Ipython 6.0.0+ `_ and many more! @@ -72,7 +72,7 @@ Get the latest version from `github `_ Docs are available at `https://jedi.readthedocs.org/en/latest/ `_. Pull requests with documentation enhancements and/or fixes are awesome and most welcome. Jedi uses `semantic -versioning `_. +versioning `_. Installation @@ -193,7 +193,7 @@ Acknowledgements .. _jedi-vim: https://github.com/davidhalter/jedi-vim -.. _youcompleteme: http://valloric.github.io/YouCompleteMe/ +.. _youcompleteme: https://valloric.github.io/YouCompleteMe/ .. _deoplete-jedi: https://github.com/zchee/deoplete-jedi .. _completor.vim: https://github.com/maralla/completor.vim .. _Jedi.el: https://github.com/tkf/emacs-jedi @@ -205,11 +205,11 @@ Acknowledgements .. _anaconda: https://github.com/DamnWidget/anaconda .. _wdb: https://github.com/Kozea/wdb .. _TextMate: https://github.com/lawrenceakka/python-jedi.tmbundle -.. _Kate: http://kate-editor.org +.. _Kate: https://kate-editor.org .. _Atom: https://atom.io/ .. _autocomplete-python-jedi: https://atom.io/packages/autocomplete-python-jedi .. _SourceLair: https://www.sourcelair.com .. _GNOME Builder: https://wiki.gnome.org/Apps/Builder .. _Visual Studio Code: https://code.visualstudio.com/ .. _gedi: https://github.com/isamert/gedi -.. _Eric IDE: http://eric-ide.python-projects.org +.. _Eric IDE: https://eric-ide.python-projects.org diff --git a/docs/_templates/ghbuttons.html b/docs/_templates/ghbuttons.html index badb06af..07292e1f 100644 --- a/docs/_templates/ghbuttons.html +++ b/docs/_templates/ghbuttons.html @@ -1,4 +1,4 @@

Github

-

diff --git a/docs/conf.py b/docs/conf.py index 0e25a883..37ae0642 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -274,7 +274,7 @@ autodoc_default_flags = [] # -- Options for intersphinx module -------------------------------------------- intersphinx_mapping = { - 'http://docs.python.org/': None, + 'https://docs.python.org/': None, } diff --git a/docs/docs/features.rst b/docs/docs/features.rst index aef32708..ad4e900c 100644 --- a/docs/docs/features.rst +++ b/docs/docs/features.rst @@ -157,7 +157,7 @@ are planned, others might be hard to implement and provide little worth): **Sphinx style** -http://sphinx-doc.org/domains.html#info-field-lists +http://www.sphinx-doc.org/en/stable/domains.html#info-field-lists :: diff --git a/docs/docs/installation.rst b/docs/docs/installation.rst index 80ad54d4..9058cf55 100644 --- a/docs/docs/installation.rst +++ b/docs/docs/installation.rst @@ -49,7 +49,7 @@ Debian ~~~~~~ Debian packages are available in the `unstable repository -`__. +`__. Others ~~~~~~ diff --git a/docs/docs/usage.rst b/docs/docs/usage.rst index 243c62b8..63a8ddf1 100644 --- a/docs/docs/usage.rst +++ b/docs/docs/usage.rst @@ -103,7 +103,7 @@ Using a custom ``$HOME/.pythonrc.py`` .. autofunction:: jedi.utils.setup_readline .. _jedi-vim: https://github.com/davidhalter/jedi-vim -.. _youcompleteme: http://valloric.github.io/YouCompleteMe/ +.. _youcompleteme: https://valloric.github.io/YouCompleteMe/ .. _deoplete-jedi: https://github.com/zchee/deoplete-jedi .. _Jedi.el: https://github.com/tkf/emacs-jedi .. _elpy: https://github.com/jorgenschaefer/elpy @@ -113,10 +113,10 @@ Using a custom ``$HOME/.pythonrc.py`` .. _SynJedi: http://uvviewsoft.com/synjedi/ .. _wdb: https://github.com/Kozea/wdb .. _TextMate: https://github.com/lawrenceakka/python-jedi.tmbundle -.. _kate: http://kate-editor.org/ +.. _kate: https://kate-editor.org/ .. _autocomplete-python-jedi: https://atom.io/packages/autocomplete-python-jedi .. _SourceLair: https://www.sourcelair.com .. _GNOME Builder: https://wiki.gnome.org/Apps/Builder/ .. _gedi: https://github.com/isamert/gedi -.. _Eric IDE: http://eric-ide.python-projects.org +.. _Eric IDE: https://eric-ide.python-projects.org .. _Python Extension: https://marketplace.visualstudio.com/items?itemName=donjayamanne.python diff --git a/docs/index.rst b/docs/index.rst index 19c0706e..de92fa72 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -37,4 +37,4 @@ Resources - `Source Code on Github `_ - `Travis Testing `_ -- `Python Package Index `_ +- `Python Package Index `_ diff --git a/jedi/evaluate/imports.py b/jedi/evaluate/imports.py index fb328ef7..320f5e17 100644 --- a/jedi/evaluate/imports.py +++ b/jedi/evaluate/imports.py @@ -257,7 +257,7 @@ class Importer(object): # Since we know nothing about the call location of the sys.path, # it's a possibility that the current directory is the origin of # the Python execution. - sys_path_mod.insert(0, force_unicode(os.path.dirname(self.file_path))) + sys_path_mod.append(force_unicode(os.path.dirname(self.file_path))) return in_path + sys_path_mod diff --git a/jedi/refactoring.py b/jedi/refactoring.py index 93420f2b..86f60414 100644 --- a/jedi/refactoring.py +++ b/jedi/refactoring.py @@ -53,9 +53,8 @@ class Refactoring(object): def rename(script, new_name): """ The `args` / `kwargs` params are the same as in `api.Script`. - :param operation: The refactoring operation to execute. - :type operation: str - :type source: str + :param new_name: The new name of the script. + :param script: The source Script object. :return: list of changed lines/changed files """ return Refactoring(_rename(script.usages(), new_name)) @@ -108,11 +107,12 @@ def extract(script, new_name): user_stmt = script._parser.user_stmt() - # TODO care for multiline extracts + # TODO care for multi-line extracts dct = {} if user_stmt: pos = script._pos line_index = pos[0] - 1 + # Be careful here. 'array_for_pos' does not exist in 'helpers'. arr, index = helpers.array_for_pos(user_stmt, pos) if arr is not None: start_pos = arr[index].start_pos @@ -123,7 +123,7 @@ def extract(script, new_name): start_line = new_lines[start_pos[0] - 1] text = start_line[start_pos[1]:e] for l in range(start_pos[0], end_pos[0] - 1): - text += '\n' + l + text += '\n' + str(l) if e is None: end_line = new_lines[end_pos[0] - 1] text += '\n' + end_line[:end_pos[1]] @@ -143,7 +143,7 @@ def extract(script, new_name): new_lines[start_pos[0] - 1] = start_line new_lines[start_pos[0]:end_pos[0] - 1] = [] - # add parentheses in multiline case + # add parentheses in multi-line case open_brackets = ['(', '[', '{'] close_brackets = [')', ']', '}'] if '\n' in text and not (text[0] in open_brackets and text[-1] == @@ -175,7 +175,7 @@ def inline(script): inlines = sorted(inlines, key=lambda x: (x.module_path, x.line, x.column), reverse=True) expression_list = stmt.expression_list() - # don't allow multiline refactorings for now. + # don't allow multi-line refactorings for now. assert stmt.start_pos[0] == stmt.end_pos[0] index = stmt.start_pos[0] - 1 diff --git a/scripts/wx_check.py b/scripts/wx_check.py index 1e48c39e..57389845 100755 --- a/scripts/wx_check.py +++ b/scripts/wx_check.py @@ -30,7 +30,7 @@ import jedi def process_memory(): """ In kB according to - http://stackoverflow.com/questions/938733/total-memory-used-by-python-process + https://stackoverflow.com/questions/938733/total-memory-used-by-python-process """ return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss