pythonx/jedi_vim: flake8 fixes

This commit is contained in:
Daniel Hahler
2018-04-17 16:56:02 +02:00
committed by Dave Halter
parent 79c6172be7
commit d430570fd0
2 changed files with 12 additions and 6 deletions

View File

@@ -229,6 +229,7 @@ def tempfile(content):
finally:
os.unlink(f.name)
@_check_jedi_availability(show_error=True)
@catch_and_print_exceptions
def goto(mode="goto", no_output=False):
@@ -250,7 +251,6 @@ def goto(mode="goto", no_output=False):
elif mode == "assignment":
definitions = script.goto_assignments()
if no_output:
return definitions
if not definitions:
@@ -270,10 +270,12 @@ def goto(mode="goto", no_output=False):
using_tagstack=using_tagstack)
if not result:
return []
if d.module_path and os.path.exists(d.module_path) and using_tagstack:
if (using_tagstack and d.module_path and
os.path.exists(d.module_path)):
tagname = d.name
with tempfile('{0}\t{1}\t{2}'.format(tagname, d.module_path,
'call cursor({0}, {1})'.format(d.line, d.column + 1))) as f:
with tempfile('{0}\t{1}\t{2}'.format(
tagname, d.module_path, 'call cursor({0}, {1})'.format(
d.line, d.column + 1))) as f:
old_tags = vim.eval('&tags')
old_wildignore = vim.eval('&wildignore')
try:
@@ -389,7 +391,8 @@ def show_call_signatures(signatures=()):
line = vim_eval("getline(%s)" % line_to_replace)
# Descriptions are usually looking like `param name`, remove the param.
params = [p.description.replace('\n', '').replace('param ', '', 1) for p in signature.params]
params = [p.description.replace('\n', '').replace('param ', '', 1)
for p in signature.params]
try:
# *_*PLACEHOLDER*_* makes something fat. See after/syntax file.
params[signature.index] = '*_*%s*_*' % params[signature.index]
@@ -587,7 +590,8 @@ def do_rename(replace, orig=None):
assert r.module_path is not None
result = new_buffer(r.module_path)
if not result:
echo_highlight("Jedi-vim: failed to create buffer window for {0}!".format(r.module_path))
echo_highlight('Failed to create buffer window for %s!' % (
r.module_path))
continue
buffers.add(vim.current.buffer.name)