Skip to content

Commit 225508d

Browse files
committed
Add pymode#Execute to doc, lint and queue.
1 parent 57aaea5 commit 225508d

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

autoload/pymode/doc.vim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ fun! pymode#doc#Show(word) "{{{
55
if a:word == ''
66
echoerr "No name/symbol under cursor!"
77
else
8-
py import StringIO
9-
py sys.stdout, _ = StringIO.StringIO(), sys.stdout
10-
py help(vim.eval('a:word'))
11-
py sys.stdout, out = _, sys.stdout.getvalue()
8+
call pymode#Execute("import StringIO")
9+
call pymode#Execute("sys.stdout, _ = StringIO.StringIO(), sys.stdout")
10+
call pymode#Execute("help('".a:word."')")
11+
call pymode#Execute("sys.stdout, out = _, sys.stdout.getvalue()")
1212
call pymode#TempBuffer()
13-
py vim.current.buffer.append(str(out).split('\n'), 0)
13+
call pymode#Execute("vim.current.buffer.append(str(out).splitlines(), 0)")
1414
wincmd p
1515
endif
1616
endfunction "}}}

autoload/pymode/lint.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ fun! pymode#lint#Check() "{{{
1414

1515
let g:pymode_lint_buffer = bufnr('%')
1616

17-
py from pymode import lint
18-
py lint.check_file()
17+
call pymode#Execute("from pymode import lint")
18+
call pymode#Execute("lint.check_file()")
1919

2020
endfunction " }}}
2121

@@ -100,8 +100,8 @@ fun! pymode#lint#Auto() "{{{
100100
return 0
101101
endtry
102102
endif
103-
py from pymode import auto
104-
py auto.fix_current_file()
103+
call pymode#Execute("from pymode import auto")
104+
call pymode#Execute("auto.fix_current_file()")
105105
cclose
106106
edit
107107
call pymode#WideMessage("AutoPep8 done.")

autoload/pymode/queue.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
fun! pymode#queue#Poll() "{{{
22

33
" Check current tasks
4-
py queue.check_task()
4+
call pymode#Execute("from pymode import queue")
5+
call pymode#Execute("queue.check_task()")
56

67
" Update interval
78
if mode() == 'i'

0 commit comments

Comments
 (0)