Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3008bea

Browse files
committed
Merge branch 'release/0.6.11'
2 parentscd6aec2 +f322c95 commit3008bea

File tree

136 files changed

+3121
-13036
lines changed

Some content is hidden

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

136 files changed

+3121
-13036
lines changed

‎.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-15 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: 21 additions & 11 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::
@@ -30,17 +31,17 @@ See (very old) screencast here: http://t.co/3b0bzeXA (sorry for quality, this is
3031
Changelog
3132
=========
3233

33-
##2012-08-02 0.6.5
34-
-------------------
35-
*Updated Pep8 to version 1.3.3
36-
*UpdatedPylint to version 0.25.2
37-
*Fixed virtualenv support for windows users
38-
*Added pymode modeline ':help PythonModeModeline'
39-
*Added diagnostic tool ':call pymode#troubleshooting#Test()'
40-
*Added `PyLintAuto` command ':help PyLintAuto'
41-
*Code checking is async operation now
42-
*More, more fast the pymode folding
43-
*Repaired execution ofpython code
34+
##2013-03-15 0.6.11
35+
--------------------
36+
*Update `PEP8` to version 1.4.5;
37+
*Update `Pylint` to version 0.27.0;
38+
*Update `autopep8` to version 0.8.7;
39+
*Fix breakpoint definition;
40+
*Update python syntax;
41+
*Fixed run-time error when output non-ascii in multibyte locale;
42+
*Move initialization into ftplugin as it is python specific;
43+
*Pyrex (Cython) files support;
44+
*Support `raw_input` in runpython code;
4445

4546

4647
Requirements
@@ -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
pyhelp(vim.eval('a:word'))
1111
py sys.stdout, out= _, sys.stdout.getvalue()
1212
callpymode#TempBuffer()
13-
pyvim.current.buffer.append(out.split('\n'),0)
13+
pyvim.current.buffer.append(str(out).split('\n'),0)
1414
wincmdp
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
letg:pymode_lint_buffer=bufnr('%')
1616

17+
py from pymodeimport lint
1718
py lint.check_file()
1819

1920
endfunction" }}}
@@ -99,7 +100,9 @@ fun! pymode#lint#Auto() "{{{
99100
return0
100101
endtry
101102
endif
103+
py from pymodeimport auto
102104
py auto.fix_current_file()
103105
cclose
104106
edit
107+
callpymode#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+
echohlError |echo"File modified and I can't save it. Cancel code checking." |echohl None
8+
return0
9+
endtry
10+
endif
411
pyimport 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+
pyenc=vim.eval('&enc')
615
callpymode#WideMessage("Code running.")
716
try
8-
pyexecfile(vim.eval('expand("%s:p")'))
9-
py sys.stdout, out= _, sys.stdout.getvalue()
10-
callpymode#TempBuffer()
11-
pyvim.current.buffer.append(out.split('\n'),0)
12-
wincmdp
13-
callpymode#WideMessage("")
17+
callsetqflist([])
18+
pyexecfile(vim.eval('expand("%s:p")'), {'raw_input': lambdas:
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+
pyforxin err.strip().split('\n'):vim.command('caddexpr "'+x.replace('"',r'\"')+'"')
25+
letl:oldefm= &efm
26+
setefm=%C\%.%#,%A\ \File\\"%f\"\\,\line\%l%.%#,%Z%[%^\]%\\@=%m
27+
callpymode#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)forxin 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_dirin sys.pathor 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+
callpymode#WideMessage("Activate virtualenv:".$VIRTUAL_ENV)
30+
2831
endfunction"}}}

‎doc/pymode.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(__) (__) (__) (_) (_)(_____)(_)\_) (_/\/\_)(_____)(____/(____)~
77

88

9-
Version: 0.6.9
9+
Version: 0.6.11
1010

1111
==============================================================================
1212
CONTENTS*Python-mode-contents*
@@ -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'|

‎ftplugin/pyrex.vim

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

‎plugin/pymode.vimrenamed to‎ftplugin/python/init-pymode.vim

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
letg:pymode_version="0.6.9"
1+
ifexists('did_init_pymode_vim')
2+
finish
3+
endif
4+
let did_init_pymode_vim=1
5+
6+
letg:pymode_version="0.6.11"
27

38
com! PymodeVersionechomsg"Current python-mode version:" .g:pymode_version
49

@@ -10,13 +15,13 @@ endif
1015

1116
" DESC: Check python support
1217
if!has('python')
13-
echoerrexpand("<sfile>:t") ." required vim compiled with +python."
14-
letg:pymode_lint=0
15-
letg:pymode_rope=0
18+
letg:pymode_virtualenv=0
1619
letg:pymode_path=0
20+
letg:pymode_lint=0
1721
letg:pymode_doc=0
22+
letg:pymode_breakpoint=0
23+
letg:pymode_rope=0
1824
letg:pymode_run=0
19-
letg:pymode_virtualenv=0
2025
endif
2126

2227

@@ -34,7 +39,7 @@ endif
3439
" }}}
3540

3641

37-
" DESC:Fix pythonpath
42+
" DESC:Add pymode's pylibs to sys.path {{{
3843
if!pymode#Default('g:pymode_path',1)||g:pymode_path
3944

4045
callpymode#Default('g:pymode_paths', [])
@@ -43,13 +48,12 @@ python << EOF
4348
import sys,vim, os
4449

4550
curpath=vim.eval("getcwd()")
46-
libpath= os.path.join(os.path.dirname(os.path.dirname(
47-
vim.eval("expand('<sfile>:p')"))),'pylibs')
51+
libpath= os.path.join(vim.eval("expand('<sfile>:p:h:h:h')"),'pylibs')
4852

49-
sys.path= [os.path.dirname(libpath),libpath, curpath]+vim.eval("g:pymode_paths")+ sys.path
53+
sys.path= [libpath, curpath]+vim.eval("g:pymode_paths")+ sys.path
5054
EOF
5155

52-
endif
56+
endif" }}}
5357

5458

5559
" Lint {{{
@@ -91,7 +95,7 @@ if !pymode#Default("g:pymode_lint", 1) || g:pymode_lint
9195
callpymode#Default("g:pymode_lint_maxheight",6)
9296

9397
" OPTION: g:pymode_lint_ignore -- string. Skip errors and warnings (e.g. E4,W)
94-
callpymode#Default("g:pymode_lint_ignore","E501")
98+
callpymode#Default("g:pymode_lint_ignore","")
9599

96100
" OPTION: g:pymode_lint_select -- string. Select errors and warnings (e.g. E4,W)
97101
callpymode#Default("g:pymode_lint_select","")
@@ -126,7 +130,7 @@ if !pymode#Default("g:pymode_lint", 1) || g:pymode_lint
126130
letg:pymode_lint_config=expand("<sfile>:p:h:h") ."/pylint.ini"
127131
endif
128132

129-
py from pymodeimportlint,queue, auto
133+
py from pymodeimport queue
130134

131135
auVimLeavePre*py queue.stop_queue()
132136

@@ -151,13 +155,13 @@ endif
151155

152156
if!pymode#Default("g:pymode_breakpoint",1)||g:pymode_breakpoint
153157

154-
if!pymode#Default("g:pymode_breakpoint_cmd","import ipdb; ipdb.set_trace()### XXX BREAKPOINT")&&has("python")
158+
if!pymode#Default("g:pymode_breakpoint_cmd","import ipdb; ipdb.set_trace()# XXX BREAKPOINT")&&has("python")
155159
python << EOF
156160
fromimpimport find_module
157161
try:
158162
find_module('ipdb')
159163
except ImportError:
160-
vim.command('let g:pymode_breakpoint_cmd = "import pdb; pdb.set_trace()### XXX BREAKPOINT"')
164+
vim.command('let g:pymode_breakpoint_cmd = "import pdb; pdb.set_trace()# XXX BREAKPOINT"')
161165
EOF
162166
endif
163167

‎ftplugin/python/pymode.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
runtime ftplugin/python/init-pymode.vim
2+
13
ifpymode#Default('b:pymode',1)
24
finish
35
endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp