forked from python-mode/python-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
45 lines (33 loc) · 1.16 KB
/
__init__.py
File metadata and controls
45 lines (33 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Pymode support functions."""
import sys
from importlib.machinery import PathFinder as _PathFinder
import vim # noqa
if not hasattr(vim, 'find_module'):
vim.find_module = _PathFinder.find_module
def auto():
"""Fix PEP8 erorrs in current buffer.
pymode: uses it in command PymodeLintAuto with pymode#lint#auto()
"""
from .autopep8 import fix_file
class Options(object):
aggressive = 1
diff = False
experimental = True
ignore = vim.eval('g:pymode_lint_ignore')
in_place = True
indent_size = int(vim.eval('&tabstop'))
line_range = None
hang_closing = False
max_line_length = int(vim.eval('g:pymode_options_max_line_length'))
pep8_passes = 100
recursive = False
select = vim.eval('g:pymode_lint_select')
verbose = 0
fix_file(vim.current.buffer.name, Options)
def get_documentation():
"""Search documentation and append to current buffer."""
from io import StringIO
sys.stdout, _ = StringIO(), sys.stdout
help(vim.eval('a:word'))
sys.stdout, out = _, sys.stdout.getvalue()
vim.current.buffer.append(str(out).splitlines(), 0)