Skip to content

Commit 2f3fab5

Browse files
committed
Merge branch 'feature/0.6.11' into develop
2 parents a5d0e00 + be6ad5c commit 2f3fab5

136 files changed

Lines changed: 3109 additions & 13024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
*.pyc
1+
*.py[cod]
2+
.vimrc
3+
*.sw?
4+
*~
5+
.DS_Store
6+
.ropeproject
27
tags
38
todo.txt
4-
.ropeproject

‎Changelog.rst‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Changelog
22
=========
33

4+
## 2013-03-** 0.6.11
5+
--------------------
6+
* Update `PEP8` to version 1.4.5;
7+
* Update `Pylint` to version 0.27.0;
8+
* Update `autopep8` to version 0.8.7;
9+
* Fix breakpoint definition;
10+
* Update python syntax;
11+
* Fixed run-time error when output non-ascii in multibyte locale;
12+
* Move initialization into ftplugin as it is python specific;
13+
* Pyrex (Cython) files support;
14+
* Support `raw_input` in run python code;
15+
416
## 2012-09-07 0.6.10
517
--------------------
618
* Dont raise an exception when Logger has no message handler (c) nixon

‎README.rst‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ There is no need to install the pylint_, rope_ or any used python library on you
2222
- And more, more ...
2323

2424
See (very old) screencast here: http://t.co/3b0bzeXA (sorry for quality, this is my first screencast)
25+
Another old presentation here: http://www.youtube.com/watch?v=YhqsjUUHj6g
2526

2627

2728
.. contents::
@@ -116,6 +117,15 @@ To change this settings, edit your ``~/.vimrc``: ::
116117
let g:pymode_run_key = 'R'
117118

118119

120+
Loading the Plugin
121+
------------------
122+
123+
Default values: ::
124+
125+
" Load the whole plugin
126+
let g:pymode = 1
127+
128+
119129
Show documentation
120130
------------------
121131

‎after/ftplugin/pyrex.vim‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runtime after/ftplugin/python.vim

‎after/indent/pyrex.vim‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runtime after/indent/python.vim

‎autoload/pymode/doc.vim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fun! pymode#doc#Show(word) "{{{
1010
py help(vim.eval('a:word'))
1111
py sys.stdout, out = _, sys.stdout.getvalue()
1212
call pymode#TempBuffer()
13-
py vim.current.buffer.append(out.split('\n'), 0)
13+
py vim.current.buffer.append(str(out).split('\n'), 0)
1414
wincmd p
1515
endif
1616
endfunction "}}}

‎autoload/pymode/lint.vim‎

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

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

17+
py from pymode import lint
1718
py lint.check_file()
1819

1920
endfunction " }}}
@@ -99,7 +100,9 @@ fun! pymode#lint#Auto() "{{{
99100
return 0
100101
endtry
101102
endif
103+
py from pymode import auto
102104
py auto.fix_current_file()
103105
cclose
104106
edit
107+
call pymode#WideMessage("AutoPep8 done.")
105108
endfunction "}}}

‎autoload/pymode/run.vim‎

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,40 @@
11
" DESC: Save file if it modified and run python code
22
fun! pymode#run#Run(line1, line2) "{{{
3-
if &modifiable && &modified | write | endif
3+
if &modifiable && &modified
4+
try
5+
write
6+
catch /E212/
7+
echohl Error | echo "File modified and I can't save it. Cancel code checking." | echohl None
8+
return 0
9+
endtry
10+
endif
411
py import StringIO
5-
py sys.stdout, _ = StringIO.StringIO(), sys.stdout
12+
py sys.stdout, stdout_ = StringIO.StringIO(), sys.stdout
13+
py sys.stderr, stderr_ = StringIO.StringIO(), sys.stderr
14+
py enc = vim.eval('&enc')
615
call pymode#WideMessage("Code running.")
716
try
8-
py execfile(vim.eval('expand("%s:p")'))
9-
py sys.stdout, out = _, sys.stdout.getvalue()
10-
call pymode#TempBuffer()
11-
py vim.current.buffer.append(out.split('\n'), 0)
12-
wincmd p
13-
call pymode#WideMessage("")
17+
call setqflist([])
18+
py execfile(vim.eval('expand("%s:p")'), {'raw_input': lambda s:
19+
vim.eval('input("{0}")'.format(s)), 'input': vim.eval('input("{0}")'.format(s))})
20+
py out, err = sys.stdout.getvalue().strip(), sys.stderr.getvalue()
21+
py sys.stdout, sys.stderr = stdout_, stderr_
22+
23+
cexpr ""
24+
py for x in err.strip().split('\n'): vim.command('caddexpr "' + x.replace('"', r'\"') + '"')
25+
let l:oldefm = &efm
26+
set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
27+
call pymode#QuickfixOpen(0, g:pymode_lint_hold, g:pymode_lint_maxheight, g:pymode_lint_minheight, 0)
28+
let &efm = l:oldefm
29+
30+
python << EOF
31+
if out:
32+
vim.command("call pymode#TempBuffer()")
33+
vim.current.buffer.append([x.encode(enc) for x in out.split('\n')], 0)
34+
vim.command("wincmd p")
35+
else:
36+
vim.command('call pymode#WideMessage("No output.")')
37+
EOF
1438

1539
catch /.*/
1640

‎autoload/pymode/virtualenv.vim‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fun! pymode#virtualenv#Activate() "{{{
1515
python << EOF
1616
import sys, vim, os
1717

18-
ve_dir = os.environ['VIRTUAL_ENV']
18+
ve_dir = vim.eval('$VIRTUAL_ENV')
1919
ve_dir in sys.path or sys.path.insert(0, ve_dir)
2020
activate_this = os.path.join(os.path.join(ve_dir, 'bin'), 'activate_this.py')
2121

@@ -25,4 +25,7 @@ if not os.path.exists(activate_this):
2525

2626
execfile(activate_this, dict(__file__=activate_this))
2727
EOF
28+
29+
call pymode#WideMessage("Activate virtualenv: ".$VIRTUAL_ENV)
30+
2831
endfunction "}}}

‎doc/pymode.txt‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ to install the pylint or rope libraries on your system.
4444
This script provides the following options that can customise the behaviour of
4545
PythonMode. These options should be set in your vimrc.
4646

47+
|'pymode'| Turn off the whole plugin
48+
4749
|'pymode_paths'| Additional python paths for pymode
4850

4951
|'pymode_doc'| Turns off the documentation script
@@ -142,6 +144,13 @@ Set linters and mccabe complexity.
142144

143145
This changes will work only in current buffer.
144146

147+
------------------------------------------------------------------------------
148+
*'pymode'*
149+
Values: 0 or 1.
150+
Default: 1.
151+
152+
If this option is set to 0 then the whole plugin is disabled
153+
145154
------------------------------------------------------------------------------
146155
*'pymode_paths'*
147156
Values: List of strings
@@ -196,7 +205,7 @@ This option sets code checkers.
196205
Values: IDs of errors, separated by commas or empty strings
197206
E.g. "E501,W002", "E2,W" (Skip all Warnings and Errors startswith E2) and etc ~
198207

199-
Default: "E501".
208+
Default: "".
200209

201210
Skip errors and warnings.
202211
See also: |'pymode_lint_select'|, |'pymode_lint_config'|

0 commit comments

Comments
 (0)