Skip to content

Commit 6eaba6b

Browse files
committed
Merge branch 'develop' of git://github.com/klen/python-mode into develop
2 parents 578e50f + fd70ac2 commit 6eaba6b

File tree

251 files changed

+28608
-5525
lines changed

Some content is hidden

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

251 files changed

+28608
-5525
lines changed

AUTHORS

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Contributors:
1616
* Daniel Hahler (http://github.com/blueyed)
1717
* David Vogt (http://github.com/winged);
1818
* Denis Kasak (http://github.com/dkasak);
19+
* Dimitrios Semitsoglou-Tsiapos (https://github.com/dset0x);
1920
* Dirk Wallenstein (http://github.com/dirkwallenstein);
2021
* Florent Xicluna (http://github.com/florentx);
2122
* Fredrik Henrysson (http://github.com/fhenrysson);
@@ -25,24 +26,30 @@ Contributors:
2526
* Jay Rainey (https://github.com/jawrainey)
2627
* Jonathan McCall (http://github.com/Jonnymcc);
2728
* Kevin Deldycke (http://github.com/kdeldycke);
28-
* Kurtis Rader (https://github.com/krader1961)
29+
* Kurtis Rader (https://github.com/krader1961);
2930
* Lowe Thiderman (http://github.com/thiderman);
3031
* Martin Brochhaus (http://github.com/mbrochh);
3132
* Matthew Moses (http://github.com/mlmoses);
32-
* Mel Boyce (http://github.com/syngin)
33+
* Mel Boyce (http://github.com/syngin);
3334
* Mohammed (http://github.com/mbadran);
3435
* Naoya Inada (http://github.com/naoina);
36+
* Nate Zhang (https://github.com/natezhang93);
37+
* Paweł Korzeniewski (https://github.com/korzeniewskipl);
3538
* Pedro Algarvio (http://github.com/s0undt3ch);
3639
* Phillip Cloud (http://github.com/cpcloud);
3740
* Piet Delport (http://github.com/pjdelport);
3841
* Robert David Grant (http://github.com/bgrant);
39-
* Ronald Andreu Kaiser (http://github.com/cathoderay);
42+
* Robin Schneider (https://github.com/ypid);
43+
* Ronald Andreu Kaiser (http://github.com/cathoderay);;
44+
* Samir Benmendil (https://github.com/Ram-Z);
4045
* Sorin Ionescu (sorin-ionescu);
4146
* Steve Losh (http://github.com/sjl);
42-
* Tommy Allen (https://github.com/tweekmonster)
43-
* Wayne Ye (https://github.com/WayneYe)
44-
* bendavis78 (http://github.com/bendavis78)
45-
* fwuzju (http://github.com/fwuzju)
47+
* Tommy Allen (https://github.com/tweekmonster);
48+
* Tyler Fenby (https://github.com/TFenby);
49+
* Vincent Driessen (https://github.com/nvie);
50+
* Wayne Ye (https://github.com/WayneYe);
51+
* bendavis78 (http://github.com/bendavis78);
52+
* fwuzju (http://github.com/fwuzju);
4653
* lawrenceakka;
4754
* lee (loyalpartner);
4855
* nixon;

Changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@ Changelog
22
=========
33

44
* Pylama updated to version 5.0.5
5+
* Rope libs updated
6+
* Add wdb to debugger list in breakpoint cmd
57
* Add 'pymode_options_max_line_length' option
68
* Add ability to set related checker options `:help pymode-lint-options`
79
Options added: 'pymode_lint_options_pep8', 'pymode_lint_options_pep257',
810
'pymode_lint_options_mccabe', 'pymode_lint_options_pyflakes',
911
'pymode_lint_options_pylint'
12+
* Highlight comments inside class/function arg lists
13+
* Don't fold single line def
14+
* Don't skip a line when the first docstring contains text
15+
* Add Python documentation vertical display option
16+
* Rope: correct refactoring function calls
17+
1018

1119
## 2014-06-11 0.8.1
1220
-------------------

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ pylama:
2626
make $(PYLAMA)
2727
make $(PYLAMA)/lint/pylama_pylint
2828

29+
.PHONY: rope
30+
rope:
31+
@git clone https://github.com/python-rope/rope.git $(CURDIR)/_/rope
32+
@rm -rf $(CURDIR)/pymode/libs/rope
33+
@cp -r $(CURDIR)/_/rope/rope $(CURDIR)/pymode/libs/.
34+
2935
$(PYLAMA):
30-
cp -r ~/Dropbox/projects/pylama/pylama $(PYLAMA)
36+
cp -r $$PRJDIR/pylama/pylama $(PYLAMA)
3137

3238
$(PYLAMA)/lint/pylama_pylint:
33-
cp -r ~/Dropbox/projects/pylama/plugins/pylama_pylint/pylama_pylint/ $(PYLAMA)/lint/pylama_pylint
39+
cp -r $$PRJDIR/pylama/plugins/pylama_pylint/pylama_pylint/ $(PYLAMA)/lint/pylama_pylint
3440

3541
$(CURDIR)/build:
3642
mkdir -p $(CURDIR)/build/usr/share/vim/addons

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ See (very old) screencast here: http://www.youtube.com/watch?v=67OZNp9Z0CQ
4040
(sorry for quality, this is my first screencast) Another old presentation here:
4141
http://www.youtube.com/watch?v=YhqsjUUHj6g
4242

43-
**To read python-mode documentation in Vim, see** ``:help pymode.txt``
43+
**To read python-mode documentation in Vim, see** ``:help pymode``
4444

4545

4646
.. contents::
@@ -62,7 +62,7 @@ Using pathogen (recommended)
6262

6363
% cd ~/.vim
6464
% mkdir -p bundle && cd bundle
65-
% git clone git://github.com/klen/python-mode.git
65+
% git clone https://github.com/klen/python-mode.git
6666

6767
- Enable `pathogen <https://github.com/tpope/vim-pathogen>`_
6868
in your ``~/.vimrc``: ::
@@ -81,7 +81,7 @@ Manually
8181
--------
8282
::
8383

84-
% git clone git://github.com/klen/python-mode.git
84+
% git clone https://github.com/klen/python-mode.git
8585
% cd python-mode
8686
% cp -R * ~/.vim
8787

@@ -187,8 +187,8 @@ License
187187

188188
Licensed under a `GNU lesser general public license`_.
189189

190-
If you like this plugin, you can send me postcard :)
191-
My address is here: "Russia, 143401, Krasnogorsk, Shkolnaya 1-19" to "Kirill Klenov".
190+
If you like this plugin, I would very appreciated if you kindly send me a postcard :)
191+
My address is here: "Russia, 143500, MO, Istra, pos. Severny 8-3" to "Kirill Klenov".
192192
**Thanks for support!**
193193

194194
.. _GNU lesser general public license: http://www.gnu.org/copyleft/lesser.html

autoload/pymode.vim

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ endfunction "}}}
1212
" DESC: Import python libs
1313
fun! pymode#init(plugin_root, paths) "{{{
1414

15-
if g:pymode_python == 'disable'
16-
if g:pymode_warning
17-
call pymode#error("Pymode requires vim compiled with +python. Most of features will be disabled.")
18-
endif
19-
return
20-
endif
21-
2215
PymodePython import sys, vim
2316
PymodePython sys.path.insert(0, vim.eval('a:plugin_root'))
2417
PymodePython sys.path = vim.eval('a:paths') + sys.path
@@ -76,9 +69,11 @@ endfunction "}}}
7669

7770
" DESC: Remove unused whitespaces
7871
fun! pymode#trim_whitespaces() "{{{
79-
let cursor_pos = getpos('.')
80-
silent! %s/\s\+$//
81-
call setpos('.', cursor_pos)
72+
if g:pymode_trim_whitespaces
73+
let cursor_pos = getpos('.')
74+
silent! %s/\s\+$//
75+
call setpos('.', cursor_pos)
76+
endif
8277
endfunction "}}}
8378

8479

@@ -107,11 +102,11 @@ endfunction "}}}
107102

108103
fun! pymode#buffer_pre_write() "{{{
109104
let b:pymode_modified = &modified
110-
endfunction
105+
endfunction "}}}
111106

112107
fun! pymode#buffer_post_write() "{{{
113108
if g:pymode_rope
114-
if b:pymode_modified && g:pymode_rope_regenerate_on_write
109+
if g:pymode_rope_regenerate_on_write && b:pymode_modified
115110
call pymode#debug('regenerate')
116111
call pymode#rope#regenerate()
117112
endif

autoload/pymode/breakpoint.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fun! pymode#breakpoint#init() "{{{
1717

1818
from imp import find_module
1919

20-
for module in ('pudb', 'ipdb'):
20+
for module in ('wdb', 'pudb', 'ipdb'):
2121
try:
2222
find_module(module)
2323
vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module))

autoload/pymode/doc.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ fun! pymode#doc#show(word) "{{{
2929
setlocal nomodifiable
3030
setlocal nomodified
3131
setlocal filetype=rst
32+
if g:pymode_doc_vertical
33+
wincmd L
34+
endif
3235
wincmd p
3336

3437
endfunction "}}}

autoload/pymode/folding.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fun! pymode#folding#text() " {{{
1818
while getline(fs) !~ s:def_regex && getline(fs) !~ s:doc_begin_regex
1919
let fs = nextnonblank(fs + 1)
2020
endwhile
21-
if getline(fs) =~ s:doc_begin_regex
21+
if getline(fs) =~ s:doc_end_regex && getline(fs) =~ s:doc_begin_regex
2222
let fs = nextnonblank(fs + 1)
2323
endif
2424
let line = getline(fs)
@@ -50,6 +50,10 @@ fun! pymode#folding#expr(lnum) "{{{
5050
endif
5151

5252
if line =~ s:def_regex
53+
" single line def
54+
if indent(a:lnum) >= indent(a:lnum+1) && getline(prevnonblank(a:lnum)) !~ ':\s*$'
55+
return '='
56+
endif
5357
" Check if last decorator is before the last def
5458
let decorated = 0
5559
let lnum = a:lnum - 1

autoload/pymode/indent.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function! s:SearchParensPair() " {{{
110110
" Skip strings and comments and don't look too far
111111
let skip = "line('.') < " . (line - 50) . " ? dummy :" .
112112
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? ' .
113-
\ '"string\\|comment"'
113+
\ '"string\\|comment\\|doctest"'
114114

115115
" Search for parentheses
116116
call cursor(line, col)

autoload/pymode/lint.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ fun! pymode#lint#check() "{{{
6565

6666
call g:PymodeSigns.refresh(loclist)
6767

68-
if g:pymode_lint_cwindow
69-
call loclist.show()
70-
endif
68+
call loclist.show()
7169

7270
call pymode#lint#show_errormessage()
7371
call pymode#wide_message('Found errors and warnings: ' . len(loclist._loclist))

autoload/pymode/run.vim

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ let s:efm .= '%-G%.%#'
4343

4444
PymodePython from pymode.run import run_code
4545

46-
call pymode#tools#loclist#init()
47-
4846

4947
" DESC: Run python code
5048
fun! pymode#run#code_run(line1, line2) "{{{
@@ -88,10 +86,7 @@ fun! pymode#run#code_run(line1, line2) "{{{
8886
call setqflist(qflist)
8987
endif
9088

91-
let loclist = g:PymodeLocList.current()
92-
let loclist._loclist = getqflist()
93-
let loclist._title = "Run errors"
94-
call loclist.show()
89+
call pymode#quickfix_open(0, g:pymode_quickfix_maxheight, g:pymode_quickfix_maxheight, 0)
9590

9691
let &efm = l:_efm
9792

autoload/pymode/tools/loclist.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fun! g:PymodeLocList.show() "{{{
6868
call setloclist(0, self._loclist)
6969
if self.is_empty()
7070
lclose
71-
else
71+
elseif g:pymode_lint_cwindow
7272
let num = winnr()
7373
lopen
7474
setl nowrap

doc/pymode.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ Setup default python options *'g:pymode_options'*
9898
>
9999
let g:pymode_options = 1
100100
101-
Setup max line length *'g:pymode_options_max_line_length'*
102-
>
103-
let g:pymode_options_max_line_length = 79
104-
105101
If this option is set to 1, pymode will enable the following options for
106102
python buffers: >
107103
@@ -115,6 +111,10 @@ python buffers: >
115111
setlocal commentstring=#%s
116112
setlocal define=^\s*\\(def\\\\|class\\)
117113
114+
Setup max line length *'g:pymode_options_max_line_length'*
115+
>
116+
let g:pymode_options_max_line_length = 79
117+
118118
Enable colorcolumn display at max_line_length *'g:pymode_options_colorcolumn'*
119119
>
120120
let g:pymode_options_colorcolumn = 1
@@ -482,7 +482,7 @@ Keymap for autocomplete *'g:pymode_rope_completion_bind'*
482482
Extended autocompletion (rope could complete objects which have not been
483483
imported) from project *'g:pymode_rope_autoimport'*
484484
>
485-
let g:pymode_rope_autoimport = 1
485+
let g:pymode_rope_autoimport = 0
486486
487487
Load modules to autoimport by default *'g:pymode_rope_autoimport_modules'*
488488
>
@@ -781,10 +781,10 @@ The sequence of commands that fixed this:
781781
Python-mode is released under the GNU lesser general public license.
782782
See: http://www.gnu.org/copyleft/lesser.html
783783

784-
If you like this plugin, you can send me a postcard :)
784+
If you like this plugin, I would very appreciated if you kindly send me a postcard :)
785785

786-
My address is: "Russia, 143401, Krasnogorsk, Shkolnaya 1-19" to "Kirill
787-
Klenov". Thanks for your support!
786+
My address is: "Russia, 143500, MO, Istra, pos. Severny 8-3" to "Kirill Klenov".
787+
Thanks for your support!
788788

789789

790790
------------------------------------------------------------------------------

ftplugin/python/pymode.vim

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,31 @@ if !g:pymode || pymode#default('b:pymode', 1)
22
finish
33
endif
44

5+
if g:pymode_python == 'disable'
6+
7+
if g:pymode_warning
8+
call pymode#error("Pymode requires vim compiled with +python. Most of features will be disabled.")
9+
endif
10+
11+
finish
12+
13+
else
14+
15+
516
let b:pymode_modified = &modified
617

718
" Init paths
819
if !pymode#default('g:pymode_init', 1)
9-
call pymode#init(expand('<sfile>:p:h:h:h'), g:pymode_paths)
10-
call pymode#virtualenv#init()
11-
call pymode#breakpoint#init()
12-
PymodePython from pymode.utils import patch_paths
13-
PymodePython patch_paths()
20+
21+
call pymode#init(expand('<sfile>:p:h:h:h'), g:pymode_paths)
22+
call pymode#virtualenv#init()
23+
call pymode#breakpoint#init()
24+
25+
PymodePython from pymode.utils import patch_paths
26+
PymodePython patch_paths()
27+
28+
endif
29+
1430
endif
1531

1632
command! -buffer -nargs=1 PymodeVirtualenv call pymode#virtualenv#activate(<args>)

plugin/pymode.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ call pymode#default("g:pymode_options", 1)
5252
call pymode#default("g:pymode_options_max_line_length", 80)
5353
call pymode#default("g:pymode_options_colorcolumn", 1)
5454

55+
" Enable/disable vertical display of python documentation
56+
call pymode#default("g:pymode_doc_vertical", 0)
57+
5558
" Minimal height of pymode quickfix window
5659
call pymode#default('g:pymode_quickfix_maxheight', 6)
5760

@@ -183,7 +186,7 @@ call pymode#default('g:pymode_rope_completion', 1)
183186

184187
" Complete keywords from not imported modules (could make completion slower)
185188
" Enable autoimport used modules
186-
call pymode#default('g:pymode_rope_autoimport', 1)
189+
call pymode#default('g:pymode_rope_autoimport', 0)
187190

188191
" Offer to import object after complete (if that not be imported before)
189192
call pymode#default('g:pymode_rope_autoimport_import_after_complete', 0)

pylama.ini

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
[main]
2-
ignore = R0201,R0922,E1103
3-
skip = pymode/autopep8.py
1+
[pylama]
2+
linters=pep8,pyflakes,pylint
3+
4+
[pylama:pymode/libs*]
5+
skip=1
6+
7+
[pylama:pylint]
8+
disable=E1120,E1130,E1103,W1401

0 commit comments

Comments
 (0)