From b17aa69ad9cea4c883d46bbab2e2962e606e685f Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 14:12:11 -0500 Subject: [PATCH 01/14] Delete all files except indent code and documentation. --- .bumpversion.cfg | 10 - .github/FUNDING.yml | 3 - .github/stale.yml | 18 - .github/workflows/test_pymode.yml | 71 -- AUTHORS | 1 + after/ftplugin/pyrex.vim | 1 - after/ftplugin/python.vim | 60 -- autoload/pymode.vim | 148 --- autoload/pymode/breakpoint.vim | 50 - autoload/pymode/debug.vim | 67 -- autoload/pymode/doc.vim | 40 - autoload/pymode/folding.vim | 328 ------ autoload/pymode/lint.vim | 104 -- autoload/pymode/motion.vim | 105 -- autoload/pymode/rope.vim | 200 ---- autoload/pymode/run.vim | 99 -- autoload/pymode/tools/loclist.vim | 99 -- autoload/pymode/tools/signs.vim | 57 -- autoload/pymode/virtualenv.vim | 17 - debugvimrc.vim | 32 - ftplugin/python/pymode.vim | 258 ----- logo.png | Bin 16429 -> 0 bytes plugin/pymode.vim | 321 ------ pylama.ini | 9 - pymode/__init__.py | 45 - pymode/async.py | 6 - pymode/autopep8.py | 1 - pymode/environment.py | 249 ----- pymode/libs/__init__.py | 0 pymode/libs/astroid | 1 - pymode/libs/mccabe.py | 1 - pymode/libs/pycodestyle.py | 1 - pymode/libs/pydocstyle | 1 - pymode/libs/pyflakes | 1 - pymode/libs/pylama | 1 - pymode/libs/pylint | 1 - pymode/libs/rope | 1 - pymode/libs/snowballstemmer | 1 - pymode/libs/toml | 1 - pymode/lint.py | 93 -- pymode/rope.py | 953 ------------------ pymode/run.py | 80 -- pymode/utils.py | 48 - pymode/virtualenv.py | 57 -- submodules/astroid | 1 - submodules/autopep8 | 1 - submodules/mccabe | 1 - submodules/pycodestyle | 1 - submodules/pydocstyle | 1 - submodules/pyflakes | 1 - submodules/pylama | 1 - submodules/pylint | 1 - submodules/rope | 1 - submodules/snowball_py | 1 - submodules/toml | 1 - syntax/pyrex.vim | 71 -- syntax/python.vim | 412 -------- tests/motion_decorator.py | 37 - tests/test.sh | 59 -- tests/test_bash/test_autocommands.sh | 34 - tests/test_bash/test_autopep8.sh | 10 - tests/test_bash/test_folding.sh | 36 - tests/test_bash/test_pymodelint.sh | 14 - tests/test_bash/test_textobject.sh | 15 - tests/test_helpers_bash/test_createvimrc.sh | 26 - .../test_prepare_between_tests.sh | 12 - tests/test_helpers_bash/test_prepare_once.sh | 12 - tests/test_helpers_bash/test_variables.sh | 11 - .../test_helpers_vimscript/inserting_text.vim | 98 -- tests/test_helpers_vimscript/md5sum.vim | 14 - .../test_helpers_vimscript/moving_around.vim | 0 tests/test_procedures_vimscript/autopep8.vim | 34 - tests/test_procedures_vimscript/folding1.vim | 38 - tests/test_procedures_vimscript/folding2.vim | 41 - tests/test_procedures_vimscript/folding3.vim | 66 -- tests/test_procedures_vimscript/folding4.vim | 16 - .../test_procedures_vimscript/pymodelint.vim | 28 - tests/test_procedures_vimscript/pymoderun.vim | 34 - .../pymodeversion.vim | 17 - .../test_procedures_vimscript/textobject.vim | 83 -- tests/test_python_sample_code/algorithms.py | 501 --------- tests/test_python_sample_code/folding1.py | 20 - tests/test_python_sample_code/folding2.py | 56 - .../test_python_sample_code/from_autopep8.py | 21 - .../pymoderun_sample.py | 4 - tests/utils/pymoderc | 90 -- tests/utils/vimrc | 22 - 87 files changed, 1 insertion(+), 5582 deletions(-) delete mode 100644 .bumpversion.cfg delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/stale.yml delete mode 100644 .github/workflows/test_pymode.yml delete mode 100644 after/ftplugin/pyrex.vim delete mode 100644 after/ftplugin/python.vim delete mode 100644 autoload/pymode.vim delete mode 100644 autoload/pymode/breakpoint.vim delete mode 100644 autoload/pymode/debug.vim delete mode 100644 autoload/pymode/doc.vim delete mode 100644 autoload/pymode/folding.vim delete mode 100644 autoload/pymode/lint.vim delete mode 100644 autoload/pymode/motion.vim delete mode 100644 autoload/pymode/rope.vim delete mode 100644 autoload/pymode/run.vim delete mode 100644 autoload/pymode/tools/loclist.vim delete mode 100644 autoload/pymode/tools/signs.vim delete mode 100644 autoload/pymode/virtualenv.vim delete mode 100644 debugvimrc.vim delete mode 100644 ftplugin/python/pymode.vim delete mode 100644 logo.png delete mode 100644 plugin/pymode.vim delete mode 100644 pylama.ini delete mode 100644 pymode/__init__.py delete mode 100644 pymode/async.py delete mode 120000 pymode/autopep8.py delete mode 100644 pymode/environment.py delete mode 100644 pymode/libs/__init__.py delete mode 120000 pymode/libs/astroid delete mode 120000 pymode/libs/mccabe.py delete mode 120000 pymode/libs/pycodestyle.py delete mode 120000 pymode/libs/pydocstyle delete mode 120000 pymode/libs/pyflakes delete mode 120000 pymode/libs/pylama delete mode 120000 pymode/libs/pylint delete mode 120000 pymode/libs/rope delete mode 120000 pymode/libs/snowballstemmer delete mode 120000 pymode/libs/toml delete mode 100644 pymode/lint.py delete mode 100644 pymode/rope.py delete mode 100644 pymode/run.py delete mode 100644 pymode/utils.py delete mode 100644 pymode/virtualenv.py delete mode 160000 submodules/astroid delete mode 160000 submodules/autopep8 delete mode 160000 submodules/mccabe delete mode 160000 submodules/pycodestyle delete mode 160000 submodules/pydocstyle delete mode 160000 submodules/pyflakes delete mode 160000 submodules/pylama delete mode 160000 submodules/pylint delete mode 160000 submodules/rope delete mode 160000 submodules/snowball_py delete mode 160000 submodules/toml delete mode 100644 syntax/pyrex.vim delete mode 100644 syntax/python.vim delete mode 100644 tests/motion_decorator.py delete mode 100755 tests/test.sh delete mode 100644 tests/test_bash/test_autocommands.sh delete mode 100644 tests/test_bash/test_autopep8.sh delete mode 100644 tests/test_bash/test_folding.sh delete mode 100644 tests/test_bash/test_pymodelint.sh delete mode 100644 tests/test_bash/test_textobject.sh delete mode 100644 tests/test_helpers_bash/test_createvimrc.sh delete mode 100644 tests/test_helpers_bash/test_prepare_between_tests.sh delete mode 100644 tests/test_helpers_bash/test_prepare_once.sh delete mode 100644 tests/test_helpers_bash/test_variables.sh delete mode 100644 tests/test_helpers_vimscript/inserting_text.vim delete mode 100644 tests/test_helpers_vimscript/md5sum.vim delete mode 100644 tests/test_helpers_vimscript/moving_around.vim delete mode 100644 tests/test_procedures_vimscript/autopep8.vim delete mode 100644 tests/test_procedures_vimscript/folding1.vim delete mode 100644 tests/test_procedures_vimscript/folding2.vim delete mode 100644 tests/test_procedures_vimscript/folding3.vim delete mode 100644 tests/test_procedures_vimscript/folding4.vim delete mode 100644 tests/test_procedures_vimscript/pymodelint.vim delete mode 100644 tests/test_procedures_vimscript/pymoderun.vim delete mode 100644 tests/test_procedures_vimscript/pymodeversion.vim delete mode 100644 tests/test_procedures_vimscript/textobject.vim delete mode 100644 tests/test_python_sample_code/algorithms.py delete mode 100644 tests/test_python_sample_code/folding1.py delete mode 100644 tests/test_python_sample_code/folding2.py delete mode 100644 tests/test_python_sample_code/from_autopep8.py delete mode 100644 tests/test_python_sample_code/pymoderun_sample.py delete mode 100644 tests/utils/pymoderc delete mode 100644 tests/utils/vimrc diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 613addba..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[bumpversion] -commit = True -current_version = 0.13.0 -files = plugin/pymode.vim -tag = True -tag_name = {new_version} - -[bumpversion:file:doc/pymode.txt] -search = Version: {current_version} -replace = Version: {new_version} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 8847bdf2..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -liberapay: diraol diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index be619481..00000000 --- a/.github/stale.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 150 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 21 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: inactive -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: > - Closed due to inactivity. diff --git a/.github/workflows/test_pymode.yml b/.github/workflows/test_pymode.yml deleted file mode 100644 index 332dcdad..00000000 --- a/.github/workflows/test_pymode.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Testing python-mode - -on: [push] - -jobs: - test-python-3_8: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Install dependencies - run: | - sudo apt update - export PYTHON_CONFIGURE_OPTS="--enable-shared" - sudo apt install -yqq libncurses5-dev libgtk2.0-dev libatk1.0-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python3-dev lua5.2 liblua5.2-dev libperl-dev git - sudo apt remove --purge -yqq vim vim-runtime gvim - - name: build and install vim from source - working-directory: /tmp - run: | - export PYTHON_CONFIGURE_OPTS="--enable-shared" - git clone https://github.com/vim/vim.git - cd vim - ./configure --with-features=huge --enable-multibyte --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.8/config-3.8m-x86_64-linux-gnu --enable-perlinterp=yes --enable-luainterp=yes --enable-cscope --prefix=/usr/local - sudo make && sudo make install - - name: Install python-mode - run: | - export PYMODE_DIR="${HOME}/work/python-mode/python-mode" - mkdir -p ${HOME}/.vim/pack/foo/start/ - ln -s ${PYMODE_DIR} ${HOME}/.vim/pack/foo/start/python-mode - cp ${PYMODE_DIR}/tests/utils/pymoderc ${HOME}/.pymoderc - cp ${PYMODE_DIR}/tests/utils/vimrc ${HOME}/.vimrc - touch ${HOME}/.vimrc.before ${HOME}/.vimrc.after - - name: Run python-mode test script - run: | - alias python=python3 - cd ${HOME}/work/python-mode/python-mode - git submodule update --init --recursive - git submodule sync - bash tests/test.sh - test-python-3_9: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Install dependencies - run: | - sudo apt update - export PYTHON_CONFIGURE_OPTS="--enable-shared" - sudo apt install -yqq libncurses5-dev libgtk2.0-dev libatk1.0-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python3-dev lua5.2 liblua5.2-dev libperl-dev git - sudo apt remove --purge -yqq vim vim-runtime gvim - - name: build and install vim from source - working-directory: /tmp - run: | - export PYTHON_CONFIGURE_OPTS="--enable-shared" - git clone https://github.com/vim/vim.git - cd vim - ./configure --with-features=huge --enable-multibyte --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.9/config-3.9m-x86_64-linux-gnu --enable-perlinterp=yes --enable-luainterp=yes --enable-cscope --prefix=/usr/local - sudo make && sudo make install - - name: Install python-mode - run: | - export PYMODE_DIR="${HOME}/work/python-mode/python-mode" - mkdir -p ${HOME}/.vim/pack/foo/start/ - ln -s ${PYMODE_DIR} ${HOME}/.vim/pack/foo/start/python-mode - cp ${PYMODE_DIR}/tests/utils/pymoderc ${HOME}/.pymoderc - cp ${PYMODE_DIR}/tests/utils/vimrc ${HOME}/.vimrc - touch ${HOME}/.vimrc.before ${HOME}/.vimrc.after - - name: Run python-mode test script - run: | - alias python=python3 - cd ${HOME}/work/python-mode/python-mode - git submodule update --init --recursive - git submodule sync - bash tests/test.sh diff --git a/AUTHORS b/AUTHORS index a4bcbf28..70ccc091 100644 --- a/AUTHORS +++ b/AUTHORS @@ -76,3 +76,4 @@ Contributors: * Xiangyu Xu (https://github.com/bkbncn); * Zach Himsel (https://github.com/zhimsel); * Nathan Pemberton (https://github.com/NathanTP); +* James Cherti (https://github.com/jamescherti); diff --git a/after/ftplugin/pyrex.vim b/after/ftplugin/pyrex.vim deleted file mode 100644 index 61d43637..00000000 --- a/after/ftplugin/pyrex.vim +++ /dev/null @@ -1 +0,0 @@ -runtime after/ftplugin/python.vim diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim deleted file mode 100644 index 6b5a8839..00000000 --- a/after/ftplugin/python.vim +++ /dev/null @@ -1,60 +0,0 @@ -if !g:pymode - finish -endif - -if g:pymode_motion - - if !&magic - if g:pymode_warning - call pymode#error("Pymode motion requires `&magic` option. Enable them or disable g:pymode_motion") - endif - finish - endif - - nnoremap ]] :call pymode#motion#move('^(class%(asyncs+)=def)s', '') - nnoremap [[ :call pymode#motion#move('^(class%(asyncs+)=def)s', 'b') - nnoremap ]C :call pymode#motion#move('^(class%(asyncs+)=def)s', '') - nnoremap [C :call pymode#motion#move('^(class%(asyncs+)=def)s', 'b') - nnoremap ]M :call pymode#motion#move('^s*(asyncs+)=defs', '') - nnoremap [M :call pymode#motion#move('^s*(asyncs+)=defs', 'b') - - onoremap ]] :call pymode#motion#move('^(class%(asyncs+)=def)s', '') - onoremap [[ :call pymode#motion#move('^(class%(asyncs+)=def)s', 'b') - onoremap ]C :call pymode#motion#move('^(class%(asyncs+)=def)s', '') - onoremap [C :call pymode#motion#move('^(class%(asyncs+)=def)s', 'b') - onoremap ]M :call pymode#motion#move('^s*(asyncs+)=defs', '') - onoremap [M :call pymode#motion#move('^s*(asyncs+)=defs', 'b') - - vnoremap ]] :call pymode#motion#vmove('^(class%(asyncs+)=def)s', '') - vnoremap [[ :call pymode#motion#vmove('^(class%(asyncs+)=def)s', 'b') - vnoremap ]M :call pymode#motion#vmove('^s*(asyncs+)=defs', '') - vnoremap [M :call pymode#motion#vmove('^s*(asyncs+)=defs', 'b') - - onoremap C :call pymode#motion#select_c('^s*classs', 0) - onoremap aC :call pymode#motion#select_c('^s*classs', 0) - onoremap iC :call pymode#motion#select_c('^s*classs', 1) - vnoremap aC :call pymode#motion#select_c('^s*classs', 0) - vnoremap iC :call pymode#motion#select_c('^s*classs', 1) - - onoremap M :call pymode#motion#select('^s*(asyncs+)=@', '^s*(asyncs+)=defs', 0) - onoremap aM :call pymode#motion#select('^s*(asyncs+)=@', '^s*(asyncs+)=defs', 0) - onoremap iM :call pymode#motion#select('^s*(asyncs+)=@', '^s*(asyncs+)=defs', 1) - vnoremap aM :call pymode#motion#select('^s*(asyncs+)=@', '^s*(asyncs+)=defs', 0) - vnoremap iM :call pymode#motion#select('^s*(asyncs+)=@', '^s*(asyncs+)=defs', 1) - - onoremap V :call pymode#rope#select_logical_line() - -endif - -if g:pymode_rope && g:pymode_rope_completion - - setlocal omnifunc=pymode#rope#completions - - if g:pymode_rope_completion_bind != "" - exe "inoremap " . g:pymode_rope_completion_bind . " =pymode#rope#complete(0)" - if tolower(g:pymode_rope_completion_bind) == '' - exe "inoremap =pymode#rope#complete(0)" - endif - endif - -endif diff --git a/autoload/pymode.vim b/autoload/pymode.vim deleted file mode 100644 index b637289a..00000000 --- a/autoload/pymode.vim +++ /dev/null @@ -1,148 +0,0 @@ -" Pymode core functions - -" DESC: Check variable and set default value if it not exists -fun! pymode#default(name, default) "{{{ - if !exists(a:name) - let {a:name} = a:default - return 0 - endif - return 1 -endfunction "}}} - -" DESC: Import python libs -fun! pymode#init(plugin_root, paths) "{{{ - - PymodePython import sys, vim - PymodePython sys.path.insert(0, vim.eval('a:plugin_root')) - PymodePython sys.path = vim.eval('a:paths') + sys.path - -endfunction "}}} - -" DESC: Show wide message -fun! pymode#wide_message(msg) "{{{ - let x=&ruler | let y=&showcmd - set noruler noshowcmd - redraw - echohl Debug | echo strpart("[Pymode] " . a:msg, 0, &columns-1) | echohl none - let &ruler=x | let &showcmd=y -endfunction "}}} - -" DESC: Show error -fun! pymode#error(msg) "{{{ - execute "normal \" - echohl ErrorMsg - echomsg "[Pymode]: error: " . a:msg - echohl None -endfunction "}}} - -" DESC: Open quickfix window -fun! pymode#quickfix_open(onlyRecognized, maxHeight, minHeight, jumpError) "{{{ - let numErrors = len(filter(getqflist(), 'v:val.valid')) - let numOthers = len(getqflist()) - numErrors - if numErrors > 0 || (!a:onlyRecognized && numOthers > 0) - let num = winnr() - botright copen - exe max([min([line("$"), a:maxHeight]), a:minHeight]) . "wincmd _" - if a:jumpError - cc - elseif num != winnr() - wincmd p - endif - else - cclose - endif - redraw - if numOthers > 0 - call pymode#wide_message(printf('Quickfix: %d(+%d)', numErrors, numOthers)) - elseif numErrors > 0 - call pymode#wide_message(printf('Quickfix: %d', numErrors)) - endif -endfunction "}}} - -" DESC: Open temp buffer. -fun! pymode#tempbuffer_open(name) "{{{ - pclose - exe g:pymode_preview_position . " " . g:pymode_preview_height . "new " . a:name - setlocal buftype=nofile bufhidden=delete noswapfile nowrap previewwindow - redraw -endfunction "}}} - -" DESC: Remove unused whitespaces -fun! pymode#trim_whitespaces() "{{{ - if g:pymode_trim_whitespaces - let cursor_pos = getpos('.') - silent! %s/\s\+$//e - call setpos('.', cursor_pos) - endif -endfunction "}}} - -fun! pymode#save() "{{{ - if &modifiable && &modified - try - noautocmd write - catch /E212/ - call pymode#error("File modified and I can't save it. Please save it manually.") - return 0 - endtry - endif - return expand('%') != '' -endfunction "}}} - -fun! pymode#reload_buf_by_nr(nr) "{{{ - let cur = bufnr("") - try - exe "buffer " . a:nr - catch /E86/ - return - endtry - exe "e!" - exe "buffer " . cur -endfunction "}}} - -fun! pymode#buffer_pre_write() "{{{ - let b:pymode_modified = &modified -endfunction "}}} - -fun! pymode#buffer_post_write() "{{{ - if g:pymode_rope - if g:pymode_rope_regenerate_on_write && b:pymode_modified - call pymode#debug('regenerate') - call pymode#rope#regenerate() - endif - endif - if g:pymode_lint - if g:pymode_lint_unmodified || (g:pymode_lint_on_write && b:pymode_modified) - call pymode#debug('check code') - call pymode#lint#check() - endif - endif -endfunction "}}} - -fun! pymode#debug(msg) "{{{ - " Pymode's debug function. - " Should be called by other pymode's functions to report outputs. See - " the function PymodeDebugFolding for example. - " TODO: why echom here creates a problem? - " echom '' . a:msg + '|||||||||||' - - let l:info_separator = repeat('-', 79) - - if g:pymode_debug - if ! exists('g:pymode_debug_counter') - let g:pymode_debug_counter = 0 - endif - let g:pymode_debug_counter += 1 - " NOTE: Print a separator for every message except folding ones (since - " they could be many). - if a:msg !~ 'has folding:' - echom l:info_separator - endif - echom '' . 'pymode debug msg ' . g:pymode_debug_counter . ': ' . a:msg - endif -endfunction "}}} - -fun! pymode#quit() "{{{ - augroup pymode - au! * - augroup END -endfunction "}}} diff --git a/autoload/pymode/breakpoint.vim b/autoload/pymode/breakpoint.vim deleted file mode 100644 index 98639b57..00000000 --- a/autoload/pymode/breakpoint.vim +++ /dev/null @@ -1,50 +0,0 @@ -fun! pymode#breakpoint#init() "{{{ - - " If breakpoints are either disabled or already defined do nothing. - if ! g:pymode_breakpoint || g:pymode_breakpoint_cmd != '' - return - - " Else go for a 'smart scan' of the defaults. - else - - PymodePython << EOF - -from importlib.util import find_spec - -if sys.version_info >= (3, 7): - vim.command('let g:pymode_breakpoint_cmd = "breakpoint()"') - -else: - for module in ('wdb', 'pudb', 'ipdb', 'pdb'): - if find_spec(module): - vim.command('let g:pymode_breakpoint_cmd = "import %s; %s.set_trace() # XXX BREAKPOINT"' % (module, module)) - break -EOF - endif - -endfunction "}}} - -fun! pymode#breakpoint#operate(lnum) "{{{ - if g:pymode_breakpoint_cmd == '' - echoerr("g:pymode_breakpoint_cmd is empty") - return -1 - endif - let line = getline(a:lnum) - if strridx(line, g:pymode_breakpoint_cmd) != -1 - normal dd - else - let plnum = prevnonblank(a:lnum) - if &expandtab - let indents = repeat(' ', indent(plnum)) - else - let indents = repeat("\t", plnum / &shiftwidth) - endif - - call append(line('.')-1, indents.g:pymode_breakpoint_cmd) - normal k - endif - - " Save file without any events - call pymode#save() - -endfunction "}}} diff --git a/autoload/pymode/debug.vim b/autoload/pymode/debug.vim deleted file mode 100644 index 2be5149c..00000000 --- a/autoload/pymode/debug.vim +++ /dev/null @@ -1,67 +0,0 @@ -" Set debugging functions. - -" DESC: Get debug information about pymode problem. -fun! pymode#debug#sysinfo() "{{{ - " OS info. {{{ - let l:os_name = "Unknown" - if has('win16') || has('win32') || has('win64') - let l:os_name = "Windows" - else - let l:os_name = substitute(system('uname'), "\n", "", "") - endif - call pymode#debug("Operating system: " . l:os_name) - " }}} - " Loaded scripts info. {{{ - call pymode#debug("Scriptnames:") - let l:scriptnames_var = execute('scriptnames') - " }}} - " Variables info. {{{ - " Drop verbose file temporarily to prevent the 'let' from showing up. - let l:tmp = &verbosefile - set verbosefile= - let l:all_variables = filter( - \ split(execute('let', 'silent!'), '\n'), - \ 'v:val =~ "^pymode"') - let &verbosefile = l:tmp - " NOTE: echom does not display multiline messages. Thus a for loop is - " needed. - call pymode#debug("Pymode variables:") - for pymodevar in sort(l:all_variables) - echom pymodevar - endfor - " }}} - " Git commit info. {{{ - " Find in the scriptnames the first occurence of 'python-mode'. Then parse - " the result outputting its path. This is in turn fed into the git command. - call pymode#debug("Git commit: ") - let l:pymode_folder = substitute( - \ filter( - \ split(l:scriptnames_var, '\n'), - \ 'v:val =~ "/python-mode/"')[0], - \ '\(^\s\+[0-9]\+:\s\+\)\([/~].*python-mode\/\)\(.*\)', - \ '\2', - \ '') - let l:git_head_sha1 = system('git -C ' . expand(l:pymode_folder). ' rev-parse HEAD ' ) - echom join(filter(split(l:git_head_sha1, '\zs'), 'v:val =~? "[0-9A-Fa-f]"'), '') - " }}} - " Git submodules status. {{{ - call pymode#debug("Git submodule status:") - let l:git_submodule_status = system('git -C ' . expand(l:pymode_folder). ' submodule status') - for submodule in split(l:git_submodule_status, '\n') - echom submodule - endfor - " }}} - call pymode#debug("End of pymode#debug#sysinfo") -endfunction "}}} - -" DESC: Define debug folding function. -function! pymode#debug#foldingexpr(lnum) "{{{ - let l:get_folding_result = pymode#folding#foldcase(a:lnum) - " NOTE: the 'has folding:' expression is special in the pymode#debug. - call pymode#debug( - \ 'line ' . a:lnum - \ . ' has folding: ' . l:get_folding_result['foldlevel'] - \ . ' with foldcase ' . l:get_folding_result['foldcase']) - return l:get_folding_result['foldlevel'] -endfunction -" }}} diff --git a/autoload/pymode/doc.vim b/autoload/pymode/doc.vim deleted file mode 100644 index a7a753c5..00000000 --- a/autoload/pymode/doc.vim +++ /dev/null @@ -1,40 +0,0 @@ -" Python-mode search by documentation -" -PymodePython import pymode - -fun! pymode#doc#find() "{{{ - " Extract the 'word' at the cursor, expanding leftwards across identifiers - " and the . operator, and rightwards across the identifier only. - " - " For example: - " import xml.dom.minidom - " ^ ! - " - " With the cursor at ^ this returns 'xml'; at ! it returns 'xml.dom'. - let l:line = getline(".") - let l:pre = l:line[:col(".") - 1] - let l:suf = l:line[col("."):] - let word = matchstr(pre, "[A-Za-z0-9_.]*$") . matchstr(suf, "^[A-Za-z0-9_]*") - call pymode#doc#show(word) -endfunction "}}} - -fun! pymode#doc#show(word) "{{{ - if a:word == '' - call pymode#error("No name/symbol under cursor!") - return 0 - endif - - call pymode#tempbuffer_open('__doc__') - PymodePython pymode.get_documentation() - setlocal nomodifiable - setlocal nomodified - setlocal filetype=rst - if g:pymode_doc_vertical - wincmd L - endif - - normal gg - - wincmd p - -endfunction "}}} diff --git a/autoload/pymode/folding.vim b/autoload/pymode/folding.vim deleted file mode 100644 index 9cbb64d3..00000000 --- a/autoload/pymode/folding.vim +++ /dev/null @@ -1,328 +0,0 @@ -" Notice that folding is based on single line so complex regular expressions -" that take previous line into consideration are not fit for the job. - -" Regex definitions for correct folding -let s:def_regex = g:pymode_folding_regex -let s:blank_regex = '^\s*$' -" Spyder, a very popular IDE for python has a template which includes -" '@author:' ; thus the regex below. -let s:decorator_regex = '^\s*@\(author:\)\@!' -let s:docstring_line_regex = '^\s*[uUrR]\=\("""\|''''''\).\+\1\s*$' -let s:docstring_begin_regex = '^\s*[uUrR]\=\%("""\|''''''\).*\S' -let s:docstring_end_regex = '\%("""\|''''''\)\s*$' -" This one is needed for the while loop to count for opening and closing -" docstrings. -let s:docstring_general_regex = '\%("""\|''''''\)' -let s:symbol = matchstr(&fillchars, 'fold:\zs.') " handles multibyte characters -if s:symbol == '' - let s:symbol = ' ' -endif -" '''''''' - -fun! pymode#folding#text() " {{{ - let fs = v:foldstart - while getline(fs) !~ s:def_regex && getline(fs) !~ s:docstring_begin_regex - let fs = nextnonblank(fs + 1) - endwhile - if getline(fs) =~ s:docstring_end_regex && getline(fs) =~ s:docstring_begin_regex - let fs = nextnonblank(fs + 1) - endif - let line = getline(fs) - - let has_numbers = &number || &relativenumber - let nucolwidth = &fdc + has_numbers * &numberwidth - let windowwidth = winwidth(0) - nucolwidth - 6 - let foldedlinecount = v:foldend - v:foldstart - - " expand tabs into spaces - let onetab = strpart(' ', 0, &tabstop) - let line = substitute(line, '\t', onetab, 'g') - - let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount)) - let line = substitute(line, '[uUrR]\=\%("""\|''''''\)', '', '') - let fillcharcount = windowwidth - len(line) - len(foldedlinecount) + 1 - return line . ' ' . repeat(s:symbol, fillcharcount) . ' ' . foldedlinecount -endfunction "}}} - -fun! pymode#folding#expr(lnum) "{{{ - - let l:return_value = pymode#folding#foldcase(a:lnum)['foldlevel'] - - return l:return_value - -endfunction "}}} - -fun! pymode#folding#foldcase(lnum) "{{{ - " Return a dictionary with a brief description of the foldcase and the - " evaluated foldlevel: {'foldcase': 'case description', 'foldlevel': 1}. - - let l:foldcase = 'general' - let l:foldlevel = 0 - - let line = getline(a:lnum) - let indent = indent(a:lnum) - let prev_line = getline(a:lnum - 1) - let next_line = getline(a:lnum + 1) - - " Decorators {{{ - if line =~ s:decorator_regex - let l:foldcase = 'decorator declaration' - let l:foldlevel = '>'.(indent / &shiftwidth + 1) - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - endif "}}} - - " Definition {{{ - if line =~ s:def_regex - - " TODO: obscure case. - " If indent of this line is greater or equal than line below - " and previous non blank line does not end with : (that is, is not a - " definition) - " Keep the same indentation - " xxx " if indent(a:lnum) >= indent(a:lnum+1) - " xxx " \ && getline(prevnonblank(a:lnum)) !~ ':\s*$' - " xxx " let l:foldcase = 'definition' - " xxx " let l:foldlevel = '=' - " xxx " return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - " xxx " endif - - " Check if last decorator is before the last def - let decorated = 0 - let lnum = a:lnum - 1 - while lnum > 0 - if getline(lnum) =~ s:def_regex - break - elseif getline(lnum) =~ s:decorator_regex - let decorated = 1 - break - endif - let lnum -= 1 - endwhile - if decorated - let l:foldcase = 'decorated function declaration' - let l:foldlevel = '=' - else - let l:foldcase = 'function declaration' - let l:foldlevel = '>'.(indent / &shiftwidth + 1) - endif - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - endif "}}} - - " Docstrings {{{ - - " TODO: A while loop now counts the number of open and closed folding in - " order to determine if it is a closing or opening folding. - " It is working but looks like it is an overkill. - - " Notice that an effect of this is that other docstring matches will not - " be one liners. - if line =~ s:docstring_line_regex - let l:foldcase = 'one-liner docstring' - let l:foldlevel = '=' - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - endif - if line =~ s:docstring_begin_regex - if s:Is_opening_folding(a:lnum) - let l:foldcase = 'open multiline docstring' - let l:foldlevel = 'a1' - endif - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - endif - if line =~ s:docstring_end_regex - if !s:Is_opening_folding(a:lnum) - let l:foldcase = 'close multiline docstring' - let l:foldlevel = 's1' - endif - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - endif "}}} - - " Blocks. {{{ - let s:save_cursor = getcurpos() - let line_block_start = s:BlockStart(a:lnum) - let line_block_end = s:BlockEnd(a:lnum) - let prev_line_block_start = s:BlockStart(a:lnum - 1) - if line !~ s:blank_regex - if line_block_start == prev_line_block_start - \ || a:lnum - line_block_start == 1 - let l:foldcase = 'non blank line; first line of block or part of it' - let l:foldlevel = '=' - elseif indent < indent(prevnonblank(a:lnum - 1)) - if indent == 0 - let l:foldcase = 'non blank line; zero indent' - let l:foldlevel = 0 - else - let l:foldcase = 'non blank line; non zero indent' - let l:foldlevel = indent(line_block_start) / &shiftwidth + 1 - endif - endif - call setpos('.', s:save_cursor) - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - else - call setpos('.', s:save_cursor) - endif - " endif " }}} - - " Blank Line {{{ - " Comments: cases of blank lines: - " 1. After non blank line: gets folded with previous line. - " 1. Just after a block; in this case it gets folded with the block. - " 1. Between docstrings and imports. - " 1. Inside docstrings. - " 2. Inside functions/methods. - " 3. Between functions/methods. - if line =~ s:blank_regex - if prev_line !~ s:blank_regex - let l:foldcase = 'blank line after non blank line' - let l:foldlevel = '=' - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - elseif a:lnum > line_block_start && a:lnum < line_block_end - let l:foldcase = 'blank line inside block' - let l:foldlevel = '=' - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - endif - " if prev_line =~ s:blank_regex - " if indent(a:lnum + 1) == 0 && next_line !~ s:blank_regex && next_line !~ s:docstring_general_regex - " if s:Is_opening_folding(a:lnum) - " let l:foldcase = 'case 1' - " let l:foldlevel = '=' - " return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - " else - " let l:foldcase = 'case 2' - " let l:foldlevel = 0 - " return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - " endif - " endif - " let l:foldcase = 'case 3' - " let l:foldlevel = -1 - " return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - " else - " let l:foldcase = 'case 4' - " let l:foldlevel = '=' - " return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - " endif - endif " }}} - - return {'foldcase': l:foldcase, 'foldlevel': l:foldlevel} - -endfunction "}}} - -fun! s:BlockStart(lnum) "{{{ - " Returns the definition statement line which encloses the current line. - - let line = getline(a:lnum) - if line !~ s:blank_regex - let l:inferred_indent = indent(a:lnum) - else - let l:inferred_indent = prevnonblank(a:lnum) - endif - - " Note: Make sure to reset cursor position after using this function. - call cursor(a:lnum, 0) - - " In case the end of the block is indented to a higher level than the def - " statement plus one shiftwidth, we need to find the indent level at the - " bottom of that if/for/try/while/etc. block. - " Flags from searchpos() (same as search()): - " b: search Backward instead of forward - " n: do Not move the cursor - " W: don't Wrap around the end of the file - let previous_definition = searchpos(s:def_regex, 'bnW') - - while previous_definition[0] != 1 && previous_definition != [0, 0] - \ && indent(previous_definition[0]) >= l:inferred_indent - let previous_definition = searchpos(s:def_regex, 'bnW') - call cursor(previous_definition[0] - 1, 0) - endwhile - let last_def = previous_definition[0] - if last_def - call cursor(last_def, 0) - let last_def_indent = indent(last_def) - call cursor(last_def, 0) - let next_stmt_at_def_indent = searchpos('\v^\s{'.last_def_indent.'}[^[:space:]#]', 'nW')[0] - else - let next_stmt_at_def_indent = -1 - endif - - " Now find the class/def one shiftwidth lower than the start of the - " aforementioned indent block. - if next_stmt_at_def_indent && (next_stmt_at_def_indent < a:lnum) - let max_indent = max([indent(next_stmt_at_def_indent) - &shiftwidth, 0]) - else - let max_indent = max([indent(prevnonblank(a:lnum)) - &shiftwidth, 0]) - endif - - let result = searchpos('\v^\s{,'.max_indent.'}(def |class )\w', 'bcnW')[0] - - return result - -endfunction "}}} -function! Blockstart(x) - let save_cursor = getcurpos() - return s:BlockStart(a:x) - call setpos('.', save_cursor) -endfunction - -fun! s:BlockEnd(lnum) "{{{ - " Note: Make sure to reset cursor position after using this function. - call cursor(a:lnum, 0) - return searchpos('\v^\s{,'.indent('.').'}\S', 'nW')[0] - 1 -endfunction "}}} -function! Blockend(lnum) - let save_cursor = getcurpos() - return s:BlockEnd(a:lnum) - call setpos('.', save_cursor) -endfunction - -function! s:Is_opening_folding(lnum) "{{{ - " Helper function to see if multi line docstring is opening or closing. - - " Cache the result so the loop runs only once per change. - if get(b:, 'fold_changenr', -1) == changenr() - return b:fold_cache[a:lnum - 1] "If odd then it is an opening - else - let b:fold_changenr = changenr() - let b:fold_cache = [] - endif - - " To be analized if odd/even to inform if it is opening or closing. - let fold_odd_even = 0 - " To inform is already has an open docstring. - let has_open_docstring = 0 - " To help skipping ''' and """ which are not docstrings. - let extra_docstrings = 0 - - " The idea of this part of the function is to identify real docstrings and - " not just triple quotes (that could be a regular string). - - " Iterater over all lines from the start until current line (inclusive) - for i in range(1, line('$')) - - let i_line = getline(i) - - if i_line =~ s:docstring_begin_regex && ! has_open_docstring - " This causes the loop to continue if there is a triple quote which - " is not a docstring. - if extra_docstrings > 0 - let extra_docstrings = extra_docstrings - 1 - else - let has_open_docstring = 1 - let fold_odd_even = fold_odd_even + 1 - endif - " If it is an end doc and has an open docstring. - elseif i_line =~ s:docstring_end_regex && has_open_docstring - let has_open_docstring = 0 - let fold_odd_even = fold_odd_even + 1 - - elseif i_line =~ s:docstring_general_regex - let extra_docstrings = extra_docstrings + 1 - endif - - call add(b:fold_cache, fold_odd_even % 2) - - endfor - - return b:fold_cache[a:lnum] - -endfunction "}}} - -" vim: fdm=marker:fdl=0 diff --git a/autoload/pymode/lint.vim b/autoload/pymode/lint.vim deleted file mode 100644 index 29dd6168..00000000 --- a/autoload/pymode/lint.vim +++ /dev/null @@ -1,104 +0,0 @@ -PymodePython from pymode.lint import code_check - -call pymode#tools#signs#init() -call pymode#tools#loclist#init() - - -fun! pymode#lint#auto() "{{{ - if ! pymode#save() - return 0 - endif - PymodePython from pymode import auto - PymodePython auto() - cclose - call g:PymodeSigns.clear() - edit - call pymode#wide_message("AutoPep8 done.") -endfunction "}}} - - -fun! pymode#lint#show_errormessage() "{{{ - let loclist = g:PymodeLocList.current() - if loclist.is_empty() - return - endif - - let l = line('.') - if l == b:pymode_error_line - return - endif - let b:pymode_error_line = l - if has_key(loclist._messages, l) - call pymode#wide_message(loclist._messages[l]) - else - echo - endif -endfunction "}}} - - -fun! pymode#lint#toggle() "{{{ - let g:pymode_lint = g:pymode_lint ? 0 : 1 - if g:pymode_lint - call pymode#wide_message("Code checking is enabled.") - else - call pymode#wide_message("Code checking is disabled.") - endif -endfunction "}}} - - -fun! pymode#lint#check() "{{{ - " DESC: Run checkers on current file. - " - let loclist = g:PymodeLocList.current() - - let b:pymode_error_line = -1 - - call loclist.clear() - - call pymode#wide_message('Code checking is running ...') - - PymodePython code_check() - - if loclist.is_empty() - call pymode#wide_message('Code checking is completed. No errors found.') - call g:PymodeSigns.refresh(loclist) - call loclist.show() - return - endif - - call g:PymodeSigns.refresh(loclist) - - call loclist.show() - - call pymode#lint#show_errormessage() - call pymode#wide_message('Found ' . loclist.num_errors() . ' error(s) and ' . loclist.num_warnings() . ' warning(s)') - -endfunction " }}} - - -fun! pymode#lint#tick_queue() "{{{ - - python import time - python print time.time() - - if mode() == 'i' - if col('.') == 1 - call feedkeys("\\", "n") - else - call feedkeys("\\", "n") - endif - else - call feedkeys("f\e", "n") - endif -endfunction "}}} - - -fun! pymode#lint#stop() "{{{ - au! pymode CursorHold -endfunction "}}} - - -fun! pymode#lint#start() "{{{ - au! pymode CursorHold call pymode#lint#tick_queue() - call pymode#lint#tick_queue() -endfunction "}}} diff --git a/autoload/pymode/motion.vim b/autoload/pymode/motion.vim deleted file mode 100644 index c88fb913..00000000 --- a/autoload/pymode/motion.vim +++ /dev/null @@ -1,105 +0,0 @@ -" Python-mode motion functions - - -fun! pymode#motion#move(pattern, flags, ...) "{{{ - let cnt = v:count1 - 1 - let [line, column] = searchpos(a:pattern, a:flags . 'sW') - let indent = indent(line) - while cnt && line - let [line, column] = searchpos(a:pattern, a:flags . 'W') - if indent(line) == indent - let cnt = cnt - 1 - endif - endwhile - return [line, column] -endfunction "}}} - - -fun! pymode#motion#vmove(pattern, flags) range "{{{ - call cursor(a:lastline, 0) - let end = pymode#motion#move(a:pattern, a:flags) - call cursor(a:firstline, 0) - normal! v - call cursor(end) -endfunction "}}} - - -fun! pymode#motion#pos_le(pos1, pos2) "{{{ - return ((a:pos1[0] < a:pos2[0]) || (a:pos1[0] == a:pos2[0] && a:pos1[1] <= a:pos2[1])) -endfunction "}}} - -fun! pymode#motion#select(first_pattern, second_pattern, inner) "{{{ - let cnt = v:count1 - 1 - let orig = getpos('.')[1:2] - let posns = s:BlockStart(orig[0], a:first_pattern, a:second_pattern) - if getline(posns[0]) !~ a:first_pattern && getline(posns[0]) !~ a:second_pattern - return 0 - endif - let snum = posns[0] - let enum = s:BlockEnd(posns[1], indent(posns[1])) - while cnt - let lnum = search(a:second_pattern, 'nW') - if lnum - let enum = s:BlockEnd(lnum, indent(lnum)) - call cursor(enum, 1) - endif - let cnt = cnt - 1 - endwhile - if pymode#motion#pos_le([snum, 0], orig) && pymode#motion#pos_le(orig, [enum+1, 0]) - if a:inner - let snum = posns[1] + 1 - endif - - call cursor(snum, 1) - normal! V - call cursor(enum, len(getline(enum))) - endif -endfunction "}}} - -fun! pymode#motion#select_c(pattern, inner) "{{{ - call pymode#motion#select(a:pattern, a:pattern, a:inner) -endfunction "}}} - -fun! s:BlockStart(lnum, first_pattern, second_pattern) "{{{ - let lnum = a:lnum + 1 - let indent = 100 - while lnum - let lnum = prevnonblank(lnum - 1) - let test = indent(lnum) - let line = getline(lnum) - " Skip comments, deeper or equal lines - if line =~ '^\s*#' || test >= indent - continue - endif - let indent = indent(lnum) - - " Indent is strictly less at this point: check for def/class/@ - if line =~ a:first_pattern || line =~ a:second_pattern - while getline(lnum-1) =~ a:first_pattern - let lnum = lnum - 1 - endwhile - let first_pos = lnum - while getline(lnum) !~ a:second_pattern - let lnum = lnum + 1 - endwhile - let second_pos = lnum - return [first_pos, second_pos] - endif - endwhile - return [0, 0] -endfunction "}}} - - -fun! s:BlockEnd(lnum, ...) "{{{ - let indent = a:0 ? a:1 : indent(a:lnum) - let lnum = a:lnum - while lnum - let lnum = nextnonblank(lnum + 1) - if getline(lnum) =~ '^\s*#' | continue - elseif lnum && indent(lnum) <= indent - return prevnonblank(lnum - 1) - endif - endwhile - return line('$') -endfunction "}}} -" vim: fdm=marker:fdl=0 diff --git a/autoload/pymode/rope.vim b/autoload/pymode/rope.vim deleted file mode 100644 index 36344d0a..00000000 --- a/autoload/pymode/rope.vim +++ /dev/null @@ -1,200 +0,0 @@ -" Python-mode Rope support - -if ! g:pymode_rope - finish -endif - -PymodePython from pymode import rope - -call pymode#tools#loclist#init() - - -fun! pymode#rope#completions(findstart, base) - PymodePython rope.completions() -endfunction - -fun! pymode#rope#complete(dot) - if pumvisible() - if stridx('noselect', &completeopt) != -1 - return "\" - else - return "" - endif - endif - if a:dot - PymodePython rope.complete(True) - else - PymodePython rope.complete() - endif - return pumvisible() && stridx('noselect', &completeopt) != -1 ? "\\" : "" -endfunction - -fun! pymode#rope#complete_on_dot() "{{{ - if !exists("*synstack") - return "" - endif - for group in map(synstack(line('.'), col('.') - 1), 'synIDattr(v:val, "name")') - for name in ['pythonString', 'pythonComment', 'pythonNumber', 'pythonDocstring'] - if group == name - return "" - endif - endfor - endfor - if g:pymode_rope_autoimport_import_after_complete - PymodePython rope.complete_check() - endif - return pymode#rope#complete(1) -endfunction "}}} - -fun! pymode#rope#goto_definition() - PymodePython rope.goto() -endfunction - - -fun! pymode#rope#organize_imports() - if !pymode#save() - return 0 - endif - call pymode#wide_message('Organize imports ... ') - PymodePython rope.organize_imports() -endfunction - - -fun! pymode#rope#find_it() - let loclist = g:PymodeLocList.current() - let loclist._title = "Occurrences" - call pymode#wide_message('Finding Occurrences ...') - PymodePython rope.find_it() - call loclist.show() -endfunction - - -fun! pymode#rope#show_doc() - let l:output = [] - - PymodePython rope.show_doc() - - if !empty(l:output) - call pymode#tempbuffer_open('__doc____rope__') - call append(0, l:output) - setlocal nomodifiable - setlocal nomodified - setlocal filetype=rst - - normal gg - - wincmd p - endif -endfunction - - -fun! pymode#rope#regenerate() "{{{ - call pymode#wide_message('Regenerate Rope cache ... ') - PymodePython rope.regenerate() -endfunction "}}} - - -fun! pymode#rope#new(...) "{{{ - PymodePython rope.new() -endfunction "}}} - - -fun! pymode#rope#rename() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.RenameRefactoring().run() -endfunction "}}} - -fun! pymode#rope#rename_module() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.RenameRefactoring(True).run() -endfunction "}}} - -fun! pymode#rope#extract_method() range "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.ExtractMethodRefactoring().run() -endfunction "}}} - -fun! pymode#rope#extract_variable() range "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.ExtractVariableRefactoring().run() -endfunction "}}} - -fun! pymode#rope#undo() "{{{ - PymodePython rope.undo() -endfunction "}}} - -fun! pymode#rope#redo() "{{{ - PymodePython rope.redo() -endfunction "}}} - -fun! pymode#rope#inline() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.InlineRefactoring().run() -endfunction "}}} - -fun! pymode#rope#move() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.MoveRefactoring().run() -endfunction "}}} - -fun! pymode#rope#signature() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.ChangeSignatureRefactoring().run() -endfunction "}}} - -fun! pymode#rope#use_function() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.UseFunctionRefactoring().run() -endfunction "}}} - -fun! pymode#rope#module_to_package() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.ModuleToPackageRefactoring().run() -endfunction "}}} - -fun! pymode#rope#autoimport(word) "{{{ - PymodePython rope.autoimport() -endfunction "}}} - -fun! pymode#rope#generate_function() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.GenerateElementRefactoring('function').run() -endfunction "}}} - -fun! pymode#rope#generate_class() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.GenerateElementRefactoring('class').run() -endfunction "}}} - -fun! pymode#rope#generate_package() "{{{ - if !pymode#save() - return 0 - endif - PymodePython rope.GenerateElementRefactoring('package').run() -endfunction "}}} - -fun! pymode#rope#select_logical_line() "{{{ - PymodePython rope.select_logical_line() -endfunction "}}} diff --git a/autoload/pymode/run.vim b/autoload/pymode/run.vim deleted file mode 100644 index 356409b6..00000000 --- a/autoload/pymode/run.vim +++ /dev/null @@ -1,99 +0,0 @@ -" The following lines set Vim's errorformat variable, to allow the -" quickfix window to show Python tracebacks properly. It is much -" easier to use let than set, because set requires many more -" characters to be escaped. This is much easier to read and -" maintain. % escapes are still needed however before any regex meta -" characters. Hence \S (non-whitespace) becomes %\S etc. Note that -" * becomes %#, so .* (match any character) becomes %.%# Commas must -" also be escaped, with a backslash (\,). See the Vim help on -" quickfix for details. -" -" Python errors are multi-lined. They often start with 'Traceback', so -" we want to capture that (with +G) and show it in the quickfix window -" because it explains the order of error messages. -let s:efm = '%+GTraceback%.%#,' - -" The error message itself starts with a line with 'File' in it. There -" are a couple of variations, and we need to process a line beginning -" with whitespace followed by File, the filename in "", a line number, -" and optional further text. %E here indicates the start of a multi-line -" error message. The %\C at the end means that a case-sensitive search is -" required. -let s:efm .= '%E File "%f"\, line %l\,%m%\C,' -let s:efm .= '%E File "%f"\, line %l%\C,' - -" The possible continutation lines are idenitifed to Vim by %C. We deal -" with these in order of most to least specific to ensure a proper -" match. A pointer (^) identifies the column in which the error occurs -" (but will not be entirely accurate due to indention of Python code). -let s:efm .= '%C%p^,' - -" Any text, indented by more than two spaces contain useful information. -" We want this to appear in the quickfix window, hence %+. -let s:efm .= '%+C %.%#,' -let s:efm .= '%+C %.%#,' - -" The last line (%Z) does not begin with any whitespace. We use a zero -" width lookahead (\&) to check this. The line contains the error -" message itself (%m) -let s:efm .= '%Z%\S%\&%m,' - -" We can ignore any other lines (%-G) -let s:efm .= '%-G%.%#' - -PymodePython from pymode.run import run_code - - -" DESC: Run python code -fun! pymode#run#code_run(line1, line2) "{{{ - - let l:output = [] - let l:traceback = [] - call setqflist([]) - - call pymode#wide_message("Code running ...") - - try - - PymodePython run_code() - - if len(l:output) - call pymode#tempbuffer_open('__run__') - call append(line('$'), l:output) - normal dd - wincmd p - else - call pymode#wide_message("No output.") - endif - - cexpr "" - - let l:_efm = &efm - - let &efm = s:efm - - cgetexpr(l:traceback) - - " If a range is run (starting other than at line 1), fix the reported - " error line numbers for the current buffer - if a:line1 > 1 - let qflist = getqflist() - for i in qflist - if i.bufnr == bufnr("") - let i.lnum = i.lnum - 1 + a:line1 - endif - endfor - call setqflist(qflist) - endif - - call pymode#quickfix_open(0, g:pymode_quickfix_maxheight, g:pymode_quickfix_maxheight, 0) - - let &efm = l:_efm - - catch /E234/ - - echohl Error | echo "Run-time error." | echohl none - - endtry - -endfunction "}}} diff --git a/autoload/pymode/tools/loclist.vim b/autoload/pymode/tools/loclist.vim deleted file mode 100644 index b9121bdf..00000000 --- a/autoload/pymode/tools/loclist.vim +++ /dev/null @@ -1,99 +0,0 @@ -let g:PymodeLocList= {} - - -fun! pymode#tools#loclist#init() "{{{ - return -endfunction "}}} - - -fun! g:PymodeLocList.init(raw_list) "{{{ - let obj = copy(self) - let loc_list = filter(copy(a:raw_list), 'v:val["valid"] == 1') - call obj.clear() - let obj._title = 'CodeCheck' - return obj -endfunction "}}} - - -fun! g:PymodeLocList.current() "{{{ - if !exists("b:pymode_loclist") - let b:pymode_loclist = g:PymodeLocList.init([]) - endif - return b:pymode_loclist -endfunction "}}} - - -fun! g:PymodeLocList.is_empty() "{{{ - return empty(self._errlist) && empty(self._warnlist) -endfunction "}}} - -fun! g:PymodeLocList.loclist() "{{{ - let loclist = copy(self._errlist) - call extend(loclist, self._warnlist) - return loclist -endfunction "}}} - -fun! g:PymodeLocList.num_errors() "{{{ - return len(self._errlist) -endfunction "}}} - -fun! g:PymodeLocList.num_warnings() "{{{ - return len(self._warnlist) -endfunction "}}} - - -fun! g:PymodeLocList.clear() "{{{ - let self._errlist = [] - let self._warnlist = [] - let self._messages = {} - let self._name = expand('%:t') -endfunction "}}} - - -fun! g:PymodeLocList.extend(raw_list) "{{{ - let err_list = filter(copy(a:raw_list), 'v:val["type"] == "E"') - let warn_list = filter(copy(a:raw_list), 'v:val["type"] != "E"') - call extend(self._errlist, err_list) - call extend(self._warnlist, warn_list) - for issue in a:raw_list - let self._messages[issue.lnum] = issue.text - endfor - return self -endfunction "}}} - - -fun! g:PymodeLocList.filter(filters) "{{{ - let loclist = [] - for error in self.loclist() - let passes_filters = 1 - for key in keys(a:filters) - if get(error, key, '') !=? a:filters[key] - let passes_filters = 0 - break - endif - endfor - - if passes_filters - call add(loclist, error) - endif - - endfor - return loclist -endfunction "}}} - - -fun! g:PymodeLocList.show() "{{{ - call setloclist(0, self.loclist()) - if self.is_empty() - lclose - elseif g:pymode_lint_cwindow - let num = winnr() - lopen - setl nowrap - execute max([min([line("$"), g:pymode_quickfix_maxheight]), g:pymode_quickfix_minheight]) . "wincmd _" - if num != winnr() - call setwinvar(winnr(), 'quickfix_title', self._title . ' <' . self._name . '>') - exe num . "wincmd w" - endif - end -endfunction "}}} diff --git a/autoload/pymode/tools/signs.vim b/autoload/pymode/tools/signs.vim deleted file mode 100644 index 579573ed..00000000 --- a/autoload/pymode/tools/signs.vim +++ /dev/null @@ -1,57 +0,0 @@ -let g:PymodeSigns = {} - - -fun! pymode#tools#signs#init() "{{{ - call g:PymodeSigns.setup() -endfunction "}}} - - -fun! g:PymodeSigns.enabled() "{{{ - return (g:pymode_lint_signs && has('signs')) -endfunction "}}} - - -fun! g:PymodeSigns.setup() "{{{ - if self.enabled() - execute 'sign define PymodeW text=' . g:pymode_lint_todo_symbol . " texthl=Todo" - execute 'sign define PymodeD text=' . g:pymode_lint_docs_symbol . " texthl=String" - execute 'sign define PymodeC text=' . g:pymode_lint_comment_symbol . " texthl=Comment" - execute 'sign define PymodeR text=' . g:pymode_lint_visual_symbol . " texthl=Visual" - execute 'sign define PymodeE text=' . g:pymode_lint_error_symbol . " texthl=Error" - execute 'sign define PymodeI text=' . g:pymode_lint_info_symbol . " texthl=Info" - execute 'sign define PymodeF text=' . g:pymode_lint_pyflakes_symbol . " texthl=Info" - endif - let self._sign_ids = [] - let self._next_id = 10000 - let self._messages = {} -endfunction "}}} - - -fun! g:PymodeSigns.refresh(loclist) "{{{ - if self.enabled() - call self.clear() - call self.place(a:loclist) - endif -endfunction "}}} - - -fun! g:PymodeSigns.clear() "{{{ - let ids = copy(self._sign_ids) - for i in ids - execute "sign unplace " . i - call remove(self._sign_ids, index(self._sign_ids, i)) - endfor -endfunction "}}} - - -fun! g:PymodeSigns.place(loclist) "{{{ - let seen = {} - for issue in a:loclist.loclist() - if !has_key(seen, issue.lnum) - let seen[issue.lnum] = 1 - call add(self._sign_ids, self._next_id) - execute printf('sign place %d line=%d name=%s buffer=%d', self._next_id, issue.lnum, "Pymode".issue.type[0], issue.bufnr) - let self._next_id += 1 - endif - endfor -endfunction "}}} diff --git a/autoload/pymode/virtualenv.vim b/autoload/pymode/virtualenv.vim deleted file mode 100644 index 7401e94b..00000000 --- a/autoload/pymode/virtualenv.vim +++ /dev/null @@ -1,17 +0,0 @@ -" Support virtualenv -" -PymodePython from pymode.virtualenv import enable_virtualenv - -fun! pymode#virtualenv#init() "{{{ - if !g:pymode_virtualenv || g:pymode_virtualenv_path == "" - return - endif - - PymodePython enable_virtualenv() - -endfunction "}}} - -fun! pymode#virtualenv#activate(path) "{{{ - let g:pymode_virtualenv_path = a:path - call pymode#virtualenv#init() -endfunction "}}} diff --git a/debugvimrc.vim b/debugvimrc.vim deleted file mode 100644 index a8b3f188..00000000 --- a/debugvimrc.vim +++ /dev/null @@ -1,32 +0,0 @@ -" Use this settings for testing the plugin. -" -" Run vim with command: -" -" $ vim -u ./debug.vim /my/py/file.py -" -" Only python-mode will be loaded. - -" Disable all persistence between sessions. -let skip_defaults_vim=1 -" TODO XXX: this nevertheless keeps viminfo enabled. As a workaround the flag -" '-i NONE' should be added to vim's loading. -set viminfo= -set nobackup -set noswapfile - -" Modify vimrc configuration. -execute('set rtp+='. expand(':p:h')) -set rtp -=$HOME/.vim -set rtp -=$HOME/.vim/after -set nocompatible - -" Activate debugging. -let g:pymode_debug = 1 - -" Define a common shell for non Windows systems. -if ! (has('win16') || has('win32') || has('win64')) - set shell=/bin/bash -endif - -" IMPORTANT: Do note that the history of this session is saved on the log file. -" See the augroup in ./ftplugin/python/pymode.vim file. diff --git a/ftplugin/python/pymode.vim b/ftplugin/python/pymode.vim deleted file mode 100644 index a1370669..00000000 --- a/ftplugin/python/pymode.vim +++ /dev/null @@ -1,258 +0,0 @@ -if !g:pymode || pymode#default('b:pymode', 1) - finish -endif - -if g:pymode_python == 'disable' - - if g:pymode_warning - call pymode#error("Pymode requires vim compiled with +python3 (exclusively). Most of features will be disabled.") - endif - - finish - -else - - -let b:pymode_modified = &modified - -" Init paths -if !pymode#default('g:pymode_init', 1) - - call pymode#init(expand(':p:h:h:h'), g:pymode_paths) - call pymode#virtualenv#init() - call pymode#breakpoint#init() - - PymodePython from pymode.utils import patch_paths - PymodePython patch_paths() - - endif - -endif - -command! -buffer -nargs=1 PymodeVirtualenv call pymode#virtualenv#activate() - -" Setup events for pymode -au! pymode BufWritePre call pymode#buffer_pre_write() -au! pymode BufWritePost call pymode#buffer_post_write() - -" Run python code -if g:pymode_run - - command! -buffer -nargs=0 -range=% PymodeRun call pymode#run#code_run(, ) - - exe "nnoremap " g:pymode_run_bind ":PymodeRun" - exe "vnoremap " g:pymode_run_bind ":PymodeRun" - -endif - -" Add/remove breakpoints -if g:pymode_breakpoint - - exe "nnoremap " g:pymode_breakpoint_bind ":call pymode#breakpoint#operate(line('.'))" - -endif - -" Python folding -if g:pymode_folding - - setlocal foldmethod=expr - setlocal foldexpr=pymode#folding#expr(v:lnum) - setlocal foldtext=pymode#folding#text() - -endif - -" Remove unused whitespaces -if g:pymode_trim_whitespaces - au BufWritePre call pymode#trim_whitespaces() -endif - -" Custom options -if g:pymode_options - setlocal complete+=t - setlocal formatoptions-=t - if v:version > 702 && !&relativenumber - setlocal number - endif - setlocal nowrap - exe "setlocal textwidth=" . g:pymode_options_max_line_length - if g:pymode_options_colorcolumn && exists('+colorcolumn') - setlocal colorcolumn=+1 - endif - setlocal commentstring=#%s - setlocal define=^\s*\\(def\\\\|class\\) -endif - -if g:pymode_lint - - command! -buffer -nargs=0 PymodeLintAuto :call pymode#lint#auto() - command! -buffer -nargs=0 PymodeLintToggle :call pymode#lint#toggle() - command! -buffer -nargs=0 PymodeLint :call pymode#lint#check() - - if v:version > 703 || (v:version == 703 && has('patch544')) - au! QuitPre call pymode#quit() - else - au! pymode BufWinLeave * silent! lclose - endif - - let b:pymode_error_line = -1 - - if g:pymode_lint_on_fly - au! pymode InsertLeave PymodeLint - endif - - if g:pymode_lint_message - au! pymode CursorMoved - au! pymode CursorMoved call pymode#lint#show_errormessage() - endif - - " Disabled for current release - if g:pymode_lint_async - " let &l:updatetime = g:pymode_lint_async_updatetime - " au! BufEnter call pymode#lint#start() - " au! BufLeave call pymode#lint#stop() - endif - -endif - -" Show python documentation -if g:pymode_doc - - " Set commands - command! -buffer -nargs=1 PymodeDoc call pymode#doc#show("") - - " Set keys - exe "nnoremap " g:pymode_doc_bind ":call pymode#doc#find()" - exe "vnoremap " g:pymode_doc_bind ":call pymode#doc#show(@*)" - -endif - -" Rope support -if g:pymode_rope - - if g:pymode_rope_goto_definition_bind != "" - exe "noremap " . g:pymode_rope_goto_definition_bind . " :call pymode#rope#goto_definition()" - endif - if g:pymode_rope_show_doc_bind != "" - exe "noremap " . g:pymode_rope_show_doc_bind . " :call pymode#rope#show_doc()" - endif - if g:pymode_rope_find_it_bind != "" - exe "noremap " . g:pymode_rope_find_it_bind . " :call pymode#rope#find_it()" - endif - if g:pymode_rope_organize_imports_bind != "" - exe "noremap " . g:pymode_rope_organize_imports_bind . " :call pymode#rope#organize_imports()" - endif - - if g:pymode_rope_rename_bind != "" - exe "noremap " . g:pymode_rope_rename_bind . " :call pymode#rope#rename()" - endif - - if g:pymode_rope_rename_module_bind != "" - exe "noremap " . g:pymode_rope_rename_module_bind . " :call pymode#rope#rename_module()" - endif - - if g:pymode_rope_extract_method_bind != "" - exe "vnoremap " . g:pymode_rope_extract_method_bind . " :call pymode#rope#extract_method()" - endif - - if g:pymode_rope_extract_variable_bind != "" - exe "vnoremap " . g:pymode_rope_extract_variable_bind . " :call pymode#rope#extract_variable()" - endif - - if g:pymode_rope_inline_bind != "" - exe "noremap " . g:pymode_rope_inline_bind . " :call pymode#rope#inline()" - endif - - if g:pymode_rope_move_bind != "" - exe "noremap " . g:pymode_rope_move_bind . " :call pymode#rope#move()" - endif - - if g:pymode_rope_change_signature_bind != "" - exe "noremap " . g:pymode_rope_change_signature_bind . " :call pymode#rope#signature()" - endif - - if g:pymode_rope_use_function_bind != "" - exe "noremap " . g:pymode_rope_use_function_bind . " :call pymode#rope#use_function()" - endif - - if g:pymode_rope_generate_function_bind != "" - exe "noremap " . g:pymode_rope_generate_function_bind . " :call pymode#rope#generate_function()" - endif - - if g:pymode_rope_generate_package_bind != "" - exe "noremap " . g:pymode_rope_generate_package_bind . " :call pymode#rope#generate_package()" - endif - - if g:pymode_rope_generate_class_bind != "" - exe "noremap " . g:pymode_rope_generate_class_bind . " :call pymode#rope#generate_class()" - endif - - if g:pymode_rope_module_to_package_bind != "" - exe "noremap " . g:pymode_rope_module_to_package_bind . " :call pymode#rope#module_to_package()" - endif - - if g:pymode_rope_autoimport_bind != "" - exe "noremap " . g:pymode_rope_autoimport_bind . " :PymodeRopeAutoImport" - endif - - if g:pymode_rope_completion && g:pymode_rope_complete_on_dot - inoremap . .=pymode#rope#complete_on_dot() - endif - - command! -buffer -nargs=? PymodeRopeNewProject call pymode#rope#new() - command! -buffer PymodeRopeUndo call pymode#rope#undo() - command! -buffer PymodeRopeRedo call pymode#rope#redo() - command! -buffer PymodeRopeRenameModule call pymode#rope#rename_module() - command! -buffer PymodeRopeModuleToPackage call pymode#rope#module_to_package() - command! -buffer PymodeRopeRegenerate call pymode#rope#regenerate() - - if g:pymode_rope_autoimport - command! -buffer PymodeRopeAutoImport call pymode#rope#autoimport(expand('')) - endif - -endif - - -if g:pymode_debug - " Redefine functions to be debugged here functions here. - - " NOTE: The redraw seems to be necessary to force messages to get echoed to - " the screen. See: - " https://groups.google.com/forum/#!topic/vim_use/EfcXOjq_rKE - " for details. - " silent! redraw! - " TODO: when loading with 'vim -u ./debug.vim' the messages shown in vim - " are unduly cleared. Need a fix. - - " Start debbuging environment. {{{ - if ! &verbosefile - " Get a system independent temporary filename. The 'marker' variable is - " used to get rid of a null character getting inserted at position. - " substitute() was not able to remove it. - " TODO: see https://superuser.com/questions/935574/get-rid-of-null-character-in-vim-variable - let g:pymode_debug_tempfile=matchstr( - \ execute( - \ g:pymode_python - \ . " import os;import tempfile; marker='|';" - \ . " print(marker, tempfile.gettempdir(), os.sep, " - \ . "'pymode_debug_file.txt', marker, sep='', end='')"), - \ '|\zs.*\ze|') - execute "set verbosefile=" . g:pymode_debug_tempfile - endif - call pymode#debug('Starting debug on: ' - \ . strftime("\%Y-\%m-\%d \%H:\%M:\%S") - \ . ' with file ' . &verbosefile) - " }}} - " Redefine folding expression. {{{ - if g:pymode_folding - setlocal foldexpr=pymode#debug#foldingexpr(v:lnum) - endif - call pymode#debug#sysinfo() - " }}} - " Define auto commands for vim. {{{ - augroup augroup_save_issue_commands - autocmd! - autocmd VimLeave *.py | call pymode#debug('Session history:') | silent! history - augroup END - " }}} - - endif diff --git a/logo.png b/logo.png deleted file mode 100644 index b873f5cbeecd98729f2c9759dc43f975640fdf70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16429 zcmb`ubyOY8wmynO&|twOxVt;S-QC?~;jY2mU4px_a19dNU4t()xWkXV@44shckYva z-WsDa=qA4fKW8z@PU}WlGY{uYW=lCHF2FB;X^Kolu=3+$bVP|Xa z%;UjN^0x%f$NgVqMiSz`MOF0|1mKB@iTRvN&3TkX#s8)L z@x)JJ>EhzZ!^r6F?#|%O%HZH+!N|}l^} zP~`iFkw?zK)XLmb)X2q5fQ5;fm7a;6o`qYLnT>~uorjBwkMTcb{>SIv+9FP7MlKFc zstyje0*Y21X0~>JJrc7pu>60?d4j|BLpI`2OZ;DVsSv*t-5L&-oG5|04dUf{25iqm!Al z^Is0w|0VxV+JDObk9{?JE0=%Q=|9N-sipZpe1U&g>z~AbDg6HiwwZ_3{{z^6asD^h ze^Gho4U==c_Y6f9K2}2jb!AU1kblq>R z^-tbEZ+Twdoi)66>7~}eo@X_%x}UE<=Q&UEACBWp-TTrOcY60;cV2T8byg@jgu& z=euG%4*C%pl+iO5pUqJ)*T&RmEb3X#beZ|)vlwA!+D02;Tog)8D)P)a>CwOdB-PJ_*bT6Cwpb5 z#9Oa7Yu-mT}Om(Bg0fZH-MM1BJhu&RvrI7$gDBxR|ShQ2{Q5aXiCpA=|rHY7bxB-ke~!xMsg4YZ@|dD;q~<7Tz7;viNY6 zYt~leT&~8XJ{8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d%0a+ zt6T4v?)q~pwGZC zbAjk z5*-ruHX5gITz?kQ%U!VZZQuyJD8!s>Z*yDKh298dO)}$GbzLWqK*{_>cD;H~HMp`E zkezxF0Y&%?3Q+tEz7PdnagWXS&_k$+i{3k!JhhpxE6Ys!nB~ra3;`~;of(Je6LILR z!G3s#wWn!B_vhj3>qt>tM*VD~o8}xjvXt&o7077;>f0Y=q1#xFw>3~JSSk#v!Mvn1FZ2eM zOmzMjiHnKviA(a-^S?VQci0kBOVA$2ciC{~XTp^g)fEn@MDkOIbzCXEaMuK2-m!u` zBb~grSx_NqPeFfYfo;Y1xydWd@aJ+>i9(LB+y|CZa8nT z+>2S%!i$k5Fl9#|AvjE4$JQNi;`W76ag??(-`xx;$gd7d27*TPp^`uB(aSb5NA+6L zQHoI|@}!T66vf-T5soT_jf2#`U(_0{^qT;ozsov=j0jRIgT*DIG<&7+!+45gP06wv zJ1f~-zF_2dC&BUMnN2rhK9)2z56Dy+@XA~dT5$I|r!Cr%pL@utgv3YM)j);UAz2&V z*lC4H6~}YDHTjXD4VeaaH+y{0{MA%*yPxcL9E@&^_2cHF>1LXIGok-)N+063zD=@9 z$kIe`;Q|E%Pq-ucFYe$KLUt(kgcf7F9}U5ww^(D=RMM`zC8kS;smLwiE2d*#{>x=R zB~8GIZtw*Jy~K?Xe%Q}8oGmi0g;Avl7d=)kv7(N0Wi8iaZ^FwNj8^0!4$1I!VOW_-xVP3H=-PQ6VN!2d?!8)8DK(Slcp@-r') - -" }}} - -" CHECK CODE {{{ -" -" Code checking -call pymode#default('g:pymode_lint', 1) - -" Check code asynchronously -call pymode#default('g:pymode_lint_async', 1) -call pymode#default('g:pymode_lint_async_updatetime', 1000) - -" Check code every save if file has been modified -call pymode#default("g:pymode_lint_on_write", 1) - -" Check code every save (every) -call pymode#default("g:pymode_lint_unmodified", 0) - -" Check code on fly -call pymode#default("g:pymode_lint_on_fly", 0) - -" Show message about error in command line -call pymode#default("g:pymode_lint_message", 1) - -" Choices are: pylint, pyflakes, pep8, mccabe and pep257 -call pymode#default("g:pymode_lint_checkers", ['pyflakes', 'pep8', 'mccabe']) - -" Skip errors and warnings (e.g. E4,W) -call pymode#default("g:pymode_lint_ignore", []) - -" Select errors and warnings (e.g. E4,W) -call pymode#default("g:pymode_lint_select", []) - -" Auto open cwindow if any errors has been finded -call pymode#default("g:pymode_lint_cwindow", 1) - -" If not emply, errors will be sort by defined relevance -" E.g. let g:pymode_lint_sort = ['E', 'C', 'I'] " Errors first 'E', -" after them 'C' and ... -call pymode#default("g:pymode_lint_sort", []) - -" Place error signs -call pymode#default("g:pymode_lint_signs", 1) - -" Symbol's definitions -call pymode#default("g:pymode_lint_todo_symbol", "WW") -call pymode#default("g:pymode_lint_docs_symbol", "DD") -call pymode#default("g:pymode_lint_comment_symbol", "CC") -call pymode#default("g:pymode_lint_visual_symbol", "RR") -call pymode#default("g:pymode_lint_error_symbol", "EE") -call pymode#default("g:pymode_lint_info_symbol", "II") -call pymode#default("g:pymode_lint_pyflakes_symbol", "FF") - -" Code checkers options -" TODO: check if most adequate name name is pep8 or pycodestyle. -call pymode#default("g:pymode_lint_options_pep8", - \ {'max_line_length': g:pymode_options_max_line_length}) - -call pymode#default("g:pymode_lint_options_pylint", - \ {'max-line-length': g:pymode_options_max_line_length}) - -call pymode#default("g:pymode_lint_options_mccabe", - \ {'complexity': 12}) - -call pymode#default("g:pymode_lint_options_pep257", {}) -call pymode#default("g:pymode_lint_options_pyflakes", { 'builtins': '_' }) - - -" }}} - -" SET/UNSET BREAKPOINTS {{{ -" - -" Create/remove breakpoints -call pymode#default('g:pymode_breakpoint', 1) - -" Key's map for add/remove breakpoint -call pymode#default('g:pymode_breakpoint_bind', 'b') - -" Default pattern for making breakpoints. Leave this empty for auto search available debuggers (pdb, ipdb, ...) -call pymode#default('g:pymode_breakpoint_cmd', '') - -" }}} - -" ROPE (refactoring, codeassist) {{{ -" -" Rope support -call pymode#default('g:pymode_rope', 0) -call pymode#default('g:pymode_rope_prefix', '') - -" System plugin variable -if g:pymode_rope - call pymode#default('g:pymode_rope_current', '') - - " Configurable rope project root - call pymode#default('g:pymode_rope_project_root', '') - - " Configurable rope project folder (always relative to project root) - call pymode#default('g:pymode_rope_ropefolder', '.ropeproject') - - " If project hasnt been finded in current working directory, look at parents directory - call pymode#default('g:pymode_rope_lookup_project', 0) - - " Enable Rope completion - call pymode#default('g:pymode_rope_completion', 1) - - " Complete keywords from not imported modules (could make completion slower) - " Enable autoimport used modules - call pymode#default('g:pymode_rope_autoimport', 0) - - " Offer to import object after complete (if that not be imported before) - call pymode#default('g:pymode_rope_autoimport_import_after_complete', 0) - - " Autoimported modules - call pymode#default('g:pymode_rope_autoimport_modules', ['os', 'shutil', 'datetime']) - - " Bind keys to autoimport module for object under cursor - call pymode#default('g:pymode_rope_autoimport_bind', g:pymode_rope_prefix . 'ra') - - " Automatic completion on dot - call pymode#default('g:pymode_rope_complete_on_dot', 1) - - " Bind keys for autocomplete (leave empty for disable) - call pymode#default('g:pymode_rope_completion_bind', '') - - " Bind keys for goto definition (leave empty for disable) - call pymode#default('g:pymode_rope_goto_definition_bind', g:pymode_rope_prefix . 'g') - - " set command for open definition (e, new, vnew) - call pymode#default('g:pymode_rope_goto_definition_cmd', 'new') - - " Bind keys for show documentation (leave empty for disable) - call pymode#default('g:pymode_rope_show_doc_bind', g:pymode_rope_prefix . 'd') - - " Bind keys for find occurencies (leave empty for disable) - call pymode#default('g:pymode_rope_find_it_bind', g:pymode_rope_prefix . 'f') - - " Bind keys for organize imports (leave empty for disable) - call pymode#default('g:pymode_rope_organize_imports_bind', g:pymode_rope_prefix . 'ro') - - " Bind keys for rename variable/method/class in the project (leave empty for disable) - call pymode#default('g:pymode_rope_rename_bind', g:pymode_rope_prefix . 'rr') - - " Bind keys for rename module - call pymode#default('g:pymode_rope_rename_module_bind', g:pymode_rope_prefix . 'r1r') - - " Bind keys for convert module to package - call pymode#default('g:pymode_rope_module_to_package_bind', g:pymode_rope_prefix . 'r1p') - - " Creates a new function or method (depending on the context) from the selected lines - call pymode#default('g:pymode_rope_extract_method_bind', g:pymode_rope_prefix . 'rm') - - " Creates a variable from the selected lines - call pymode#default('g:pymode_rope_extract_variable_bind', g:pymode_rope_prefix . 'rl') - - " Inline refactoring - call pymode#default('g:pymode_rope_inline_bind', g:pymode_rope_prefix . 'ri') - - " Move refactoring - call pymode#default('g:pymode_rope_move_bind', g:pymode_rope_prefix . 'rv') - - " Generate function - call pymode#default('g:pymode_rope_generate_function_bind', g:pymode_rope_prefix . 'rnf') - - " Generate class - call pymode#default('g:pymode_rope_generate_class_bind', g:pymode_rope_prefix . 'rnc') - - " Generate package - call pymode#default('g:pymode_rope_generate_package_bind', g:pymode_rope_prefix . 'rnp') - - " Change signature - call pymode#default('g:pymode_rope_change_signature_bind', g:pymode_rope_prefix . 'rs') - - " Tries to find the places in which a function can be used and changes the - " code to call it instead - call pymode#default('g:pymode_rope_use_function_bind', g:pymode_rope_prefix . 'ru') - - " Regenerate project cache on every save - call pymode#default('g:pymode_rope_regenerate_on_write', 1) -endif - -" }}} - -" }}} - -" Prepare to plugin loading -if &compatible - set nocompatible -endif -filetype plugin on - -" UltiSnips Fixes -if !len(g:pymode_python) - if (exists('g:_uspy') && g:_uspy == ':py3') || has("python3") - let g:pymode_python = 'python3' - else - let g:pymode_python = 'disable' - endif -endif - -if g:pymode_python == 'python3' - - command! -nargs=1 PymodePython python3 - let g:UltiSnipsUsePythonVersion = 3 - -else - - let g:pymode_doc = 0 - let g:pymode_lint = 0 - let g:pymode_path = 0 - let g:pymode_rope = 0 - let g:pymode_run = 0 - let g:pymode_virtualenv = 0 - - command! -nargs=1 PymodePython echo - -endif - -command! PymodeVersion echomsg "Pymode version: " . g:pymode_version . " interpreter: " . g:pymode_python . " lint: " . g:pymode_lint . " rope: " . g:pymode_rope - -augroup pymode diff --git a/pylama.ini b/pylama.ini deleted file mode 100644 index 9579796e..00000000 --- a/pylama.ini +++ /dev/null @@ -1,9 +0,0 @@ -[pylama] -ignore=D213 -linters=pep8,pyflakes,pylint - -[pylama:pymode/libs*] -skip=1 - -[pylama:pylint] -disable=E1120,E1130,E1103,W1401,F0001 diff --git a/pymode/__init__.py b/pymode/__init__.py deleted file mode 100644 index aba22870..00000000 --- a/pymode/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -"""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) diff --git a/pymode/async.py b/pymode/async.py deleted file mode 100644 index d211ac4a..00000000 --- a/pymode/async.py +++ /dev/null @@ -1,6 +0,0 @@ -""" Python-mode async support. """ - -from queue import Queue # noqa - - -RESULTS = Queue() diff --git a/pymode/autopep8.py b/pymode/autopep8.py deleted file mode 120000 index 0a26e017..00000000 --- a/pymode/autopep8.py +++ /dev/null @@ -1 +0,0 @@ -../submodules/autopep8/autopep8.py \ No newline at end of file diff --git a/pymode/environment.py b/pymode/environment.py deleted file mode 100644 index 86527f56..00000000 --- a/pymode/environment.py +++ /dev/null @@ -1,249 +0,0 @@ -"""Define interfaces.""" - -import json -import os.path -import time -import vim # noqa - - -class VimPymodeEnviroment(object): - - """Vim User interface.""" - - prefix = '[Pymode]' - - def __init__(self): - """Init VIM environment.""" - self.current = vim.current - self.options = dict(encoding=vim.eval('&enc')) - self.options['debug'] = self.var('g:pymode_debug', True) - - @property - def curdir(self): - """Return current working directory.""" - return self.var('getcwd()') - - @property - def curbuf(self): - """Return current buffer.""" - return self.current.buffer - - @property - def cursor(self): - """Return current window position. - - :return tuple: (row, col) - - """ - return self.current.window.cursor - - @property - def source(self): - """Return source of current buffer.""" - return "\n".join(self.lines) - - @property - def lines(self): - """Iterate by lines in current file. - - :return list: - - """ - return self.curbuf - - @staticmethod - def var(name, to_bool=False, silence=False, default=None): - """Get vim variable. - - :return vimobj: - - """ - try: - value = vim.eval(name) - except vim.error: - if silence: - return default - raise - - if to_bool: - try: - value = bool(int(value)) - except ValueError: - value = value - return value - - @staticmethod - def message(msg, history=False): - """Show message to user. - - :return: :None - - """ - if history: - return vim.command('echom "%s"' % str(msg)) - - return vim.command('call pymode#wide_message("%s")' % str(msg)) - - def user_input(self, msg='', default=''): - """Return user input or default. - - :return str: - - """ - prompt = [] - prompt.append(str(self.prefix.strip())) - prompt.append(str(msg).strip()) - - if default != '': - prompt.append('[%s]' % default) - - prompt.append('> ') - prompt = ' '.join([s for s in prompt if s]) - - vim.command('echohl Debug') - - try: - input_str = vim.eval('input(%r)' % (prompt,)) - except KeyboardInterrupt: - input_str = '' - - vim.command('echohl none') - - return input_str or default - - def user_confirm(self, msg, yes=False): - """Get user confirmation. - - :return bool: - - """ - default = 'yes' if yes else 'no' - action = self.user_input(msg, default) - return action and 'yes'.startswith(action) - - def user_input_choices(self, msg, *options): - """Get one of many options. - - :return str: A choosen option - - """ - choices = ['%s %s' % (self.prefix, msg)] - choices += [ - "%s. %s" % (num, opt) for num, opt in enumerate(options, 1)] - try: - input_str = int( - vim.eval('inputlist(%s)' % self.prepare_value(choices))) - except (KeyboardInterrupt, ValueError): - input_str = 0 - - if not input_str: - self.message('Cancelled!') - return False - - try: - return options[input_str - 1] - except (IndexError, ValueError): - self.error('Invalid option: %s' % input_str) - return self.user_input_choices(msg, *options) - - @staticmethod - def error(msg): - """Show error to user.""" - vim.command('call pymode#error("%s")' % str(msg)) - - def debug(self, msg, *args): - """Print debug information.""" - if self.options.get('debug'): - print("%s %s [%s]" % ( - int(time.time()), msg, ', '.join([str(a) for a in args]))) - - def stop(self, value=None): - """Break Vim function.""" - cmd = 'return' - if value is not None: - cmd += ' ' + self.prepare_value(value) - vim.command(cmd) - - def catch_exceptions(self, func): - """Decorator. Make execution more silence. - - :return func: - - """ - def _wrapper(*args, **kwargs): - try: - return func(*args, **kwargs) - except (Exception, vim.error) as e: # noqa - if self.options.get('debug'): - raise - self.error(e) - return None - return _wrapper - - def run(self, name, *args): - """Run vim function.""" - vim.command('call %s(%s)' % (name, ", ".join([ - self.prepare_value(a) for a in args - ]))) - - def let(self, name, value): - """Set variable.""" - cmd = 'let %s = %s' % (name, self.prepare_value(value)) - self.debug(cmd) - vim.command(cmd) - - def prepare_value(self, value, dumps=True): - """Decode bstr to vim encoding. - - :return unicode string: - - """ - if dumps: - value = json.dumps(value) - - return value - - def get_offset_params(self, cursor=None, base=""): - """Calculate current offset. - - :return tuple: (source, offset) - - """ - row, col = cursor or env.cursor - source = "" - offset = 0 - for i, line in enumerate(self.lines, 1): - if i == row: - source += line[:col] + base - offset = len(source) - source += line[col:] - else: - source += line - source += '\n' - env.debug('Get offset', base or None, row, col, offset) - return source, offset - - @staticmethod - def goto_line(line): - """Go to line.""" - vim.command('normal %sggzz' % line) - - def goto_file(self, path, cmd='e', force=False): - """Open file by path.""" - if force or os.path.abspath(path) != self.curbuf.name: - self.debug('read', path) - if ' ' in path and os.name == 'posix': - path = path.replace(' ', '\\ ') - vim.command("%s %s" % (cmd, path)) - - @staticmethod - def goto_buffer(bufnr): - """Open buffer.""" - if str(bufnr) != '-1': - vim.command('buffer %s' % bufnr) - - def select_line(self, start, end): - vim.command('normal %sggV%sgg' % (start, end)) - - -env = VimPymodeEnviroment() diff --git a/pymode/libs/__init__.py b/pymode/libs/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/pymode/libs/astroid b/pymode/libs/astroid deleted file mode 120000 index 492d8fbc..00000000 --- a/pymode/libs/astroid +++ /dev/null @@ -1 +0,0 @@ -../../submodules/astroid/astroid \ No newline at end of file diff --git a/pymode/libs/mccabe.py b/pymode/libs/mccabe.py deleted file mode 120000 index 02c3eab6..00000000 --- a/pymode/libs/mccabe.py +++ /dev/null @@ -1 +0,0 @@ -../../submodules/mccabe/mccabe.py \ No newline at end of file diff --git a/pymode/libs/pycodestyle.py b/pymode/libs/pycodestyle.py deleted file mode 120000 index ef2127d7..00000000 --- a/pymode/libs/pycodestyle.py +++ /dev/null @@ -1 +0,0 @@ -../../submodules/pycodestyle/pycodestyle.py \ No newline at end of file diff --git a/pymode/libs/pydocstyle b/pymode/libs/pydocstyle deleted file mode 120000 index 3a6e93e6..00000000 --- a/pymode/libs/pydocstyle +++ /dev/null @@ -1 +0,0 @@ -../../submodules/pydocstyle/src/pydocstyle/ \ No newline at end of file diff --git a/pymode/libs/pyflakes b/pymode/libs/pyflakes deleted file mode 120000 index e123a7ee..00000000 --- a/pymode/libs/pyflakes +++ /dev/null @@ -1 +0,0 @@ -../../submodules/pyflakes/pyflakes/ \ No newline at end of file diff --git a/pymode/libs/pylama b/pymode/libs/pylama deleted file mode 120000 index 0ebc41a2..00000000 --- a/pymode/libs/pylama +++ /dev/null @@ -1 +0,0 @@ -../../submodules/pylama/pylama/ \ No newline at end of file diff --git a/pymode/libs/pylint b/pymode/libs/pylint deleted file mode 120000 index 0d144c06..00000000 --- a/pymode/libs/pylint +++ /dev/null @@ -1 +0,0 @@ -../../submodules/pylint/pylint \ No newline at end of file diff --git a/pymode/libs/rope b/pymode/libs/rope deleted file mode 120000 index 71d401aa..00000000 --- a/pymode/libs/rope +++ /dev/null @@ -1 +0,0 @@ -../../submodules/rope/rope \ No newline at end of file diff --git a/pymode/libs/snowballstemmer b/pymode/libs/snowballstemmer deleted file mode 120000 index d305e7a3..00000000 --- a/pymode/libs/snowballstemmer +++ /dev/null @@ -1 +0,0 @@ -../../submodules/snowball_py/snowballstemmer \ No newline at end of file diff --git a/pymode/libs/toml b/pymode/libs/toml deleted file mode 120000 index dc960a0a..00000000 --- a/pymode/libs/toml +++ /dev/null @@ -1 +0,0 @@ -../../submodules/toml/toml \ No newline at end of file diff --git a/pymode/lint.py b/pymode/lint.py deleted file mode 100644 index ba187558..00000000 --- a/pymode/lint.py +++ /dev/null @@ -1,93 +0,0 @@ -"""Pylama integration.""" - -from .environment import env -from .utils import silence_stderr - -import os.path - - -from pylama.lint.extensions import LINTERS - -try: - from pylama.lint.pylama_pylint import Linter - LINTERS['pylint'] = Linter() -except Exception: # noqa - pass - - -def code_check(): - """Run pylama and check current file. - - :return bool: - - """ - with silence_stderr(): - - from pylama.core import run - from pylama.config import parse_options - - if not env.curbuf.name: - return env.stop() - - linters = env.var('g:pymode_lint_checkers') - env.debug(linters) - - # Fixed in v0.9.3: these two parameters may be passed as strings. - # DEPRECATE: v:0.10.0: need to be set as lists. - if isinstance(env.var('g:pymode_lint_ignore'), str): - raise ValueError ('g:pymode_lint_ignore should have a list type') - else: - ignore = env.var('g:pymode_lint_ignore') - if isinstance(env.var('g:pymode_lint_select'), str): - raise ValueError ('g:pymode_lint_select should have a list type') - else: - select = env.var('g:pymode_lint_select') - options = parse_options( - linters=linters, force=1, - ignore=ignore, - select=select, - ) - env.debug(options) - - for linter in linters: - opts = env.var('g:pymode_lint_options_%s' % linter, silence=True) - if opts: - options.linters_params[linter] = options.linters_params.get( - linter, {}) - options.linters_params[linter].update(opts) - - path = os.path.relpath(env.curbuf.name, env.curdir) - env.debug("Start code check: ", path) - - if getattr(options, 'skip', None) and any(p.match(path) for p in options.skip): # noqa - env.message('Skip code checking.') - env.debug("Skipped") - return env.stop() - - if env.options.get('debug'): - from pylama.core import LOGGER, logging - LOGGER.setLevel(logging.DEBUG) - - errors = run(path, code='\n'.join(env.curbuf) + '\n', options=options) - - env.debug("Find errors: ", len(errors)) - sort_rules = env.var('g:pymode_lint_sort') - - def __sort(e): - try: - return sort_rules.index(e.get('type')) - except ValueError: - return 999 - - if sort_rules: - env.debug("Find sorting: ", sort_rules) - errors = sorted(errors, key=__sort) - - for e in errors: - e._info['bufnr'] = env.curbuf.number - if e._info['col'] is None: - e._info['col'] = 1 - - env.run('g:PymodeLocList.current().extend', [e._info for e in errors]) - -# pylama:ignore=W0212,E1103 diff --git a/pymode/rope.py b/pymode/rope.py deleted file mode 100644 index c34817b2..00000000 --- a/pymode/rope.py +++ /dev/null @@ -1,953 +0,0 @@ -"""Integration with Rope library.""" - -import os.path -import re -import site -import sys - -from rope.base import project, libutils, exceptions, change, worder, pycore, codeanalyze -from rope.base.fscommands import FileSystemCommands # noqa -from rope.base.taskhandle import TaskHandle # noqa -from rope.contrib import autoimport as rope_autoimport, codeassist, findit, generate # noqa -from rope.refactor import ModuleToPackage, ImportOrganizer, rename, extract, inline, usefunction, move, change_signature, importutils # noqa - -from .environment import env - - -def look_ropeproject(path): - """Search for ropeproject in current and parent dirs. - - :return str|None: A finded path - - """ - env.debug('Look project', path) - p = os.path.abspath(path) - - while True: - if '.ropeproject' in os.listdir(p): - return p - - new_p = os.path.abspath(os.path.join(p, "..")) - if new_p == p: - return path - - p = new_p - - -@env.catch_exceptions -def completions(): - """ Search completions. - - :return None: - - """ - row, col = env.cursor - if env.var('a:findstart', True): - count = 0 - for char in reversed(env.current.line[:col]): - if not re.match(r'[\w\d]', char): - break - count += 1 - env.debug('Complete find start', (col - count)) - return env.stop(col - count) - - base = env.var('a:base') - source, offset = env.get_offset_params((row, col), base) - proposals = get_proporsals(source, offset, base) - return env.stop(proposals) - - -FROM_RE = re.compile(r'^\s*from\s+[\.\w\d_]+$') - - -@env.catch_exceptions -def complete(dot=False): - """ Ctrl+Space completion. - - :return bool: success - - """ - row, col = env.cursor - source, offset = env.get_offset_params() - - cline = env.current.line[:col] - env.debug('dot completion', cline) - if FROM_RE.match(cline) or cline.endswith('..') or cline.endswith('\.'): # noqa - return env.stop("") - - proposals = get_proporsals(source, offset, dot=dot) - if not proposals: - return False - - prefix = proposals[0]['word'] - - # Find common part - for p in proposals: - common = len([ - c1 for c1, c2 in zip(prefix, p['word']) if c1 == c2 and c1 != ' ' - ]) - prefix = prefix[:common] - s_offset = codeassist.starting_offset(source, offset) - p_prefix = prefix[offset - s_offset:] - line = env.lines[row - 1] - cline = line[:col] + p_prefix + line[col:] - if cline != line: - if 'noinsert' not in env.var('&completeopt'): - env.curbuf[row - 1] = env.prepare_value(cline, dumps=False) - env.current.window.cursor = (row, col + len(p_prefix)) - env.run('complete', col - len(prefix) + len(p_prefix) + 1, proposals) - return True - - -def get_proporsals(source, offset, base='', dot=False): - """ Code assist. - - :return str: - - """ - with RopeContext() as ctx: # noqa - - try: - proposals = codeassist.code_assist( - ctx.project, source, offset, ctx.resource, maxfixes=3, - later_locals=False) - - except exceptions.ModuleSyntaxError: - proposals = [] - - proposals = sorted(proposals, key=_sort_proporsals) - - out = [] - preview = 'preview' in ctx.options.get('completeopt') - for p in proposals: - out.append(dict( - word=p.name, - menu=p.type, - kind=p.scope + ':', - info=p.get_doc() or "No docs." if preview else "", - )) - - out = _get_autoimport_proposals(out, ctx, source, offset, dot=dot) - - return out - - -@env.catch_exceptions -def goto(): - """ Goto definition. """ - with RopeContext() as ctx: - source, offset = env.get_offset_params() - - found_resource, line = codeassist.get_definition_location( - ctx.project, source, offset, ctx.resource, maxfixes=3) - - if not found_resource: - env.error('Definition not found') - return - - env.goto_file( - found_resource.real_path, - cmd=ctx.options.get('goto_definition_cmd')) - env.goto_line(line) - - -@env.catch_exceptions -def show_doc(): - """ Show documentation. """ - with RopeContext() as ctx: - source, offset = env.get_offset_params() - try: - doc = codeassist.get_doc( - ctx.project, source, offset, ctx.resource, maxfixes=3) - if not doc: - raise exceptions.BadIdentifierError - env.let('l:output', doc.split('\n')) - except exceptions.BadIdentifierError: - env.error("No documentation found.") - - -def find_it(): - """ Find occurrences. """ - with RopeContext() as ctx: - _, offset = env.get_offset_params() - try: - occurrences = findit.find_occurrences( - ctx.project, ctx.resource, offset) - except exceptions.BadIdentifierError: - occurrences = [] - - lst = [] - for oc in occurrences: - lst.append(dict( - filename=oc.resource.path, - text=env.lines[oc.lineno - 1] if oc.resource.real_path == env.curbuf.name else "", # noqa - lnum=oc.lineno, - type='' - )) - env.run('g:PymodeLocList.current().extend', lst) - - -def update_python_path(paths): - """ Update sys.path and make sure the new items come first. """ - old_sys_path_items = list(sys.path) - - for path in paths: - # see if it is a site dir - if path.find('site-packages') != -1: - site.addsitedir(path) - - else: - sys.path.insert(0, path) - - # Reorder sys.path so new directories at the front. - new_sys_path_items = set(sys.path) - set(old_sys_path_items) - sys.path = list(new_sys_path_items) + old_sys_path_items - - -def organize_imports(): - """ Organize imports in current file. """ - with RopeContext() as ctx: - organizer = ImportOrganizer(ctx.project) - changes = organizer.organize_imports(ctx.resource) - if changes is not None: - progress = ProgressHandler('Organize imports') - ctx.project.do(changes, task_handle=progress.handle) - reload_changes(changes) - - -@env.catch_exceptions -def regenerate(): - """ Clear cache. """ - with RopeContext() as ctx: - ctx.project.pycore._invalidate_resource_cache(ctx.resource) # noqa - ctx.importer.generate_cache() - ctx.project.sync() - - -def new(): - """ Create a new project. """ - root = None - if env.var('a:0') != '0': - root = env.var('a:1') - else: - default = env.var('g:pymode_rope_project_root') - if not default: - default = env.var('getcwd()') - if sys.platform.startswith('win32'): - default = default.replace('\\', '/') - root = env.var('input("Enter project root: ", "%s")' % default) - ropefolder = env.var('g:pymode_rope_ropefolder') - prj = project.Project(projectroot=root, ropefolder=ropefolder) - prj.close() - env.message("Project is opened: %s" % root) - - -def undo(): - """ Undo last changes. - - :return bool: - - """ - with RopeContext() as ctx: - changes = ctx.project.history.tobe_undone - if changes is None: - env.error('Nothing to undo!') - return False - - if env.user_confirm('Undo [%s]?' % str(changes)): - progress = ProgressHandler('Undo %s' % str(changes)) - for c in ctx.project.history.undo(task_handle=progress.handle): - reload_changes(c) - - -def redo(): - """ Redo last changes. - - :return bool: - - """ - with RopeContext() as ctx: - changes = ctx.project.history.tobe_redone - if changes is None: - env.error('Nothing to redo!') - return False - - if env.user_confirm('Redo [%s]?' % str(changes)): - progress = ProgressHandler('Redo %s' % str(changes)) - for c in ctx.project.history.redo(task_handle=progress.handle): - reload_changes(c) - - -def cache_project(cls): - """ Cache projects. - - :return func: - - """ - projects = dict() - resources = dict() - - def get_ctx(*args, **kwargs): - path = env.curbuf.name - if resources.get(path): - return resources.get(path) - - project_path = env.var('g:pymode_rope_project_root') - if not project_path: - project_path = env.curdir - env.debug('Look ctx', project_path) - if env.var('g:pymode_rope_lookup_project', True): - project_path = look_ropeproject(project_path) - - if not os.path.exists(project_path): - env.error("Rope project root not exist: %s" % project_path) - ctx = None - - else: - ctx = projects.get(project_path) - - if not ctx: - projects[project_path] = ctx = cls(path, project_path) - - resources[path] = ctx - return ctx - return get_ctx - - -def autoimport(): - """ Autoimport modules. - - :return bool: - - """ - word = env.var('a:word') - if not word: - env.error("Should be word under cursor.") - return False - - with RopeContext() as ctx: - if not ctx.importer.names: - ctx.generate_autoimport_cache() - modules = ctx.importer.get_modules(word) - if not modules: - env.message('Global name %s not found.' % word) - return False - - if len(modules) == 1: - _insert_import(word, modules[0], ctx) - - else: - module = env.user_input_choices( - 'Which module to import:', *modules) - _insert_import(word, module, ctx) - - return True - - -@cache_project -class RopeContext(object): - - """ A context manager to have a rope project context. """ - - projects = {} - resource = {} - - def __init__(self, path=None, project_path=None): - """ Init Rope context. """ - self.path = path - - self.project = project.Project(project_path, fscommands=FileSystemCommands()) - - self.importer = rope_autoimport.AutoImport( - project=self.project, observe=False) - - update_python_path(self.project.prefs.get('python_path', [])) - - self.resource = None - self.current = None - self.options = dict( - completeopt=env.var('&completeopt'), - autoimport=env.var('g:pymode_rope_autoimport', True), - autoimport_modules=env.var('g:pymode_rope_autoimport_modules'), - goto_definition_cmd=env.var('g:pymode_rope_goto_definition_cmd'), - ) - - if os.path.exists("%s/__init__.py" % project_path): - sys.path.append(project_path) - - if self.options.get('autoimport'): - self.generate_autoimport_cache() - - env.debug('Context init', project_path) - env.message('Init Rope project: %s' % project_path) - - def __enter__(self): - """ Enter to Rope ctx. """ - env.let('g:pymode_rope_current', self.project.root.real_path) - self.project.validate(self.project.root) - self.resource = libutils.path_to_resource( - self.project, env.curbuf.name, 'file') - - if not self.resource.exists() or os.path.isdir( - self.resource.real_path): - self.resource = None - else: - env.debug('Found resource', self.resource.path) - - return self - - def __exit__(self, t, value, traceback): - """ Exit from Rope ctx. """ - if t is None: - self.project.close() - - def generate_autoimport_cache(self): - """ Update autoimport cache. """ - env.message('Regenerate autoimport cache.') - modules = self.options.get('autoimport_modules', []) - - def _update_cache(importer, modules=None): - importer.generate_cache() - if modules: - importer.generate_modules_cache(modules) - importer.project.sync() - - _update_cache(self.importer, modules) - - -class ProgressHandler(object): - - """ Handle task progress. """ - - def __init__(self, msg): - """ Init progress handler. """ - self.handle = TaskHandle(name="refactoring_handle") - self.handle.add_observer(self) - self.message = msg - - def __call__(self): - """ Show current progress. """ - percent_done = self.handle.current_jobset().get_percent_done() - env.message('%s - done %s%%' % (self.message, percent_done)) - - -_scope_weight = { - 'local': 10, 'attribute': 20, 'global': 30, 'imported': 40, 'builtin': 50} - - -def _sort_proporsals(p): - return ( - _scope_weight.get(p.scope, 100), int(p.name.startswith('_')), p.name) - - -class Refactoring(object): # noqa - - """ Base class for refactor operations. """ - - def run(self): - """ Run refactoring. - - :return bool: - - """ - with RopeContext() as ctx: - - if not ctx.resource: - env.error("You should save the file before refactoring.") - return None - - try: - env.message(self.__doc__) - refactor = self.get_refactor(ctx) - input_str = self.get_input_str(refactor, ctx) - if not input_str: - return False - - action = env.user_input_choices( - 'Choose what to do:', 'perform', 'preview', - 'perform in class hierarchy', - 'preview in class hierarchy') - - in_hierarchy = action.endswith("in class hierarchy") - - changes = self.get_changes(refactor, input_str, in_hierarchy) - - if not action: - return False - - if action.startswith('preview'): - print("\n ") - print("-------------------------------") - print("\n%s\n" % changes.get_description()) - print("-------------------------------\n\n") - if not env.user_confirm('Do the changes?'): - return False - - progress = ProgressHandler('Apply changes ...') - ctx.project.do(changes, task_handle=progress.handle) - reload_changes(changes) - except exceptions.RefactoringError as e: - env.error(str(e)) - - except Exception as e: # noqa - env.error('Unhandled exception in Pymode: %s' % e) - - @staticmethod - def get_refactor(ctx): - """ Get refactor object. """ - raise NotImplementedError - - @staticmethod - def get_input_str(refactor, ctx): - """ Get user input. Skip by default. - - :return bool: True - - """ - return True - - @staticmethod - def get_changes(refactor, input_str, in_hierarchy=False): - return refactor.get_changes(input_str) - - -class RenameRefactoring(Refactoring): - - """ Rename var/function/method/class. """ - - def __init__(self, module=False): - self.module = module - super(RenameRefactoring, self).__init__() - - def get_refactor(self, ctx): - """ Function description. - - :return Rename: - - """ - offset = None - if not self.module: - _, offset = env.get_offset_params() - env.debug('Prepare rename', offset) - return rename.Rename(ctx.project, ctx.resource, offset) - - def get_input_str(self, refactor, ctx): - """ Return user input. """ - - oldname = str(refactor.get_old_name()) - msg = 'Renaming method/variable. New name:' - if self.module: - msg = 'Renaming module. New name:' - newname = env.user_input(msg, oldname) - - if newname == oldname: - env.message("Nothing to do.") - return False - - return newname - - @staticmethod - def get_changes(refactor, input_str, in_hierarchy=False): - """ Get changes. - - :return Changes: - - """ - return refactor.get_changes(input_str, in_hierarchy=in_hierarchy) - - -class ExtractMethodRefactoring(Refactoring): - - """ Extract method. """ - - @staticmethod - def get_input_str(refactor, ctx): - """ Return user input. """ - - return env.user_input('New method name:') - - @staticmethod - def get_refactor(ctx): - """ Function description. - - :return Rename: - - """ - cursor1, cursor2 = env.curbuf.mark('<'), env.curbuf.mark('>') - _, offset1 = env.get_offset_params(cursor1) - _, offset2 = env.get_offset_params(cursor2) - return extract.ExtractMethod( - ctx.project, ctx.resource, offset1, offset2 + 1) - - -class ExtractVariableRefactoring(Refactoring): - - """ Extract variable. """ - - @staticmethod - def get_input_str(refactor, ctx): - """ Return user input. """ - - return env.user_input('New variable name:') - - @staticmethod - def get_refactor(ctx): - """ Function description. - - :return Rename: - - """ - cursor1, cursor2 = env.curbuf.mark('<'), env.curbuf.mark('>') - _, offset1 = env.get_offset_params(cursor1) - _, offset2 = env.get_offset_params(cursor2) - return extract.ExtractVariable( - ctx.project, ctx.resource, offset1, offset2 + 1) - - -class InlineRefactoring(Refactoring): - - """ Inline variable/method. """ - - @staticmethod - def get_refactor(ctx): - """ Function description. - - :return Rename: - - """ - _, offset = env.get_offset_params() - return inline.create_inline(ctx.project, ctx.resource, offset) - - @staticmethod - def get_changes(refactor, input_str, in_hierarchy=False): - """ Get changes. - - :return Changes: - - """ - return refactor.get_changes() - - -class UseFunctionRefactoring(Refactoring): - - """ Use selected function as possible. """ - - @staticmethod - def get_refactor(ctx): - """ Function description. - - :return Rename: - - """ - _, offset = env.get_offset_params() - return usefunction.UseFunction(ctx.project, ctx.resource, offset) - - @staticmethod - def get_changes(refactor, input_str, in_hierarchy=False): - """ Get changes. - - :return Changes: - - """ - return refactor.get_changes() - - -class ModuleToPackageRefactoring(Refactoring): - - """ Convert module to package. """ - - @staticmethod - def get_refactor(ctx): - """ Function description. - - :return Rename: - - """ - return ModuleToPackage(ctx.project, ctx.resource) - - @staticmethod - def get_changes(refactor, input_str, in_hierarchy=False): - """ Get changes. - - :return Changes: - - """ - return refactor.get_changes() - - -class MoveRefactoring(Refactoring): - - """ Move method/module to other class/global. """ - - @staticmethod - def get_input_str(refactor, ctx): - """ Get destination. - - :return str: - - """ - - return env.user_input('Enter destination:') - - @staticmethod - def get_refactor(ctx): - """ Function description. - - :return Rename: - - """ - _, offset = env.get_offset_params() - if offset == 0: - offset = None - return move.create_move(ctx.project, ctx.resource, offset) - - -class ChangeSignatureRefactoring(Refactoring): - - """ Change function signature (add/remove/sort arguments). """ - - @staticmethod - def get_input_str(refactor, ctx): - """ Get destination. - - :return str: - - """ - args = refactor.get_args() - default = ', '.join(a[0] for a in args) - return env.user_input('Change the signature:', default) - - @staticmethod - def get_refactor(ctx): - """ Function description. - - :return Rename: - - """ - _, offset = env.get_offset_params() - return change_signature.ChangeSignature( - ctx.project, ctx.resource, offset) - - def get_changes(self, refactor, input_string, in_hierarchy=False): - """ Function description. - - :return Rope.changes: - - """ - args = re.sub(r'[\s\(\)]+', '', input_string).split(',') - olds = [arg[0] for arg in refactor.get_args()] - - changers = [] - for arg in [a for a in olds if a not in args]: - changers.append(change_signature.ArgumentRemover(olds.index(arg))) - olds.remove(arg) - - order = [] - for index, arg in enumerate(args): - if arg not in olds: - changers.append(change_signature.ArgumentAdder(index, arg)) - olds.insert(index, arg) - order.append(olds.index(arg)) - - changers.append(change_signature.ArgumentReorderer( - order, autodef='None')) - - return refactor.get_changes(changers, in_hierarchy=in_hierarchy) - - -class GenerateElementRefactoring(Refactoring): - - """ Class description. """ - - def __init__(self, kind, *args, **kwargs): - """ Function description. """ - self.kind = kind - super(GenerateElementRefactoring, self).__init__(*args, **kwargs) - - def get_refactor(self, ctx): - """ Function description. - - :return Rename: - - """ - _, offset = env.get_offset_params() - return generate.create_generate( - self.kind, ctx.project, ctx.resource, offset) - - def get_changes(self, refactor, input_str, in_hierarchy=False): - """ Function description. - - :return Rope.changes: - - """ - - return refactor.get_changes() - - -@env.catch_exceptions -def reload_changes(changes): - """ Reload changed buffers. """ - - resources = changes.get_changed_resources() - moved = _get_moved_resources(changes) # noqa - current = env.curbuf.number - - for f in resources: - bufnr = env.var('bufnr("%s")' % f.real_path) - env.goto_buffer(bufnr) - - path = env.curbuf.name - if f in moved: - path = moved[f].real_path - - env.debug('Reload', f.real_path, path, bufnr) - env.goto_file(path, 'e!', force=True) - env.message("%s has been changed." % f.real_path, history=True) - - env.goto_buffer(current) - - -def _get_moved_resources(changes): - - moved = dict() - - if isinstance(changes, change.ChangeSet): - for c in changes.changes: - moved.update(_get_moved_resources(c)) - - if isinstance(changes, change.MoveResource): - moved[changes.resource] = changes.new_resource - - return moved - - -def _get_autoimport_proposals(out, ctx, source, offset, dot=False): - - if not ctx.options.get('autoimport') or dot: - return out - - if '.' in codeassist.starting_expression(source, offset): - return out - - current_offset = offset - 1 - while current_offset > 0 and ( - source[current_offset].isalnum() or source[current_offset] == '_'): - current_offset -= 1 - starting = source[current_offset:offset] - starting = starting.strip() - - if not starting: - return out - - for assist in ctx.importer.import_assist(starting): - out.append(dict( - abbr=' : '.join(assist), - word=assist[0], - kind='autoimport:', - )) - - return out - - -@env.catch_exceptions -def complete_check(): - """ Function description. - - :return bool: - - """ - - row, column = env.cursor - line = env.lines[row - 1] - word_finder = worder.Worder(line, True) - parent, name, _ = word_finder.get_splitted_primary_before(column - 1) - if parent: - return False - - with RopeContext() as ctx: - modules = ctx.importer.get_modules(name) - - if not modules: - return False - - if name in ctx.project.pycore.resource_to_pyobject(ctx.resource): - return False - - if not env.user_confirm("Import %s?" % name, True): - return False - - if len(modules) == 1: - _insert_import(name, modules[0], ctx) - - else: - module = env.user_input_choices('With module to import:', *modules) - if module: - _insert_import(name, module, ctx) - - -def _insert_import(name, module, ctx): - if not ctx.resource: - source, _ = env.get_offset_params() - lineno = ctx.importer.find_insertion_line(source) - line = 'from %s import %s' % (module, name) - env.curbuf[lineno - 1:lineno - 1] = [ - env.prepare_value(line, dumps=False)] - return True - - pyobject = ctx.project.pycore.resource_to_pyobject(ctx.resource) - import_tools = importutils.ImportTools(ctx.project) - module_imports = import_tools.module_imports(pyobject) - new_import = importutils.FromImport(module, 0, [[name, None]]) - module_imports.add_import(new_import) - changes = change.ChangeContents( - ctx.resource, module_imports.get_changed_source()) - - action = env.user_input_choices( - 'Choose what to do:', 'perform', 'preview') - - if not action: - return False - - if action == 'preview': - print("\n ") - print("-------------------------------") - print("\n%s\n" % changes.get_description()) - print("-------------------------------\n\n") - if not env.user_confirm('Do the changes?'): - return False - - progress = ProgressHandler('Apply changes ...') - ctx.project.do(changes, task_handle=progress.handle) - reload_changes(changes) - - -@env.catch_exceptions -def select_logical_line(): - source, offset = env.get_offset_params() - count = int(env.var('v:count1')) - - lines = codeanalyze.SourceLinesAdapter(source) - start_line = lines.get_line_number(offset) - line_finder = codeanalyze.LogicalLineFinder(lines) - - start_lineno, end_lineno = line_finder.logical_line_in(start_line) - for _, (_, end_lineno) in zip(range(count), line_finder.generate_regions(start_lineno)): - pass - - env.select_line(start_lineno, end_lineno) - - -# Monkey patch Rope -def find_source_folders(self, folder): - """Look only python files an packages.""" - for resource in folder.get_folders(): - if self._is_package(resource): # noqa - return [folder] - - for resource in folder.get_files(): - if resource.name.endswith('.py'): - return [folder] - - return [] - -pycore.PyCore._find_source_folders = find_source_folders # noqa diff --git a/pymode/run.py b/pymode/run.py deleted file mode 100644 index bb83fa2c..00000000 --- a/pymode/run.py +++ /dev/null @@ -1,80 +0,0 @@ -""" Code runnning support. """ -import sys -from io import StringIO -from re import compile as re - -from .environment import env - - -encoding = re(r'#.*coding[:=]\s*([-\w.]+)') - - -def run_code(): - """ Run python code in current buffer. - - :returns: None - - """ - errors, err = [], '' - line1, line2 = env.var('a:line1'), env.var('a:line2') - lines = __prepare_lines(line1, line2) - if encoding.match(lines[0]): - lines.pop(0) - if encoding.match(lines[0]): - lines.pop(0) - elif encoding.match(lines[1]): - lines.pop(1) - - context = dict( - __name__='__main__', - __file__=env.var('expand("%:p")'), - input=env.user_input, - raw_input=env.user_input) - - sys.stdout, stdout_ = StringIO(), sys.stdout - sys.stderr, stderr_ = StringIO(), sys.stderr - - try: - code = compile('\n'.join(lines) + '\n', env.curbuf.name, 'exec') - sys.path.insert(0, env.curdir) - exec(code, context) # noqa - sys.path.pop(0) - - except SystemExit as e: - if e.code: - # A non-false code indicates abnormal termination. - # A false code will be treated as a - # successful run, and the error will be hidden from Vim - env.error("Script exited with code %s" % e.code) - return env.stop() - - except Exception: - import traceback - err = traceback.format_exc() - - else: - err = sys.stderr.getvalue() - - output = sys.stdout.getvalue() - output = env.prepare_value(output, dumps=False) - sys.stdout, sys.stderr = stdout_, stderr_ - - errors += [er for er in err.splitlines() if er and "" not in er] - - env.let('l:traceback', errors[2:]) - env.let('l:output', [s for s in output.splitlines()]) - - -def __prepare_lines(line1, line2): - - lines = [l.rstrip() for l in env.lines[int(line1) - 1:int(line2)]] - - indent = 0 - for line in lines: - if line: - indent = len(line) - len(line.lstrip()) - break - - if len(lines) == 1: - lines.append('') - return [l[indent:] for l in lines] diff --git a/pymode/utils.py b/pymode/utils.py deleted file mode 100644 index b934828e..00000000 --- a/pymode/utils.py +++ /dev/null @@ -1,48 +0,0 @@ -"""Pymode utils.""" -import os.path -import sys -import threading -import warnings -from contextlib import contextmanager -from io import StringIO - -import vim # noqa - - -DEBUG = int(vim.eval('g:pymode_debug')) - -warnings.filterwarnings('ignore') - - -@contextmanager -def silence_stderr(): - """Redirect stderr.""" - if DEBUG: - yield - - else: - with threading.Lock(): - stderr = sys.stderr - sys.stderr = StringIO() - - yield - - with threading.Lock(): - sys.stderr = stderr - - -def patch_paths(): - """Patch python sys.path. - - Load required modules from the plugin's sources. - """ - dir_script = os.path.dirname(os.path.abspath(__file__)) - sys.path.insert(0, os.path.join(dir_script, 'libs')) - if sys.platform == 'win32' or sys.platform == 'msys': - dir_submodule = os.path.abspath(os.path.join(dir_script, - '..', 'submodules')) - sub_modules = os.listdir(dir_submodule) - for module in sub_modules: - module_full_path = os.path.join(dir_submodule, module) - if module_full_path not in sys.path: - sys.path.insert(0, module_full_path) diff --git a/pymode/virtualenv.py b/pymode/virtualenv.py deleted file mode 100644 index 2d03163c..00000000 --- a/pymode/virtualenv.py +++ /dev/null @@ -1,57 +0,0 @@ -"""Support virtualenv in pymode.""" - -import os -import sys -import site - -from .environment import env - - -@env.catch_exceptions -def enable_virtualenv(): - """Enable virtualenv for vim. - - :return bool: - - """ - path = env.var('g:pymode_virtualenv_path') - # Normalize path to be an absolute path - # If an absolute path is provided, that path will be returned, otherwise - # the returned path will be an absolute path but computed relative - # to the current working directory - path = os.path.abspath(path) - enabled = env.var('g:pymode_virtualenv_enabled') - if path == enabled: - env.message('Virtualenv %s already enabled.' % path) - return env.stop() - - activate_env_from_path(path) - env.message('Activate virtualenv: ' + path) - env.let('g:pymode_virtualenv_enabled', path) - return True - - -def activate_env_from_path(env_path): - """Activate given virtualenv.""" - prev_sys_path = list(sys.path) - - if sys.platform == 'win32': - site_packages_paths = [os.path.join(env_path, 'Lib', 'site-packages')] - else: - lib_path = os.path.join(env_path, 'lib') - site_packages_paths = [os.path.join(lib_path, lib, 'site-packages') - for lib in os.listdir(lib_path)] - for site_packages_path in site_packages_paths: - site.addsitedir(site_packages_path) - - sys.real_prefix = sys.prefix - sys.prefix = env_path - sys.exec_prefix = env_path - - # Move the added items to the front of the path: - new_sys_path = [] - for item in list(sys.path): - if item not in prev_sys_path: - new_sys_path.append(item) - sys.path.remove(item) - sys.path[:0] = new_sys_path diff --git a/submodules/astroid b/submodules/astroid deleted file mode 160000 index 36dda3fc..00000000 --- a/submodules/astroid +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 36dda3fc8a5826b19a33a0ff29402b61d6a64fc2 diff --git a/submodules/autopep8 b/submodules/autopep8 deleted file mode 160000 index 32c78a3a..00000000 --- a/submodules/autopep8 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 32c78a3a07d7ee35500e6f20bfcd621f3132c42e diff --git a/submodules/mccabe b/submodules/mccabe deleted file mode 160000 index 2d4dd943..00000000 --- a/submodules/mccabe +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2d4dd9435fcb05aaa89ba0392a84cb1d30a87dc9 diff --git a/submodules/pycodestyle b/submodules/pycodestyle deleted file mode 160000 index 930e2cad..00000000 --- a/submodules/pycodestyle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 930e2cad15df3661306740c30a892a6f1902ef1d diff --git a/submodules/pydocstyle b/submodules/pydocstyle deleted file mode 160000 index 5f59f6eb..00000000 --- a/submodules/pydocstyle +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5f59f6eba0d8f0168c6ab45ee97485569b861b77 diff --git a/submodules/pyflakes b/submodules/pyflakes deleted file mode 160000 index 95fe313b..00000000 --- a/submodules/pyflakes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 95fe313ba5ca384041472cd171ea60fad910c207 diff --git a/submodules/pylama b/submodules/pylama deleted file mode 160000 index f436ccc6..00000000 --- a/submodules/pylama +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f436ccc6b55b33381a295ded753e467953cf4379 diff --git a/submodules/pylint b/submodules/pylint deleted file mode 160000 index 3eb0362d..00000000 --- a/submodules/pylint +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3eb0362dc42642e3e2774d7523a1e73d71394064 diff --git a/submodules/rope b/submodules/rope deleted file mode 160000 index c0433a82..00000000 --- a/submodules/rope +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c0433a82503ab4f8103f53d82655a004c6f9a93b diff --git a/submodules/snowball_py b/submodules/snowball_py deleted file mode 160000 index 404cab3e..00000000 --- a/submodules/snowball_py +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 404cab3e069cd5c2c891c19404fbd85bd285c021 diff --git a/submodules/toml b/submodules/toml deleted file mode 160000 index 3f637dba..00000000 --- a/submodules/toml +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f637dba5f68db63d4b30967fedda51c82459471 diff --git a/syntax/pyrex.vim b/syntax/pyrex.vim deleted file mode 100644 index acbe2379..00000000 --- a/syntax/pyrex.vim +++ /dev/null @@ -1,71 +0,0 @@ -" Vim syntax file -" Language: Pyrex -" Maintainer: John Tyree -" Last Change: 2012 Nov 06 - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" Read the Python syntax to start with -if version < 600 - so :p:h/python.vim -else - runtime! syntax/python.vim - unlet b:current_syntax -endif - -" Pyrex extentions -syn keyword pyrexStatement nogil inline typedef ctypedef sizeof -syn keyword pyrexType Py_ssize_t int long short float double char object void -" Here we want slightly different behavior depending on whether we're declaring -" variables or functions. c[p]def should work on the top level as a keyword, but -" should ALSO work to identify functions and classes. -syn match pyrexStatement "\" -syn match pyrexStatement "\[^=]*(\@=" contains=pythonStatement,pyrexStatement,pythonFunction,pyrexType skipwhite -syn keyword pyrexType signed unsigned -syn keyword pyrexStructure struct union enum -syn keyword pyrexInclude include cimport -syn keyword pyrexAccess public private property readonly extern -" If someome wants Python's built-ins highlighted probably he -" also wants Pyrex's built-ins highlighted -if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins") - syn keyword pyrexBuiltin NULL -endif - -" This deletes "from" from the keywords and re-adds it as a -" match with lower priority than pyrexForFrom -syn clear pythonInclude -syn keyword pythonInclude import -syn match pythonInclude "\" - -" With "for[^:]*\zsfrom" VIM does not match "for" anymore, so -" I used the slower "\@<=" form -syn match pyrexForFrom "\(\[^:]*\)\@<=\" - -" Default highlighting -if version >= 508 || !exists("did_pyrex_syntax_inits") - if version < 508 - let did_pyrex_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink pyrexStatement Statement - HiLink pyrexType Type - HiLink pyrexStructure Structure - HiLink pyrexInclude PreCondit - HiLink pyrexAccess pyrexStatement - if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins") - HiLink pyrexBuiltin Function - endif - HiLink pyrexForFrom Statement - - delcommand HiLink -endif - -let b:current_syntax = "pyrex" diff --git a/syntax/python.vim b/syntax/python.vim deleted file mode 100644 index 5a76d2b0..00000000 --- a/syntax/python.vim +++ /dev/null @@ -1,412 +0,0 @@ -" vim: ft=vim:fdm=marker - -" Enable pymode syntax for python files -call pymode#default('g:pymode', 1) -call pymode#default('g:pymode_syntax', g:pymode) - -" DESC: Disable script loading -if !g:pymode || !g:pymode_syntax || pymode#default('b:current_syntax', 'pymode') - finish -endif - -" OPTIONS: {{{ - -" Highlight all by default -call pymode#default('g:pymode_syntax_all', 1) - -" Highlight 'print' as function -call pymode#default("g:pymode_syntax_print_as_function", 0) -" -" Highlight 'async/await' keywords -call pymode#default("g:pymode_syntax_highlight_async_await", g:pymode_syntax_all) - -" Highlight '=' operator -call pymode#default('g:pymode_syntax_highlight_equal_operator', g:pymode_syntax_all) - -" Highlight ':=' operator -call pymode#default('g:pymode_syntax_highlight_walrus_operator', g:pymode_syntax_all) - -" Highlight '*' operator -call pymode#default('g:pymode_syntax_highlight_stars_operator', g:pymode_syntax_all) - -" Highlight 'self' keyword -call pymode#default('g:pymode_syntax_highlight_self', g:pymode_syntax_all) - -" Highlight indent's errors -call pymode#default('g:pymode_syntax_indent_errors', g:pymode_syntax_all) - -" Highlight space's errors -call pymode#default('g:pymode_syntax_space_errors', g:pymode_syntax_all) - -" Highlight string formatting -call pymode#default('g:pymode_syntax_string_formatting', g:pymode_syntax_all) -call pymode#default('g:pymode_syntax_string_format', g:pymode_syntax_all) -call pymode#default('g:pymode_syntax_string_templates', g:pymode_syntax_all) -call pymode#default('g:pymode_syntax_doctests', g:pymode_syntax_all) - -" Support docstrings in syntax highlighting -call pymode#default('g:pymode_syntax_docstrings', 1) - -" Highlight builtin objects (True, False, ...) -call pymode#default('g:pymode_syntax_builtin_objs', g:pymode_syntax_all) - -" Highlight builtin types (str, list, ...) -call pymode#default('g:pymode_syntax_builtin_types', g:pymode_syntax_all) - -" Highlight builtin types (div, eval, ...) -call pymode#default('g:pymode_syntax_builtin_funcs', g:pymode_syntax_all) - -" Highlight exceptions (TypeError, ValueError, ...) -call pymode#default('g:pymode_syntax_highlight_exceptions', g:pymode_syntax_all) - -" More slow synchronizing. Disable on the slow machine, but code in docstrings -" could be broken. -call pymode#default('g:pymode_syntax_slow_sync', 1) - -" }}} - -" For version 5.x: Clear all syntax items -if version < 600 - syntax clear -endif - -" Keywords {{{ -" ============ - - syn keyword pythonStatement break continue del - syn keyword pythonStatement exec return - syn keyword pythonStatement pass raise - syn keyword pythonStatement global nonlocal assert - syn keyword pythonStatement yield - syn keyword pythonLambdaExpr lambda - syn keyword pythonStatement with as - - syn keyword pythonStatement def nextgroup=pythonFunction skipwhite - syn match pythonFunction "\%(\%(def\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*" contained nextgroup=pythonVars - syn region pythonVars start="(" skip=+\(".*"\|'.*'\)+ end=")" contained contains=pythonParameters transparent keepend - syn match pythonParameters "[^,]*" contained contains=pythonParam skipwhite - syn match pythonParam "[^,]*" contained contains=pythonExtraOperator,pythonLambdaExpr,pythonBuiltinObj,pythonBuiltinType,pythonConstant,pythonString,pythonNumber,pythonBrackets,pythonSelf,pythonComment skipwhite - syn match pythonBrackets "{[(|)]}" contained skipwhite - - syn keyword pythonStatement class nextgroup=pythonClass skipwhite - syn match pythonClass "\%(\%(class\s\)\s*\)\@<=\h\%(\w\|\.\)*" contained nextgroup=pythonClassVars - syn region pythonClassVars start="(" end=")" contained contains=pythonClassParameters transparent keepend - syn match pythonClassParameters "[^,\*]*" contained contains=pythonBuiltin,pythonBuiltinObj,pythonBuiltinType,pythonExtraOperatorpythonStatement,pythonBrackets,pythonString,pythonComment skipwhite - - syn keyword pythonRepeat for while - syn keyword pythonConditional if elif else match case - syn keyword pythonInclude import from - syn keyword pythonException try except finally - syn keyword pythonOperator and in is not or - - syn match pythonExtraOperator "\%([~!^&|/%+-]\|\%(class\s*\)\@\|<=\|\%(<\|\>\|>=\|=\@\|\.\.\.\|\.\.\|::\)" - syn match pythonExtraPseudoOperator "\%(-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\)" - - if !g:pymode_syntax_print_as_function - syn keyword pythonStatement print - endif - - if g:pymode_syntax_highlight_async_await - syn keyword pythonStatement async await - syn match pythonStatement "\" nextgroup=pythonFunction skipwhite - syn match pythonStatement "\" display - syn match pythonStatement "\" nextgroup=pythonRepeat skipwhite - endif - - if g:pymode_syntax_highlight_equal_operator - syn match pythonExtraOperator "\%(=\)" - endif - - if g:pymode_syntax_highlight_walrus_operator - syn match pythonExtraOperator "\%(:=\)" - endif - - if g:pymode_syntax_highlight_stars_operator - syn match pythonExtraOperator "\%(\*\|\*\*\)" - endif - - if g:pymode_syntax_highlight_self - syn keyword pythonSelf self cls - endif - -" }}} - -" Decorators {{{ -" ============== - - syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite - syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained - -" }}} - -" Comments {{{ -" ============ - - syn match pythonComment "#.*$" display contains=pythonTodo,@Spell - syn match pythonRun "\%^#!.*$" - syn match pythonCoding "\%^.*\(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$" - syn keyword pythonTodo TODO FIXME XXX contained - -" }}} - -" Errors {{{ -" ========== - - syn match pythonError "\<\d\+\D\+\>" display - syn match pythonError "[$?]" display - syn match pythonError "[&|]\{2,}" display - syn match pythonError "[=]\{3,}" display - - " Indent errors (mix space and tabs) - if g:pymode_syntax_indent_errors - syn match pythonIndentError "^\s*\( \t\|\t \)\s*\S"me=e-1 display - endif - - " Trailing space errors - if g:pymode_syntax_space_errors - syn match pythonSpaceError "\s\+$" display - endif - -" }}} - -" Strings {{{ -" =========== - - syn region pythonString start=+[bB]\='+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell - syn region pythonString start=+[bB]\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell - syn region pythonString start=+[bB]\="""+ end=+"""+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest2,pythonSpaceError,@Spell - syn region pythonString start=+[bB]\='''+ end=+'''+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest,pythonSpaceError,@Spell - - syn match pythonEscape +\\[abfnrtv'"\\]+ display contained - syn match pythonEscape "\\\o\o\=\o\=" display contained - syn match pythonEscapeError "\\\o\{,2}[89]" display contained - syn match pythonEscape "\\x\x\{2}" display contained - syn match pythonEscapeError "\\x\x\=\X" display contained - syn match pythonEscape "\\$" - - " Unicode - syn region pythonUniString start=+[uU]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,@Spell - syn region pythonUniString start=+[uU]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,@Spell - syn region pythonUniString start=+[uU]"""+ end=+"""+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell - syn region pythonUniString start=+[uU]'''+ end=+'''+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell - - syn match pythonUniEscape "\\u\x\{4}" display contained - syn match pythonUniEscapeError "\\u\x\{,3}\X" display contained - syn match pythonUniEscape "\\U\x\{8}" display contained - syn match pythonUniEscapeError "\\U\x\{,7}\X" display contained - syn match pythonUniEscape "\\N{[A-Z ]\+}" display contained - syn match pythonUniEscapeError "\\N{[^A-Z ]\+}" display contained - - " Raw strings - syn region pythonRawString start=+[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell - syn region pythonRawString start=+[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell - syn region pythonRawString start=+[rR]"""+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell - syn region pythonRawString start=+[rR]'''+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell - - syn match pythonRawEscape +\\['"]+ display transparent contained - - " Unicode raw strings - syn region pythonUniRawString start=+[uU][rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell - syn region pythonUniRawString start=+[uU][rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell - syn region pythonUniRawString start=+[uU][rR]"""+ end=+"""+ keepend contains=pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest2,pythonSpaceError,@Spell - syn region pythonUniRawString start=+[uU][rR]'''+ end=+'''+ keepend contains=pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest,pythonSpaceError,@Spell - - syn match pythonUniRawEscape "\([^\\]\(\\\\\)*\)\@<=\\u\x\{4}" display contained - syn match pythonUniRawEscapeError "\([^\\]\(\\\\\)*\)\@<=\\u\x\{,3}\X" display contained - - " String formatting - if g:pymode_syntax_string_formatting - syn match pythonStrFormatting "%\(([^)]\+)\)\=[-#0 +]*\d*\(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString - syn match pythonStrFormatting "%[-#0 +]*\(\*\|\d\+\)\=\(\.\(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString - endif - - " Str.format syntax - if g:pymode_syntax_string_format - syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString - syn match pythonStrFormat "{\([a-zA-Z0-9_]*\|\d\+\)\(\.[a-zA-Z_][a-zA-Z0-9_]*\|\[\(\d\+\|[^!:\}]\+\)\]\)*\(![rs]\)\=\(:\({\([a-zA-Z_][a-zA-Z0-9_]*\|\d\+\)}\|\([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*\(\.\d\+\)\=[bcdeEfFgGnoxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString - endif - - " String templates - if g:pymode_syntax_string_templates - syn match pythonStrTemplate "\$\$" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString - syn match pythonStrTemplate "\${[a-zA-Z_][a-zA-Z0-9_]*}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString - syn match pythonStrTemplate "\$[a-zA-Z_][a-zA-Z0-9_]*" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString - endif - - " DocTests - if g:pymode_syntax_doctests - syn region pythonDocTest start="^\s*>>>" end=+'''+he=s-1 end="^\s*$" contained - syn region pythonDocTest2 start="^\s*>>>" end=+"""+he=s-1 end="^\s*$" contained - endif - - " DocStrings - if g:pymode_syntax_docstrings - syn region pythonDocstring start=+^\s*[uU]\?[rR]\?"""+ end=+"""+ keepend excludenl contains=pythonEscape,@Spell,pythonDoctest,pythonDocTest2,pythonSpaceError - syn region pythonDocstring start=+^\s*[uU]\?[rR]\?'''+ end=+'''+ keepend excludenl contains=pythonEscape,@Spell,pythonDoctest,pythonDocTest2,pythonSpaceError - endif - - -" }}} - -" Numbers {{{ -" =========== - - syn match pythonHexError "\<0[xX][0-9a-fA-F_]*[g-zG-Z][0-9a-fA-F_]*[lL]\=\>" display - syn match pythonHexNumber "\<0[xX][0-9a-fA-F_]*[0-9a-fA-F][0-9a-fA-F_]*[lL]\=\>" display - syn match pythonOctNumber "\<0[oO][0-7_]*[0-7][0-7_]*[lL]\=\>" display - syn match pythonBinNumber "\<0[bB][01_]*[01][01_]*[lL]\=\>" display - syn match pythonNumber "\<[0-9][0-9_]*[lLjJ]\=\>" display - syn match pythonFloat "\.[0-9_]*[0-9][0-9_]*\([eE][+-]\=[0-9_]*[0-9][0-9_]*\)\=[jJ]\=\>" display - syn match pythonFloat "\<[0-9][0-9_]*[eE][+-]\=[0-9_]\+[jJ]\=\>" display - syn match pythonFloat "\<[0-9][0-9_]*\.[0-9_]*\([eE][+-]\=[0-9_]*[0-9][0-9_]*\)\=[jJ]\=" display - syn match pythonOctError "\<0[oO]\=[0-7_]*[8-9][0-9_]*[lL]\=\>" display - syn match pythonBinError "\<0[bB][01_]*[2-9][0-9_]*[lL]\=\>" display - -" }}} - -" Builtins {{{ -" ============ - - " Builtin objects and types - if g:pymode_syntax_builtin_objs - " True, False, Ellipsis, and None are in fact keywords. - syn keyword pythonBuiltinObj True False Ellipsis None - syn keyword pythonBuiltinObj NotImplemented - syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__ __loader__ - syn keyword pythonBuiltinObj __spec__ __cached__ __annotations__ - endif - - if g:pymode_syntax_builtin_types - syn keyword pythonBuiltinType type object - syn keyword pythonBuiltinType str bytearray bytes chr - syn keyword pythonBuiltinType dict int bool float complex set frozenset list tuple - syn keyword pythonBuiltinType super - endif - - " Builtin functions - if g:pymode_syntax_builtin_funcs - syn keyword pythonBuiltinFunc __import__ abs all any - syn keyword pythonBuiltinFunc bin callable classmethod compile - syn keyword pythonBuiltinFunc delattr dir divmod enumerate eval execfile filter - syn keyword pythonBuiltinFunc format getattr globals locals hasattr hash help hex id - syn keyword pythonBuiltinFunc input isinstance issubclass iter len map max min - syn keyword pythonBuiltinFunc next oct open ord pow property range - syn keyword pythonBuiltinFunc repr reversed round setattr - syn keyword pythonBuiltinFunc slice sorted staticmethod sum vars zip - - if g:pymode_syntax_print_as_function - syn keyword pythonBuiltinFunc print - endif - - endif - - " Builtin exceptions and warnings - if g:pymode_syntax_highlight_exceptions - syn keyword pythonExClass BaseException Exception ArithmeticError - syn keyword pythonExClass BufferError LookupError - syn keyword pythonExClass AssertionError AttributeError EOFError - syn keyword pythonExClass FloatingPointError GeneratorExit - syn keyword pythonExClass ImportError ModuleNotFoundError IndexError - syn keyword pythonExClass KeyError KeyboardInterrupt MemoryError NameError - syn keyword pythonExClass NotImplementedError OSError OverflowError - syn keyword pythonExClass RecursionError ReferenceError RuntimeError StopIteration - syn keyword pythonExClass StopAsyncIteration SyntaxError IndentationError TabError - syn keyword pythonExClass SystemError SystemExit TypeError - syn keyword pythonExClass UnboundLocalError UnicodeError - syn keyword pythonExClass UnicodeEncodeError UnicodeDecodeError - syn keyword pythonExClass UnicodeTranslateError ValueError - syn keyword pythonExClass ZeroDivisionError EnvironmentError IOError - syn keyword pythonExClass WindowsError - syn keyword pythonExClass BlockingIOError ChildProcessError ConnectionError - syn keyword pythonExClass BrokenPipeError ConnectionAbortedError - syn keyword pythonExClass ConnectionRefusedError ConnectionResetError - syn keyword pythonExClass FileExistsError FileNotFoundError InterruptedError - syn keyword pythonExClass IsADirectoryError NotADirectoryError PermissionError - syn keyword pythonExClass ProcessLookupError TimeoutError - syn keyword pythonExClass Warning UserWarning DeprecationWarning PendingDeprecationWarning - syn keyword pythonExClass SyntaxWarning RuntimeWarning FutureWarning - syn keyword pythonExClass ImportWarning UnicodeWarning EncodingWarning - syn keyword pythonExClass BytesWarning ResourceWarning - endif - -" }}} - -if g:pymode_syntax_slow_sync - syn sync minlines=2000 -else - " This is fast but code inside triple quoted strings screws it up. It - " is impossible to fix because the only way to know if you are inside a - " triple quoted string is to start from the beginning of the file. - syn sync match pythonSync grouphere NONE "):$" - syn sync maxlines=200 -endif - -" Highlight {{{ -" ============= - - hi def link pythonStatement Statement - hi def link pythonLambdaExpr Statement - hi def link pythonInclude Include - hi def link pythonFunction Function - hi def link pythonClass Type - hi def link pythonParameters Normal - hi def link pythonParam Normal - hi def link pythonBrackets Normal - hi def link pythonClassParameters Normal - hi def link pythonSelf Identifier - - hi def link pythonConditional Conditional - hi def link pythonRepeat Repeat - hi def link pythonException Exception - hi def link pythonOperator Operator - hi def link pythonExtraOperator Operator - hi def link pythonExtraPseudoOperator Operator - - hi def link pythonDecorator Define - hi def link pythonDottedName Function - - hi def link pythonComment Comment - hi def link pythonCoding Special - hi def link pythonRun Special - hi def link pythonTodo Todo - - hi def link pythonError Error - hi def link pythonIndentError Error - hi def link pythonSpaceError Error - - hi def link pythonString String - hi def link pythonDocstring String - hi def link pythonUniString String - hi def link pythonRawString String - hi def link pythonUniRawString String - - hi def link pythonEscape Special - hi def link pythonEscapeError Error - hi def link pythonUniEscape Special - hi def link pythonUniEscapeError Error - hi def link pythonUniRawEscape Special - hi def link pythonUniRawEscapeError Error - - hi def link pythonStrFormatting Special - hi def link pythonStrFormat Special - hi def link pythonStrTemplate Special - - hi def link pythonDocTest Special - hi def link pythonDocTest2 Special - - hi def link pythonNumber Number - hi def link pythonHexNumber Number - hi def link pythonOctNumber Number - hi def link pythonBinNumber Number - hi def link pythonFloat Float - hi def link pythonOctError Error - hi def link pythonHexError Error - hi def link pythonBinError Error - - hi def link pythonBuiltinType Type - hi def link pythonBuiltinObj Structure - hi def link pythonBuiltinFunc Function - - hi def link pythonExClass Structure - -" }}} diff --git a/tests/motion_decorator.py b/tests/motion_decorator.py deleted file mode 100644 index 23055eb1..00000000 --- a/tests/motion_decorator.py +++ /dev/null @@ -1,37 +0,0 @@ -#!coding=utf-8 -""" -to test pymode motions, please put cursor on each of the lines -and press "vaM" for selecting methods or -"vaC" for selection class. -""" - -def a_decorator(func): - print("chamando func") - def wrapped(*args, **kw): - return func(*args, **kw) - print("Pós func") - return wrapped - -def b_decorator(func): - print("second chamando func") - def wrapped(*args, **kw): - return func(*args, **kw) - print("second Pós func") - return wrapped - -@b_decorator -@a_decorator -def teste(): - print("Not Selecting Decorator") - -class Teste: - @a_decorator - @b_decorator - def metodo(self): - print("Meu método") - - -teste() - -testinho = Teste() -testinho.metodo() diff --git a/tests/test.sh b/tests/test.sh deleted file mode 100755 index fe9fcae1..00000000 --- a/tests/test.sh +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/bash - -# Check before starting. -set -e -which vim 1>/dev/null 2>/dev/null - -cd $(dirname $0) - -# Source common variables. -source ./test_helpers_bash/test_variables.sh - -# Prepare tests by cleaning up all files. -source ./test_helpers_bash/test_prepare_once.sh - -# Initialize permanent files.. -source ./test_helpers_bash/test_createvimrc.sh - -# Execute tests. -declare -a TEST_ARRAY=( - "./test_bash/test_autopep8.sh" - "./test_bash/test_autocommands.sh" - "./test_bash/test_folding.sh" - "./test_bash/test_textobject.sh" - ) -## now loop through the above array -set +e -for ONE_TEST in "${TEST_ARRAY[@]}" -do - echo "Starting test: $ONE_TEST" >> $VIM_OUTPUT_FILE - bash -x "$ONE_TEST" - echo -e "\n$ONE_TEST: Return code: $?" >> $VIM_OUTPUT_FILE - bash ./test_helpers_bash/test_prepare_between_tests.sh -done - -# Show errors: -E1=$(grep -E "^E[0-9]+:" $VIM_OUTPUT_FILE) -E2=$(grep -E "^Error" $VIM_OUTPUT_FILE) -E3="$E1\n$E2" -if [ "$E3" = "\n" ] -then - echo "No errors." -else - echo "Errors:" - echo -e "$E3\n" -fi - -# Show return codes. -RETURN_CODES=$(cat $VIM_OUTPUT_FILE | grep -i "Return code") -echo -e "${RETURN_CODES}" - -# Exit the script with error if there are any return codes different from 0. -if echo $RETURN_CODES | grep -E "Return code: [1-9]" 1>/dev/null 2>/dev/null -then - exit 1 -else - exit 0 -fi - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_autocommands.sh b/tests/test_bash/test_autocommands.sh deleted file mode 100644 index bc46b9d5..00000000 --- a/tests/test_bash/test_autocommands.sh +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/bash - -# TODO XXX: improve python-mode testing asap. -# Test all python commands. - -# Execute tests. -declare -a TEST_PYMODE_COMMANDS_ARRAY=( - "./test_procedures_vimscript/pymodeversion.vim" - "./test_procedures_vimscript/pymodelint.vim" - "./test_procedures_vimscript/pymoderun.vim" - ) - -### Enable the following to execute one test at a time. -### FOR PINPOINT TESTING ### declare -a TEST_PYMODE_COMMANDS_ARRAY=( -### FOR PINPOINT TESTING ### "./test_procedures_vimscript/pymoderun.vim" -### FOR PINPOINT TESTING ### ) - -## now loop through the above array -set +e -for ONE_PYMODE_COMMANDS_TEST in "${TEST_PYMODE_COMMANDS_ARRAY[@]}" -do - echo "Starting test: $0:$ONE_PYMODE_COMMANDS_TEST" >> $VIM_OUTPUT_FILE - RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source $ONE_PYMODE_COMMANDS_TEST" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1) - - ### Enable the following to execute one test at a time. - ### FOR PINPOINT TESTING ### vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source $ONE_PYMODE_COMMANDS_TEST" $VIM_DISPOSABLE_PYFILE - ### FOR PINPOINT TESTING ### exit 1 - - RETURN_CODE=$? - echo -e "\n$0:$ONE_PYMODE_COMMANDS_TEST: Return code: $RETURN_CODE" >> $VIM_OUTPUT_FILE - bash ./test_helpers_bash/test_prepare_between_tests.sh -done - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_autopep8.sh b/tests/test_bash/test_autopep8.sh deleted file mode 100644 index 05585725..00000000 --- a/tests/test_bash/test_autopep8.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/bash - -# Source file. -set +e -RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/autopep8.vim" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1) -RETURN_CODE=$? -set -e -exit $RETURN_CODE - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_folding.sh b/tests/test_bash/test_folding.sh deleted file mode 100644 index d0ac884a..00000000 --- a/tests/test_bash/test_folding.sh +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/bash - -# Note: a solution with unix 'timeout' program was tried but it was unsuccessful. The problem with folding 4 is that in the case of a crash one expects the folding to just stay in an infinite loop, thus never existing with error. An improvement is suggested to this case. - -# Source file. -set +e -source ./test_helpers_bash/test_prepare_between_tests.sh -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding1.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -R1=$? -source ./test_helpers_bash/test_prepare_between_tests.sh -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding2.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -R2=$? -source ./test_helpers_bash/test_prepare_between_tests.sh -# TODO: enable folding3.vim script back. -# vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding3.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -# R3=$? -source ./test_helpers_bash/test_prepare_between_tests.sh -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding4.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -R4=$? -set -e - -if [[ "$R1" -ne 0 ]] -then - exit 1 -elif [[ "$R2" -ne 0 ]] -then - exit 2 -# elif [[ "$R3" -ne 0 ]] -# then -# exit 3 -elif [[ "$R4" -ne 0 ]] -then - exit 4 -fi - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_pymodelint.sh b/tests/test_bash/test_pymodelint.sh deleted file mode 100644 index 583d0774..00000000 --- a/tests/test_bash/test_pymodelint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/bash - -# TODO XXX: improve python-mode testing asap. -# Test all python commands. - -# Source file. -set +e -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/pymodelint.vim" $VIM_DISPOSABLE_PYFILE -# RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/pymodeversion.vim" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1) -# RETURN_CODE=$? -set -e -# exit $RETURN_CODE - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_textobject.sh b/tests/test_bash/test_textobject.sh deleted file mode 100644 index 43a799f9..00000000 --- a/tests/test_bash/test_textobject.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/bash - -# Source file. -set +e -source ./test_helpers_bash/test_prepare_between_tests.sh -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/textobject.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -R1=$? -set -e - -if [[ "$R1" -ne 0 ]] -then - exit 1 -fi - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_bash/test_createvimrc.sh b/tests/test_helpers_bash/test_createvimrc.sh deleted file mode 100644 index ae763b95..00000000 --- a/tests/test_helpers_bash/test_createvimrc.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/bash - -# Create minimal vimrc. -echo -e "syntax on\nfiletype plugin indent on\nset nocompatible" >> $VIM_TEST_VIMRC -echo "call has('python3')" >> $VIM_TEST_VIMRC -echo "set paste" >> $VIM_TEST_VIMRC -echo "set shortmess=at" >> $VIM_TEST_VIMRC -echo "set cmdheight=10" >> $VIM_TEST_VIMRC -echo "set ft=python" >> $VIM_TEST_VIMRC -echo "set shell=bash" >> $VIM_TEST_VIMRC -echo "set noswapfile" >> $VIM_TEST_VIMRC -echo "set backupdir=" >> $VIM_TEST_VIMRC -echo "set undodir=" >> $VIM_TEST_VIMRC -echo "set viewdir=" >> $VIM_TEST_VIMRC -echo "set directory=" >> $VIM_TEST_VIMRC -echo -e "set runtimepath=" >> $VIM_TEST_VIMRC -echo -e "set runtimepath+=$(dirname $PWD)\n" >> $VIM_TEST_VIMRC -echo -e "set packpath+=/tmp\n" >> $VIM_TEST_VIMRC -# echo -e "redir! >> $VIM_OUTPUT_FILE\n" >> $VIM_TEST_VIMRC -echo -e "set verbosefile=$VIM_OUTPUT_FILE\n" >> $VIM_TEST_VIMRC -echo -e "let g:pymode_debug = 1" >> $VIM_TEST_VIMRC - -echo "set nomore" >> $VIM_TEST_VIMRC - - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_bash/test_prepare_between_tests.sh b/tests/test_helpers_bash/test_prepare_between_tests.sh deleted file mode 100644 index cdce9869..00000000 --- a/tests/test_helpers_bash/test_prepare_between_tests.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash - -# Prepare tests. -set +e -if [ -f $VIM_DISPOSABLE_PYFILE ]; then - rm $VIM_DISPOSABLE_PYFILE -fi -export VIM_DISPOSABLE_PYFILE=`mktemp /tmp/pymode.tmpfile.XXXXXXXXXX.py` -set -e -touch $VIM_DISPOSABLE_PYFILE - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_bash/test_prepare_once.sh b/tests/test_helpers_bash/test_prepare_once.sh deleted file mode 100644 index dad77182..00000000 --- a/tests/test_helpers_bash/test_prepare_once.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/bash - -# Prepare tests. -set +e -rm $VIM_OUTPUT_FILE $VIM_TEST_VIMRC $VIM_TEST_PYMODECOMMANDS $VIM_DISPOSABLE_PYFILE 2&>/dev/null -rm /tmp/*pymode* 2&>/dev/null -rm -rf /tmp/pack -mkdir -p /tmp/pack/test_plugins/start -ln -s $(dirname $(pwd)) /tmp/pack/test_plugins/start/ -set -e - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_bash/test_variables.sh b/tests/test_helpers_bash/test_variables.sh deleted file mode 100644 index 53edb5e5..00000000 --- a/tests/test_helpers_bash/test_variables.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/bash - -# Define variables for common test scripts. - -# Set variables. -export VIM_DISPOSABLE_PYFILE=`mktemp /tmp/pymode.tmpfile.XXXXXXXXXX.py` -export VIM_OUTPUT_FILE=/tmp/pymode.out -export VIM_TEST_VIMRC=/tmp/pymode_vimrc -export VIM_TEST_PYMODECOMMANDS=/tmp/pymode_commands.txt - -# vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_vimscript/inserting_text.vim b/tests/test_helpers_vimscript/inserting_text.vim deleted file mode 100644 index 5b7624d3..00000000 --- a/tests/test_helpers_vimscript/inserting_text.vim +++ /dev/null @@ -1,98 +0,0 @@ -function! InsertRandomText(low_range, high_range) " {{{ - " Insert random ascii visible table text at cursor position. - " Return the number of characters inserted. - -python3 << EOF -import random, string, vim -# Text has to large from a larger sample in order to avoid errors. -text = random.sample( - (10 * string.ascii_lowercase + string.digits + ' '), - random.randint(int(vim.eval('a:low_range')), int(vim.eval('a:high_range')))) -vim.current.buffer.vars['random_text'] = ''.join(text) -EOF -let l:textwidth = &tw -set tw=0 -execute "normal! i" . b:random_text -let &tw = l:textwidth - -return len(b:random_text) - -endfunction " }}} - -function! DeleteChars(nchars) " {{{ - " Delete n chars at cursor position. - " It is the inverse of InsertRandomText(). - - let l:textwidth = &tw - set tw=0 - execute "normal! " . (repeat('h', a:nchars - 1)) - execute "normal! " . repeat('x', a:nchars) - let &tw = l:textwidth - -endfunction " }}} - -function! JumpToRandomPosition() " {{{ -" Jump cursor to a random position in current buffer. - -python3 << EOF -import random, vim -cw = vim.current.window -cb = vim.current.buffer -rand_line = random.randint(1, len(cb) - 1) -rand_line_len = len(cb[rand_line]) -rand_col = random.randint(0, rand_line_len) if rand_line_len > 0 else 0 -cw.cursor = (rand_line, rand_col) -EOF -endfunction " }}} - -function! DeleteRandomLines(low_range, high_range) " {{{ -" Delete random lines between low_range and high_range. -" Return the number of lines deleted. - -python3 << EOF -import random, vim -del_lines = random.randint( - int(vim.eval('a:low_range')), int(vim.eval('a:high_range'))) -vim.current.buffer.vars['del_lines'] = del_lines -EOF - -execute "normal! " . b:del_lines . "dd" - -return b:del_lines - -endfunction "}}} - -function! InsertTextAtRandomPositions(ntimes) " {{{ -" Insert text at random positions. May either insert in insert mode or in -" normal mode. - - let l:total_lines = line('$') - for i in range(a:ntimes) - -python3 << EOF -import random, vim -del_method = random.randint(0, 1) -vim.current.buffer.vars['del_method'] = del_method -EOF - - call JumpToRandomPosition() - " b:del_method is set to either change the buffer via insert mode or - " via normal mode. - if b:del_method - " This uses insert mode. - let l:inserted_chars = InsertRandomText(3, 100) - call DeleteChars(l:inserted_chars) - else - " This uses normal mode. - let l:current_line = getpos('.')[1] - let l:deleted_lines = DeleteRandomLines(1, 5) - if l:current_line + l:deleted_lines <= l:total_lines - execute "normal! P" - else - execute "normal! p" - endif - endif - - endfor - -endfunction " }}} diff --git a/tests/test_helpers_vimscript/md5sum.vim b/tests/test_helpers_vimscript/md5sum.vim deleted file mode 100644 index 78dfe35b..00000000 --- a/tests/test_helpers_vimscript/md5sum.vim +++ /dev/null @@ -1,14 +0,0 @@ -" Define md5sum hash function. -function! Md5() -python3 << EOF -import vim -from hashlib import md5 -hasher = md5() -cb = vim.current.buffer -with open(cb.name, 'rb') as f: - hasher.update(f.read()) -cb.vars['calculated_md5'] = hasher.hexdigest() -# vim.command('let md5digest = ' + hasher.hexdigest()) -EOF -" echom md5digest -endfunction diff --git a/tests/test_helpers_vimscript/moving_around.vim b/tests/test_helpers_vimscript/moving_around.vim deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/test_procedures_vimscript/autopep8.vim b/tests/test_procedures_vimscript/autopep8.vim deleted file mode 100644 index 5f92352f..00000000 --- a/tests/test_procedures_vimscript/autopep8.vim +++ /dev/null @@ -1,34 +0,0 @@ -" Test that the PymodeLintAuto changes a badly formated buffer. - -" Load sample python file. -read ./test_python_sample_code/from_autopep8.py - -" Load auxiliary code. -source ./test_helpers_vimscript/md5sum.vim - -" Delete the first line (which is not present in the original file) and save -" loaded file. -execute "normal! gg" -execute "normal! dd" -noautocmd write! - -" Get original md5sum for script. -call Md5() -let s:md5orig = b:calculated_md5 -unlet b:calculated_md5 - -" Change the buffer. -PymodeLintAuto -write! - -" Get different md5sum for script. -call Md5() -let s:md5mod = b:calculated_md5 - -" Assert changes. -call assert_notequal(s:md5orig, s:md5mod) -if len(v:errors) > 0 - cquit! -else - quit! -endif diff --git a/tests/test_procedures_vimscript/folding1.vim b/tests/test_procedures_vimscript/folding1.vim deleted file mode 100644 index 1a1361c0..00000000 --- a/tests/test_procedures_vimscript/folding1.vim +++ /dev/null @@ -1,38 +0,0 @@ -" Test that the PymodeLintAuto changes a badly formated buffer. - -" For safety empty current buffer. -execute "normal! :%d\" - -" Load sample python file. -read ./test_python_sample_code/folding1.py - -" Delete the first line (which is not present in the original file) and save -" loaded file. -execute "normal! gg" -execute "normal! dd" -noautocmd write! - -set fdm=marker -set fdm=expr - -let foldlevels = ['a1', '=', '=', '=', '=', '=', 's1', '=', '=', '=', '0', - \ '>1', '=', '=', '=', '=', '=', '0', '0', '0',] - -if len(foldlevels) != line('$') - echoerr 'Unmatching loaded file and foldlevels list.' -endif - -let i = 1 -for fdl in foldlevels - let calc = pymode#debug#foldingexpr(i) - let stored = fdl - call assert_true(calc == stored) - let i += 1 -endfor - -" Assert changes. -if len(v:errors) > 0 - cquit! -else - quit! -endif diff --git a/tests/test_procedures_vimscript/folding2.vim b/tests/test_procedures_vimscript/folding2.vim deleted file mode 100644 index 287f7871..00000000 --- a/tests/test_procedures_vimscript/folding2.vim +++ /dev/null @@ -1,41 +0,0 @@ -" Test that the PymodeLintAuto changes a badly formated buffer. - -" For safety empty current buffer. -execute "normal! :%d\" - -" Load sample python file. -read ./test_python_sample_code/folding2.py - -" Delete the first line (which is not present in the original file) and save -" loaded file. -execute "normal! gg" -execute "normal! dd" -noautocmd write! - -set fdm=marker -set fdm=expr - -let foldlevels = ['a1', '=', '=', '=', '=', '=', 's1', '=', '=', '=', '=', - \ '0', '>1', '=', '>2', '=', '=', '=', '=', '=', '1', '=', - \ '0', '>1', 'a1', '=', 's1', '=', '=', '>2', '=', '>3', '=', - \ 'a1', '=', '=', '=', 's1', '=', '=', '=', '=', '=', '=', - \'=', '=', '=', '=', '2', '=', '=', '1', '=', '0', '0', '0'] - -if len(foldlevels) != line('$') - echoerr 'Unmatching loaded file and foldlevels list.' -endif - -let i = 1 -for fdl in foldlevels - let calc = pymode#debug#foldingexpr(i) - let stored = fdl - call assert_true(calc == stored) - let i += 1 -endfor - -" Assert changes. -if len(v:errors) > 0 - cquit! -else - quit! -endif diff --git a/tests/test_procedures_vimscript/folding3.vim b/tests/test_procedures_vimscript/folding3.vim deleted file mode 100644 index 8ee376ed..00000000 --- a/tests/test_procedures_vimscript/folding3.vim +++ /dev/null @@ -1,66 +0,0 @@ -" Test that doing (reversible) changes in insert mode or normal mode to a -" buffer do not alter their folding. - -" Load sample python file. -read ./test_python_sample_code/algorithms.py - -" Delete the first line (which is not present in the original file) and save -" loaded file. -execute "normal! gg" -execute "normal! dd" -noautocmd write! - -" Load auxiliary code. -source ./test_helpers_vimscript/inserting_text.vim -source ./test_helpers_vimscript/md5sum.vim - -" Get original md5sum for script. -noautocmd write! -call Md5() -let s:md5orig = b:calculated_md5 -unlet b:calculated_md5 - -" Define a convenient function to map line numbers to their folding values. -function Pymodefoldingfuncref(key, val) - let l:retval = pymode#folding#expr(a:val) - return l:retval -endfunction! - - -" Force recomputation of all foldings. -" TODO: inspect why causes trouble. -" set fdm=expr -" set fdm=marker -" set fdm=expr -let b:old_fold_vals = map(range(1, line('$')), function('Pymodefoldingfuncref')) - -" Change folding in numerous ways. -call InsertTextAtRandomPositions(10) - -" Force recomputation of all foldings. -" set fdm=expr -" set fdm=marker -" set fdm=expr -let b:new_fold_vals = map(range(1, line('$')), function('Pymodefoldingfuncref')) - -" Get original md5sum for script. -noautocmd write! -call Md5() -let s:md5mod = b:calculated_md5 -unlet b:calculated_md5 - -" echom s:md5orig == s:md5mod -" echom b:new_fold_vals == b:old_fold_vals - -" set fdm=expr -" set fdm=marker -" set fdm=expr - -" Assert changes. -call assert_equal(s:md5orig, s:md5mod) -call assert_equal(b:new_fold_vals, b:old_fold_vals) -if len(v:errors) > 0 - cquit! -else - quit! -endif diff --git a/tests/test_procedures_vimscript/folding4.vim b/tests/test_procedures_vimscript/folding4.vim deleted file mode 100644 index 4331c71d..00000000 --- a/tests/test_procedures_vimscript/folding4.vim +++ /dev/null @@ -1,16 +0,0 @@ -" Test that doing (reversible) changes in insert mode or normal mode to a -" buffer do not alter their folding. - -" Load sample python file. -" With 'def'. -execute "normal! idef myfunc():\ a=1" -execute "normal! A; a= 2;" - -" Clean file. -execute "normal! :%d\" - -" With 'class'. -execute "normal! iclass MyClass():\ a=1" -execute "normal! A; a= 2;" - -quit! diff --git a/tests/test_procedures_vimscript/pymodelint.vim b/tests/test_procedures_vimscript/pymodelint.vim deleted file mode 100644 index e9b996b5..00000000 --- a/tests/test_procedures_vimscript/pymodelint.vim +++ /dev/null @@ -1,28 +0,0 @@ -" Test that the PymodeLintAuto changes a badly formated buffer. - -" Load sample python file. -read ./test_python_sample_code/from_autopep8.py - -" Delete the first line (which is not present in the original file) and save -" loaded file. -execute "normal! gg" -execute "normal! dd" -noautocmd write! - -" HOW TO BREAK: Remove very wrong python code leading to a short loclist of -" errors. -" Introduce errors. -" execute "normal! :%d\" - -" Start with an empty loclist. -call assert_true(len(getloclist(0)) == 0) -PymodeLint -call assert_true(len(getloclist(0)) > 5) -write! - -" Assert changes. -if len(v:errors) > 0 - cquit! -else - quitall! -endif diff --git a/tests/test_procedures_vimscript/pymoderun.vim b/tests/test_procedures_vimscript/pymoderun.vim deleted file mode 100644 index cf5431bd..00000000 --- a/tests/test_procedures_vimscript/pymoderun.vim +++ /dev/null @@ -1,34 +0,0 @@ -" Test that the PymodeLintAuto changes a badly formated buffer. - -" Load sample python file. -read ./test_python_sample_code/pymoderun_sample.py - -" Delete the first line (which is not present in the original file) and save -" loaded file. -execute "normal! gg" -execute "normal! dd" -noautocmd write! - -" Allow switching to windows with buffer command. -let s:curr_buffer = bufname("%") -set switchbuf+=useopen - -" Change the buffer. -PymodeRun -write! -let run_buffer = bufname("run") -execute "buffer " . run_buffer - -" Assert changes. - -" There exists a buffer. -call assert_true(len(run_buffer) > 0) - -" This buffer has more than five lines. -call assert_true(line('$') > 5) - -if len(v:errors) > 0 - cquit! -else - quit! -endif diff --git a/tests/test_procedures_vimscript/pymodeversion.vim b/tests/test_procedures_vimscript/pymodeversion.vim deleted file mode 100644 index b7d65481..00000000 --- a/tests/test_procedures_vimscript/pymodeversion.vim +++ /dev/null @@ -1,17 +0,0 @@ -" Test that the PymodeLintAuto changes a badly formated buffer. - -" Clear messages. -messages clear - -" Produce expected message. -PymodeVersion -let s:msg = execute('messages') - -" Assert changes. -call assert_match('pymode version', tolower(s:msg)) - -if len(v:errors) > 0 - cquit! -else - quit! -endif diff --git a/tests/test_procedures_vimscript/textobject.vim b/tests/test_procedures_vimscript/textobject.vim deleted file mode 100644 index cbd4ef05..00000000 --- a/tests/test_procedures_vimscript/textobject.vim +++ /dev/null @@ -1,83 +0,0 @@ -set noautoindent -let g:pymode_rope=1 - -" Load sample python file. -" With 'def'. -execute "normal! idef func1():\ a = 1\" -execute "normal! idef func2():\ b = 2" -normal 3ggdaMggf(P - -" Assert changes. -let content=getline('^', '$') -call assert_true(content == ['def func2():', ' b = 2', 'def func1():', ' a = 1']) - - -" Clean file. -%delete - -" With 'class'. -execute "normal! iclass Class1():\ a = 1\" -execute "normal! iclass Class2():\ b = 2\" -normal 3ggdaCggf(P - -" Assert changes. -let content=getline('^', '$') -call assert_true(content == ['class Class2():', ' b = 2', '', 'class Class1():', ' a = 1']) - - -" Clean file. -%delete - -" With 'def'. -execute "normal! iprint(\ 1\)\" -execute "normal! iprint(\ 2\)\" -execute "normal! iprint(\ 3\)\" -normal 4ggdV - -let content=getline('^', '$') -call assert_true(content == [ -\ "print(", " 1", ")", -\ "print(", " 3", ")", -\ "" -\]) - - -" Clean file. -%delete - -" With 'def'. -execute "normal! iprint(\ 1\)\" -execute "normal! iprint(\ 2\)\" -execute "normal! iprint(\ 3\)\" -execute "normal! iprint(\ 4\)\" -normal 5ggd2V - -let content=getline('^', '$') -call assert_true(content == [ -\ "print(", " 1", ")", -\ "print(", " 4", ")", -\ "" -\]) - -" Clean file. -%delete - -" With 'def'. -execute "normal! iprint(\ 1\)\" -execute "normal! iprint(\ 2\)\" -execute "normal! iprint(\ 3\)\" -execute "normal! iprint(\ 4\)\" -normal 5ggd2V - -let content=getline('^', '$') -call assert_true(content == [ -\ "print(", " 1", ")", -\ "print(", " 4", ")", -\ "" -\]) - -if len(v:errors) > 0 - cquit! -else - quit! -endif diff --git a/tests/test_python_sample_code/algorithms.py b/tests/test_python_sample_code/algorithms.py deleted file mode 100644 index cdd2e81f..00000000 --- a/tests/test_python_sample_code/algorithms.py +++ /dev/null @@ -1,501 +0,0 @@ -# This file is part of DEAP. -# -# DEAP is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation, either version 3 of -# the License, or (at your option) any later version. -# -# DEAP is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with DEAP. If not, see . - -"""The :mod:`algorithms` module is intended to contain some specific algorithms -in order to execute very common evolutionary algorithms. The method used here -are more for convenience than reference as the implementation of every -evolutionary algorithm may vary infinitely. Most of the algorithms in this -module use operators registered in the toolbox. Generally, the keyword used are -:meth:`mate` for crossover, :meth:`mutate` for mutation, :meth:`~deap.select` -for selection and :meth:`evaluate` for evaluation. - -You are encouraged to write your own algorithms in order to make them do what -you really want them to do. -""" - -import random - -import tools - - -def varAnd(population, toolbox, cxpb, mutpb): - """Part of an evolutionary algorithm applying only the variation part - (crossover **and** mutation). The modified individuals have their - fitness invalidated. The individuals are cloned so returned population is - independent of the input population. - - :param population: A list of individuals to vary. - :param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution - operators. - :param cxpb: The probability of mating two individuals. - :param mutpb: The probability of mutating an individual. - :returns: A list of varied individuals that are independent of their - parents. - - The variation goes as follow. First, the parental population - :math:`P_\mathrm{p}` is duplicated using the :meth:`toolbox.clone` method - and the result is put into the offspring population :math:`P_\mathrm{o}`. A - first loop over :math:`P_\mathrm{o}` is executed to mate pairs of - consecutive individuals. According to the crossover probability *cxpb*, the - individuals :math:`\mathbf{x}_i` and :math:`\mathbf{x}_{i+1}` are mated - using the :meth:`toolbox.mate` method. The resulting children - :math:`\mathbf{y}_i` and :math:`\mathbf{y}_{i+1}` replace their respective - parents in :math:`P_\mathrm{o}`. A second loop over the resulting - :math:`P_\mathrm{o}` is executed to mutate every individual with a - probability *mutpb*. When an individual is mutated it replaces its not - mutated version in :math:`P_\mathrm{o}`. The resulting :math:`P_\mathrm{o}` - is returned. - - This variation is named *And* beceause of its propention to apply both - crossover and mutation on the individuals. Note that both operators are - not applied systematically, the resulting individuals can be generated from - crossover only, mutation only, crossover and mutation, and reproduction - according to the given probabilities. Both probabilities should be in - :math:`[0, 1]`. - """ - offspring = [toolbox.clone(ind) for ind in population] - - # Apply crossover and mutation on the offspring - for i in range(1, len(offspring), 2): - if random.random() < cxpb: - offspring[i - 1], offspring[i] = toolbox.mate(offspring[i - 1], - offspring[i]) - del offspring[i - 1].fitness.values, offspring[i].fitness.values - - for i in range(len(offspring)): - if random.random() < mutpb: - offspring[i], = toolbox.mutate(offspring[i]) - del offspring[i].fitness.values - - return offspring - - -def eaSimple(population, toolbox, cxpb, mutpb, ngen, stats=None, - halloffame=None, verbose=__debug__): - """This algorithm reproduce the simplest evolutionary algorithm as - presented in chapter 7 of [Back2000]_. - - :param population: A list of individuals. - :param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution - operators. - :param cxpb: The probability of mating two individuals. - :param mutpb: The probability of mutating an individual. - :param ngen: The number of generation. - :param stats: A :class:`~deap.tools.Statistics` object that is updated - inplace, optional. - :param halloffame: A :class:`~deap.tools.HallOfFame` object that will - contain the best individuals, optional. - :param verbose: Whether or not to log the statistics. - :returns: The final population - :returns: A class:`~deap.tools.Logbook` with the statistics of the - evolution - - The algorithm takes in a population and evolves it in place using the - :meth:`varAnd` method. It returns the optimized population and a - :class:`~deap.tools.Logbook` with the statistics of the evolution. The - logbook will contain the generation number, the number of evalutions for - each generation and the statistics if a :class:`~deap.tools.Statistics` is - given as argument. The *cxpb* and *mutpb* arguments are passed to the - :func:`varAnd` function. The pseudocode goes as follow :: - - evaluate(population) - for g in range(ngen): - population = select(population, len(population)) - offspring = varAnd(population, toolbox, cxpb, mutpb) - evaluate(offspring) - population = offspring - - As stated in the pseudocode above, the algorithm goes as follow. First, it - evaluates the individuals with an invalid fitness. Second, it enters the - generational loop where the selection procedure is applied to entirely - replace the parental population. The 1:1 replacement ratio of this - algorithm **requires** the selection procedure to be stochastic and to - select multiple times the same individual, for example, - :func:`~deap.tools.selTournament` and :func:`~deap.tools.selRoulette`. - Third, it applies the :func:`varAnd` function to produce the next - generation population. Fourth, it evaluates the new individuals and - compute the statistics on this population. Finally, when *ngen* - generations are done, the algorithm returns a tuple with the final - population and a :class:`~deap.tools.Logbook` of the evolution. - - .. note:: - - Using a non-stochastic selection method will result in no selection as - the operator selects *n* individuals from a pool of *n*. - - This function expects the :meth:`toolbox.mate`, :meth:`toolbox.mutate`, - :meth:`toolbox.select` and :meth:`toolbox.evaluate` aliases to be - registered in the toolbox. - - .. [Back2000] Back, Fogel and Michalewicz, "Evolutionary Computation 1 : - Basic Algorithms and Operators", 2000. - """ - logbook = tools.Logbook() - logbook.header = ['gen', 'nevals'] + (stats.fields if stats else []) - - # Evaluate the individuals with an invalid fitness - invalid_ind = [ind for ind in population if not ind.fitness.valid] - fitnesses = toolbox.map(toolbox.evaluate, invalid_ind) - for ind, fit in zip(invalid_ind, fitnesses): - ind.fitness.values = fit - - if halloffame is not None: - halloffame.update(population) - - record = stats.compile(population) if stats else {} - logbook.record(gen=0, nevals=len(invalid_ind), **record) - if verbose: - print logbook.stream - - # Begin the generational process - for gen in range(1, ngen + 1): - # Select the next generation individuals - offspring = toolbox.select(population, len(population)) - - # Vary the pool of individuals - offspring = varAnd(offspring, toolbox, cxpb, mutpb) - - # Evaluate the individuals with an invalid fitness - invalid_ind = [ind for ind in offspring if not ind.fitness.valid] - fitnesses = toolbox.map(toolbox.evaluate, invalid_ind) - for ind, fit in zip(invalid_ind, fitnesses): - ind.fitness.values = fit - - # Update the hall of fame with the generated individuals - if halloffame is not None: - halloffame.update(offspring) - - # Replace the current population by the offspring - population[:] = offspring - - # Append the current generation statistics to the logbook - record = stats.compile(population) if stats else {} - logbook.record(gen=gen, nevals=len(invalid_ind), **record) - if verbose: - print logbook.stream - - return population, logbook - - -def varOr(population, toolbox, lambda_, cxpb, mutpb): - """Part of an evolutionary algorithm applying only the variation part - (crossover, mutation **or** reproduction). The modified individuals have - their fitness invalidated. The individuals are cloned so returned - population is independent of the input population. - - :param population: A list of individuals to vary. - :param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution - operators. - :param lambda\_: The number of children to produce - :param cxpb: The probability of mating two individuals. - :param mutpb: The probability of mutating an individual. - :returns: The final population - :returns: A class:`~deap.tools.Logbook` with the statistics of the - evolution - - The variation goes as follow. On each of the *lambda_* iteration, it - selects one of the three operations; crossover, mutation or reproduction. - In the case of a crossover, two individuals are selected at random from - the parental population :math:`P_\mathrm{p}`, those individuals are cloned - using the :meth:`toolbox.clone` method and then mated using the - :meth:`toolbox.mate` method. Only the first child is appended to the - offspring population :math:`P_\mathrm{o}`, the second child is discarded. - In the case of a mutation, one individual is selected at random from - :math:`P_\mathrm{p}`, it is cloned and then mutated using using the - :meth:`toolbox.mutate` method. The resulting mutant is appended to - :math:`P_\mathrm{o}`. In the case of a reproduction, one individual is - selected at random from :math:`P_\mathrm{p}`, cloned and appended to - :math:`P_\mathrm{o}`. - - This variation is named *Or* beceause an offspring will never result from - both operations crossover and mutation. The sum of both probabilities - shall be in :math:`[0, 1]`, the reproduction probability is - 1 - *cxpb* - *mutpb*. - """ - assert (cxpb + mutpb) <= 1.0, ( - "The sum of the crossover and mutation probabilities must be smaller " - "or equal to 1.0.") - - offspring = [] - for _ in xrange(lambda_): - op_choice = random.random() - if op_choice < cxpb: # Apply crossover - ind1, ind2 = map(toolbox.clone, random.sample(population, 2)) - ind1, ind2 = toolbox.mate(ind1, ind2) - del ind1.fitness.values - offspring.append(ind1) - elif op_choice < cxpb + mutpb: # Apply mutation - ind = toolbox.clone(random.choice(population)) - ind, = toolbox.mutate(ind) - del ind.fitness.values - offspring.append(ind) - else: # Apply reproduction - offspring.append(random.choice(population)) - - return offspring - - -def eaMuPlusLambda(population, toolbox, mu, lambda_, cxpb, mutpb, ngen, - stats=None, halloffame=None, verbose=__debug__): - """This is the :math:`(\mu + \lambda)` evolutionary algorithm. - - :param population: A list of individuals. - :param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution - operators. - :param mu: The number of individuals to select for the next generation. - :param lambda\_: The number of children to produce at each generation. - :param cxpb: The probability that an offspring is produced by crossover. - :param mutpb: The probability that an offspring is produced by mutation. - :param ngen: The number of generation. - :param stats: A :class:`~deap.tools.Statistics` object that is updated - inplace, optional. - :param halloffame: A :class:`~deap.tools.HallOfFame` object that will - contain the best individuals, optional. - :param verbose: Whether or not to log the statistics. - :returns: The final population - :returns: A class:`~deap.tools.Logbook` with the statistics of the - evolution. - - The algorithm takes in a population and evolves it in place using the - :func:`varOr` function. It returns the optimized population and a - :class:`~deap.tools.Logbook` with the statistics of the evolution. The - logbook will contain the generation number, the number of evalutions for - each generation and the statistics if a :class:`~deap.tools.Statistics` is - given as argument. The *cxpb* and *mutpb* arguments are passed to the - :func:`varOr` function. The pseudocode goes as follow :: - - evaluate(population) - for g in range(ngen): - offspring = varOr(population, toolbox, lambda_, cxpb, mutpb) - evaluate(offspring) - population = select(population + offspring, mu) - - First, the individuals having an invalid fitness are evaluated. Second, - the evolutionary loop begins by producing *lambda_* offspring from the - population, the offspring are generated by the :func:`varOr` function. The - offspring are then evaluated and the next generation population is - selected from both the offspring **and** the population. Finally, when - *ngen* generations are done, the algorithm returns a tuple with the final - population and a :class:`~deap.tools.Logbook` of the evolution. - - This function expects :meth:`toolbox.mate`, :meth:`toolbox.mutate`, - :meth:`toolbox.select` and :meth:`toolbox.evaluate` aliases to be - registered in the toolbox. This algorithm uses the :func:`varOr` - variation. - """ - logbook = tools.Logbook() - logbook.header = ['gen', 'nevals'] + (stats.fields if stats else []) - - # Evaluate the individuals with an invalid fitness - invalid_ind = [ind for ind in population if not ind.fitness.valid] - fitnesses = toolbox.map(toolbox.evaluate, invalid_ind) - for ind, fit in zip(invalid_ind, fitnesses): - ind.fitness.values = fit - - if halloffame is not None: - halloffame.update(population) - - record = stats.compile(population) if stats is not None else {} - logbook.record(gen=0, nevals=len(invalid_ind), **record) - if verbose: - print logbook.stream - - # Begin the generational process - for gen in range(1, ngen + 1): - # Vary the population - offspring = varOr(population, toolbox, lambda_, cxpb, mutpb) - - # Evaluate the individuals with an invalid fitness - invalid_ind = [ind for ind in offspring if not ind.fitness.valid] - fitnesses = toolbox.map(toolbox.evaluate, invalid_ind) - for ind, fit in zip(invalid_ind, fitnesses): - ind.fitness.values = fit - - # Update the hall of fame with the generated individuals - if halloffame is not None: - halloffame.update(offspring) - - # Select the next generation population - population[:] = toolbox.select(population + offspring, mu) - - # Update the statistics with the new population - record = stats.compile(population) if stats is not None else {} - logbook.record(gen=gen, nevals=len(invalid_ind), **record) - if verbose: - print logbook.stream - - return population, logbook - - -def eaMuCommaLambda(population, toolbox, mu, lambda_, cxpb, mutpb, ngen, - stats=None, halloffame=None, verbose=__debug__): - """This is the :math:`(\mu~,~\lambda)` evolutionary algorithm. - - :param population: A list of individuals. - :param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution - operators. - :param mu: The number of individuals to select for the next generation. - :param lambda\_: The number of children to produce at each generation. - :param cxpb: The probability that an offspring is produced by crossover. - :param mutpb: The probability that an offspring is produced by mutation. - :param ngen: The number of generation. - :param stats: A :class:`~deap.tools.Statistics` object that is updated - inplace, optional. - :param halloffame: A :class:`~deap.tools.HallOfFame` object that will - contain the best individuals, optional. - :param verbose: Whether or not to log the statistics. - :returns: The final population - :returns: A class:`~deap.tools.Logbook` with the statistics of the - evolution - - The algorithm takes in a population and evolves it in place using the - :func:`varOr` function. It returns the optimized population and a - :class:`~deap.tools.Logbook` with the statistics of the evolution. The - logbook will contain the generation number, the number of evalutions for - each generation and the statistics if a :class:`~deap.tools.Statistics` is - given as argument. The *cxpb* and *mutpb* arguments are passed to the - :func:`varOr` function. The pseudocode goes as follow :: - - evaluate(population) - for g in range(ngen): - offspring = varOr(population, toolbox, lambda_, cxpb, mutpb) - evaluate(offspring) - population = select(offspring, mu) - - First, the individuals having an invalid fitness are evaluated. Second, - the evolutionary loop begins by producing *lambda_* offspring from the - population, the offspring are generated by the :func:`varOr` function. The - offspring are then evaluated and the next generation population is - selected from **only** the offspring. Finally, when - *ngen* generations are done, the algorithm returns a tuple with the final - population and a :class:`~deap.tools.Logbook` of the evolution. - - .. note:: - - Care must be taken when the lambda:mu ratio is 1 to 1 as a - non-stochastic selection will result in no selection at all as the - operator selects *lambda* individuals from a pool of *mu*. - - - This function expects :meth:`toolbox.mate`, :meth:`toolbox.mutate`, - :meth:`toolbox.select` and :meth:`toolbox.evaluate` aliases to be - registered in the toolbox. This algorithm uses the :func:`varOr` - variation. - """ - assert lambda_ >= mu, "lambda must be greater or equal to mu." - - # Evaluate the individuals with an invalid fitness - invalid_ind = [ind for ind in population if not ind.fitness.valid] - fitnesses = toolbox.map(toolbox.evaluate, invalid_ind) - for ind, fit in zip(invalid_ind, fitnesses): - ind.fitness.values = fit - - if halloffame is not None: - halloffame.update(population) - - logbook = tools.Logbook() - logbook.header = ['gen', 'nevals'] + (stats.fields if stats else []) - - record = stats.compile(population) if stats is not None else {} - logbook.record(gen=0, nevals=len(invalid_ind), **record) - if verbose: - print logbook.stream - - # Begin the generational process - for gen in range(1, ngen + 1): - # Vary the population - offspring = varOr(population, toolbox, lambda_, cxpb, mutpb) - - # Evaluate the individuals with an invalid fitness - invalid_ind = [ind for ind in offspring if not ind.fitness.valid] - fitnesses = toolbox.map(toolbox.evaluate, invalid_ind) - for ind, fit in zip(invalid_ind, fitnesses): - ind.fitness.values = fit - - # Update the hall of fame with the generated individuals - if halloffame is not None: - halloffame.update(offspring) - - # Select the next generation population - population[:] = toolbox.select(offspring, mu) - - # Update the statistics with the new population - record = stats.compile(population) if stats is not None else {} - logbook.record(gen=gen, nevals=len(invalid_ind), **record) - if verbose: - print logbook.stream - return population, logbook - - -def eaGenerateUpdate(toolbox, ngen, halloffame=None, stats=None, - verbose=__debug__): - """This is algorithm implements the ask-tell model proposed in - [Colette2010]_, where ask is called `generate` and tell is called `update`. - - :param toolbox: A :class:`~deap.base.Toolbox` that contains the evolution - operators. - :param ngen: The number of generation. - :param stats: A :class:`~deap.tools.Statistics` object that is updated - inplace, optional. - :param halloffame: A :class:`~deap.tools.HallOfFame` object that will - contain the best individuals, optional. - :param verbose: Whether or not to log the statistics. - :returns: The final population - :returns: A class:`~deap.tools.Logbook` with the statistics of the - evolution - - The algorithm generates the individuals using the :func:`toolbox.generate` - function and updates the generation method with the :func:`toolbox.update` - function. It returns the optimized population and a - :class:`~deap.tools.Logbook` with the statistics of the evolution. The - logbook will contain the generation number, the number of evalutions for - each generation and the statistics if a :class:`~deap.tools.Statistics` is - given as argument. The pseudocode goes as follow :: - - for g in range(ngen): - population = toolbox.generate() - evaluate(population) - toolbox.update(population) - - .. [Colette2010] Collette, Y., N. Hansen, G. Pujol, D. Salazar Aponte and - R. Le Riche (2010). On Object-Oriented Programming of Optimizers - - Examples in Scilab. In P. Breitkopf and R. F. Coelho, eds.: - Multidisciplinary Design Optimization in Computational Mechanics, - Wiley, pp. 527-565; - - """ - logbook = tools.Logbook() - logbook.header = ['gen', 'nevals'] + (stats.fields if stats else []) - - for gen in xrange(ngen): - # Generate a new population - population = toolbox.generate() - # Evaluate the individuals - fitnesses = toolbox.map(toolbox.evaluate, population) - for ind, fit in zip(population, fitnesses): - ind.fitness.values = fit - - if halloffame is not None: - halloffame.update(population) - - # Update the strategy with the evaluated individuals - toolbox.update(population) - - record = stats.compile(population) if stats is not None else {} - logbook.record(gen=gen, nevals=len(population), **record) - if verbose: - print logbook.stream - - return population, logbook diff --git a/tests/test_python_sample_code/folding1.py b/tests/test_python_sample_code/folding1.py deleted file mode 100644 index d36f0b18..00000000 --- a/tests/test_python_sample_code/folding1.py +++ /dev/null @@ -1,20 +0,0 @@ -"""One liner. - -Multi line. - -Docstring. - -""" - -import math - - -def top_function(a, b, c): - """One liner docstring.""" - print(a) - print(b) - print(c) - - -if __name__ == '__main__': - top_function(math.e, 1, 'si') diff --git a/tests/test_python_sample_code/folding2.py b/tests/test_python_sample_code/folding2.py deleted file mode 100644 index 902cbaaa..00000000 --- a/tests/test_python_sample_code/folding2.py +++ /dev/null @@ -1,56 +0,0 @@ -"""Module level docstring. - -Multi line. - -Docstring. - -""" - -import math -import functools - - -def dec_logger(func): - """One liner.""" - @functools.wraps(func) - def wrapper(*arg, **kargs): - """Imperative one liner.""" - result = func(*arg, **kargs) - print(result) - return result - return wrapper - - -def n1(x): # noqa - """Multi line - Docstring. - """ - a = x + 1 - - def n2(y): - """Single line docstring.""" - @dec_logger - def n3(z): - """Have multiline. - Docstring - As - Well - """ - - - # Leave some blank spaces - - - - - - return str(z) + 'expanded' - - b = y + 1 - n3(b) - return b - n2(a) - - -if __name__ == '__main__': - n1(math.pi) diff --git a/tests/test_python_sample_code/from_autopep8.py b/tests/test_python_sample_code/from_autopep8.py deleted file mode 100644 index b04a9a16..00000000 --- a/tests/test_python_sample_code/from_autopep8.py +++ /dev/null @@ -1,21 +0,0 @@ -import math, sys; - -def example1(): - ####This is a long comment. This should be wrapped to fit within 72 characters. - some_tuple=( 1,2, 3,'a' ); - some_variable={'long':'Long code lines should be wrapped within 79 characters.', - 'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'], - 'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1, - 20,300,40000,500000000,60000000000000000]}} - return (some_tuple, some_variable) -def example2(): return {'has_key() is deprecated':True}.has_key({'f':2}.has_key('')); -class Example3( object ): - def __init__ ( self, bar ): - #Comments should have a space after the hash. - if bar : bar+=1; bar=bar* bar ; return bar - else: - some_string = """ - Indentation in multiline strings should not be touched. -Only actual code should be reindented. -""" - return (sys.path, some_string) diff --git a/tests/test_python_sample_code/pymoderun_sample.py b/tests/test_python_sample_code/pymoderun_sample.py deleted file mode 100644 index 9d505aa6..00000000 --- a/tests/test_python_sample_code/pymoderun_sample.py +++ /dev/null @@ -1,4 +0,0 @@ -# Output more than 5 lines to stdout. -a = 10 -for z in range(a): - print(z) diff --git a/tests/utils/pymoderc b/tests/utils/pymoderc deleted file mode 100644 index 222c6ceb..00000000 --- a/tests/utils/pymoderc +++ /dev/null @@ -1,90 +0,0 @@ -" These are all pymode configs. You can read about them using :help pymode -let g:pymode = 1 -let g:pymode_warnings = 1 -let g:pymode_paths = [] -let g:pymode_trim_whitespaces = 1 -let g:pymode_options = 1 -let g:pymode_options_max_line_length = 79 -let g:pymode_options_colorcolumn = 1 -let g:pymode_quickfix_minheight = 3 -let g:pymode_quickfix_maxheight = 6 -let g:pymode_indent = 1 -let g:pymode_folding = 0 -let g:pymode_motion = 1 -let g:pymode_doc = 1 -let g:pymode_doc_bind = 'K' -let g:pymode_virtualenv = 1 -let g:pymode_virtualenv_path = $VIRTUAL_ENV -let g:pymode_run = 1 -let g:pymode_run_bind = 'r' -let g:pymode_breakpoint = 1 -let g:pymode_breakpoint_bind = 'b' -let g:pymode_breakpoint_cmd = '' -let g:pymode_lint = 1 -let g:pymode_lint_on_write = 1 -let g:pymode_lint_unmodified = 0 -let g:pymode_lint_on_fly = 0 -let g:pymode_lint_message = 1 -let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe'] -let g:pymode_lint_ignore = ["E501", "W",] -let g:pymode_lint_select = ["E501", "W0011", "W430"] -let g:pymode_lint_sort = [] -let g:pymode_lint_cwindow = 1 -let g:pymode_lint_signs = 1 -let g:pymode_lint_todo_symbol = 'WW' -let g:pymode_lint_comment_symbol = 'CC' -let g:pymode_lint_visual_symbol = 'RR' -let g:pymode_lint_error_symbol = 'EE' -let g:pymode_lint_info_symbol = 'II' -let g:pymode_lint_pyflakes_symbol = 'FF' -let g:pymode_lint_options_pep8 = - \ {'max_line_length': g:pymode_options_max_line_length} -let g:pymode_lint_options_pyflakes = { 'builtins': '_' } -let g:pymode_lint_options_mccabe = { 'complexity': 12 } -let g:pymode_lint_options_pep257 = {} -let g:pymode_lint_options_pylint = - \ {'max-line-length': g:pymode_options_max_line_length} -let g:pymode_rope = 1 -let g:pymode_rope_lookup_project = 0 -let g:pymode_rope_project_root = "" -let g:pymode_rope_ropefolder='.ropeproject' -let g:pymode_rope_show_doc_bind = 'd' -let g:pymode_rope_regenerate_on_write = 1 -let g:pymode_rope_completion = 1 -let g:pymode_rope_complete_on_dot = 1 -let g:pymode_rope_completion_bind = '' -let g:pymode_rope_autoimport = 0 -let g:pymode_rope_autoimport_modules = ['os', 'shutil', 'datetime'] -let g:pymode_rope_autoimport_import_after_complete = 0 -let g:pymode_rope_goto_definition_bind = 'g' -let g:pymode_rope_goto_definition_cmd = 'new' -let g:pymode_rope_rename_bind = 'rr' -let g:pymode_rope_rename_module_bind = 'r1r' -let g:pymode_rope_organize_imports_bind = 'ro' -let g:pymode_rope_autoimport_bind = 'ra' -let g:pymode_rope_module_to_package_bind = 'r1p' -let g:pymode_rope_extract_method_bind = 'rm' -let g:pymode_rope_extract_variable_bind = 'rl' -let g:pymode_rope_use_function_bind = 'ru' -let g:pymode_rope_move_bind = 'rv' -let g:pymode_rope_change_signature_bind = 'rs' -let g:pymode_syntax = 1 -let g:pymode_syntax_slow_sync = 1 -let g:pymode_syntax_all = 1 -let g:pymode_syntax_print_as_function = 0 -let g:pymode_syntax_highlight_async_await = g:pymode_syntax_all -let g:pymode_syntax_highlight_equal_operator = g:pymode_syntax_all -let g:pymode_syntax_highlight_stars_operator = g:pymode_syntax_all -let g:pymode_syntax_highlight_self = g:pymode_syntax_all -let g:pymode_syntax_indent_errors = g:pymode_syntax_all -let g:pymode_syntax_space_errors = g:pymode_syntax_all -let g:pymode_syntax_string_formatting = g:pymode_syntax_all -let g:pymode_syntax_string_format = g:pymode_syntax_all -let g:pymode_syntax_string_templates = g:pymode_syntax_all -let g:pymode_syntax_doctests = g:pymode_syntax_all -let g:pymode_syntax_builtin_objs = g:pymode_syntax_all -let g:pymode_syntax_builtin_types = g:pymode_syntax_all -let g:pymode_syntax_highlight_exceptions = g:pymode_syntax_all -let g:pymode_syntax_docstrings = g:pymode_syntax_all - -" vim:tw=79:ts=8:ft=help:norl: diff --git a/tests/utils/vimrc b/tests/utils/vimrc deleted file mode 100644 index 6920a0bb..00000000 --- a/tests/utils/vimrc +++ /dev/null @@ -1,22 +0,0 @@ -source /root/.vimrc.before -source /root/.pymoderc - -syntax on -filetype plugin indent on -set shortmess=at -set cmdheight=10 -set ft=python -set shell=bash -set rtp+=/root/.vim/pack/foo/start/python-mode -set term=xterm-256color -set wrap " visually wrap lines -set smartindent " smart indenting -set shiftwidth=4 " default to two spaces -set tabstop=4 " default to two spaces -set softtabstop=4 " default to two spaces -set shiftround " always round indentation to shiftwidth -set mouse= " disable mouse -set expandtab -set backspace=indent,eol,start - -source /root/.vimrc.after From f7bfc988be5c93fa19d70f8958c01e4333e7a381 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 14:25:40 -0500 Subject: [PATCH 02/14] Modify readme and doc/. --- doc/pymode.txt | 901 ------------------------------------------------- readme.md | 263 +-------------- 2 files changed, 11 insertions(+), 1153 deletions(-) delete mode 100644 doc/pymode.txt diff --git a/doc/pymode.txt b/doc/pymode.txt deleted file mode 100644 index 65f3e9a4..00000000 --- a/doc/pymode.txt +++ /dev/null @@ -1,901 +0,0 @@ -*pymode.txt* For Vim Version 8.0 Last change: 2019 March 08 - - ____ _ _ ____ _ _ _____ _ _ __ __ _____ ____ ____ ~ - ( _ \( \/ )(_ _)( )_( )( _ )( \( )___( \/ )( _ )( _ \( ___) ~ - )___/ \ / )( ) _ ( )(_)( ) ((___)) ( )(_)( )(_) ))__) ~ - (__) (__) (__) (_) (_)(_____)(_)\_) (_/\/\_)(_____)(____/(____) ~ - - - Version: 0.13.0 - -=============================================================================== -CONTENTS *pymode-contents* - -1. Intro...........................................................|pymode-intro| -2. Common functionality...........................................|pymode-common| - 2.1 Python version....................................|pymode-python-version| - 2.2 Python indentation........................................|pymode-indent| - 2.3 Python folding...........................................|pymode-folding| - 2.4 Vim motion................................................|pymode-motion| - 2.5 Show documentation.................................|pymode-documentation| - 2.6 Support virtualenv....................................|pymode-virtualenv| - 2.7 Run code.....................................................|pymode-run| - 2.8 Breakpoints..........................................|pymode-breakpoints| -3. Code checking....................................................|pymode-lint| - 3.1 Code checkers options...............................|pymode-lint-options| -4. Rope support.....................................................|pymode-rope| - 4.1 Code completion.......................................|pymode-completion| - 4.2 Find definition......................................|pymode-rope-findit| - 4.3 Refactoring.....................................|pymode-rope-refactoring| - 4.4 Undo/Redo changes......................................|pymode-rope-undo| -5. Syntax.........................................................|pymode-syntax| -6. FAQ...............................................................|pymode-faq| -7. Development...............................................|pymode-development| -8. Credits.......................................................|pymode-credits| -9. License.......................................................|pymode-license| - -=============================================================================== -1. Intro ~ - *pymode-intro* - -XXX IMPORTANT: As of 2017-11-18 python-mode is going through a major redesign. -Thus some of its functionality may not work as expected. Please be patient and -do report bugs or inconsistencies in its documentation. But remember to look -for already openned bug reports for the same issue before creating a new one. - -Python-mode is a vim plugin that allows you to use the pylint, rope, and pydoc -libraries in vim to provide features like python code bug checking, -refactoring, and some other useful things. - -This plugin allows you to create python code in vim very easily. There is no -need to install the pylint or rope libraries on your system. - -Python-mode contains all you need to develop python applications in Vim. - -Features: *pymode-features* - -- Support Python version 2.6+ and 3.2+ -- Syntax highlighting -- Virtualenv support -- Run python code (``r``) -- Add/remove breakpoints (``b``) -- Improved Python indentation -- Python folding -- Python motions and operators (``]]``, ``3[[``, ``]]M``, ``vaC``, ``viM``, - ``daC``, ``ciM``, ...) -- Code checking (pylint_, pyflakes_, pylama_, ...) that can be run - simultaneously (``:PymodeLint``) -- Autofix PEP8 errors (``:PymodeLintAuto``) -- Search in python documentation (``K``) -- Code refactoring (rope_) -- Strong code completion (rope_) -- Go to definition (``g`` for `:RopeGotoDefinition`) -- And more, more ... - - -=============================================================================== -2. Common functionality ~ - *pymode-common* - -This script provides the following options that can customizes the behavior of -python-mode. These options should be set in your |vimrc|. - -Find below the default values: - - -Turn on the whole plugin. *'g:pymode'* -> - let g:pymode = 1 - -Turn off plugin's warnings. *'g:pymode_warnings'* -> - let g:pymode_warnings = 1 - -Add paths to `sys.path` *'g:pymode_paths'* -Value is list of path's strings. -> - let g:pymode_paths = [] - -Trim unused white spaces on save. *'g:pymode_trim_whitespaces'* -> - let g:pymode_trim_whitespaces = 1 - -Setup default python options. *'g:pymode_options'* -> - let g:pymode_options = 1 - -If this option is set to 1, pymode will enable the following options for -python buffers: > - - setlocal complete+=t - setlocal formatoptions-=t - if v:version > 702 && !&relativenumber - setlocal number - endif - setlocal nowrap - setlocal textwidth=79 - setlocal commentstring=#%s - setlocal define=^\s*\\(def\\\\|class\\) - -Setup max line length *'g:pymode_options_max_line_length'* -> - let g:pymode_options_max_line_length = 79 - -Enable colorcolumn display at max_line_length. *'g:pymode_options_colorcolumn'* -> - let g:pymode_options_colorcolumn = 1 - -Setup pymode |quickfix| window. - - *'g:pymode_quickfix_maxheight'* *'g:pymode_quickfix_minheight'* -> - let g:pymode_quickfix_minheight = 3 - let g:pymode_quickfix_maxheight = 6 - -Set pymode |preview| window height. *'g:pymode_preview_height'* -Preview window is used to show documentation and ouput from |pymode-run|. -> - let g:pymode_preview_height = &previewheight - -Set where pymode |preview| window will appear. *'g:pymode_preview_position'* -> - let g:pymode_preview_position = 'botright' - -Value is command which can influcece where new window created by `:new` command -will appear, eg. `:botright`. - -------------------------------------------------------------------------------- -2.1. Python version ~ - *pymode-python-version* - -By default pymode will attempt to use Python 3, if available. However, you can -also disable all Python features of pymode. - - *'g:pymode_python'* -> - let g:pymode_python = 'python3' - -Values are `python3`, `disable`. If value set to `disable` most -python-features of **pymode** will be disabled. - -Set value to `python3` if you are working with python3 projects. You could use -|exrc| - -------------------------------------------------------------------------------- -2.2 Python indentation ~ - *pymode-indent* - -Pymode supports PEP8-compatible python indent. -Enable pymode indentation *'g:pymode_indent'* -> - let g:pymode_indent = 1 - - -Customization: - -Hanging indent size after an open parenthesis or bracket (but nothing after the -parenthesis), when vertical alignment is not used. Defaults to `&shiftwidth`. - *'g:pymode_indent_hanging_width'* -> - let g:pymode_indent_hanging_width = &shiftwidth - let g:pymode_indent_hanging_width = 4 - -------------------------------------------------------------------------------- -2.3 Python folding ~ - *pymode-folding* - -Enable pymode folding *'g:pymode_folding'* -> - let g:pymode_folding = 0 - -Currently folding is considered experimental. There are several issues with -its implementation. - -------------------------------------------------------------------------------- -2.4 Vim motion ~ - *pymode-motion* - -Support Vim motion (See |operator|) for python objects (such as functions, -class and methods). - -`C` — means class -`M` — means method or function - *pymode-motion-keys* - -==== ============================ -Key Command -==== ============================ -[[ Jump to previous class or function (normal, visual, operator modes) -]] Jump to next class or function (normal, visual, operator modes) -[M Jump to previous class or method (normal, visual, operator modes) -]M Jump to next class or method (normal, visual, operator modes) -aC Select a class. Ex: vaC, daC, yaC, caC (operator modes) -iC Select inner class. Ex: viC, diC, yiC, ciC (operator modes) -aM Select a function or method. Ex: vaM, daM, yaM, caM (operator modes) -iM Select inner function or method. Ex: viM, diM, yiM, ciM (operator modes) -V Select logical line. Ex: dV, yV, cV (operator modes), also works with count -==== ============================ - -Enable pymode-motion *'g:pymode_motion'* -> - let g:pymode_motion = 1 - -------------------------------------------------------------------------------- -2.5 Show documentation ~ - *pymode-documentation* - -Pymode could show documentation for current word by `pydoc`. - -Commands: -*:PymodeDoc* — show documentation - -Turns on the documentation script *'g:pymode_doc'* -> - let g:pymode_doc = 1 - -Bind keys to show documentation for current word (selection) - *'g:pymode_doc_bind'* -> - let g:pymode_doc_bind = 'K' - -------------------------------------------------------------------------------- -2.6 Support virtualenv ~ - *pymode-virtualenv* - -Commands: -*:PymodeVirtualenv* -- Activate virtualenv (path can be absolute or -relative to current working directory) - -Enable automatic virtualenv detection *'g:pymode_virtualenv'* -> - let g:pymode_virtualenv = 1 - -Set path to virtualenv manually *'g:pymode_virtualenv_path'* -> - let g:pymode_virtualenv_path = $VIRTUAL_ENV - -------------------------------------------------------------------------------- -2.7 Run code ~ - *pymode-run* - -Commands: -*:PymodeRun* -- Run current buffer or selection - -Turn on the run code script *'g:pymode_run'* -> - let g:pymode_run = 1 - -Binds keys to run python code *'g:pymode_run_bind'* -> - let g:pymode_run_bind = 'r' - -------------------------------------------------------------------------------- -2.8 Breakpoints ~ - *pymode-breakpoints* - -Pymode automatically detects available debugger (like pdb, ipdb, pudb) and user -can set/unset breakpoint with one key and without code checking and etc. - -Enable functionality *'g:pymode_breakpoint'* -> - let g:pymode_breakpoint = 1 - -Bind keys -> - let g:pymode_breakpoint_bind = 'b' - -Manually set breakpoint command (leave empty for automatic detection) -> - let g:pymode_breakpoint_cmd = '' - - -=============================================================================== -3. Code checking ~ - *pymode-lint* - -Pymode supports `pylint`, `pep257`, `pep8`, `pyflakes`, `mccabe` code -checkers. You could run several similar checkers. - - Pymode uses Pylama library for code checking. Many options like skip - files, errors and etc could be defined in `pylama.ini` file or modelines. - Check Pylama documentation for details. - - Pylint options (ex. disable messages) may be defined in `$HOME/pylint.rc` - See pylint documentation. - -Commands: -*:PymodeLint* -- Check code in current buffer -*:PymodeLintToggle* -- Toggle code checking -*:PymodeLintAuto* -- Fix PEP8 errors in current buffer automatically - -Turn on code checking *'g:pymode_lint'* -> - let g:pymode_lint = 1 - -Check code on every save (if file has been modified) *'g:pymode_lint_on_write'* -> - let g:pymode_lint_on_write = 1 - -Check code on every save (every) *'g:pymode_lint_unmodified'* -> - let g:pymode_lint_unmodified = 0 - -Check code when editing (on the fly) *'g:pymode_lint_on_fly'* -> - let g:pymode_lint_on_fly = 0 - -Show error message if cursor placed at the error line *'g:pymode_lint_message'* -> - let g:pymode_lint_message = 1 - -Default code checkers (you could set several) *'g:pymode_lint_checkers'* -> - let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe'] - -Values may be chosen from: `pylint`, `pep8`, `mccabe`, `pep257`, `pyflakes`. - -Skip errors and warnings *'g:pymode_lint_ignore'* -E.g. ["W", "E2"] (Skip all Warnings and the Errors starting with E2) etc. -> - let g:pymode_lint_ignore = ["E501", "W",] - -Select some error or warnings. *'g:pymode_lint_select'* -By example you disable all warnings starting from 'W', but want to see warning -'W0011' and warning 'W430' -> - let g:pymode_lint_select = ["E501", "W0011", "W430"] - -Sort errors by relevance *'g:pymode_lint_sort'* -If not empty, errors will be sort by defined relevance -E.g. let g:pymode_lint_sort = ['E', 'C', 'I'] " Errors first 'E', -after them 'C' and ... -> - let g:pymode_lint_sort = [] - -Auto open cwindow (quickfix) if any errors have been found - *'g:pymode_lint_cwindow'* -> - let g:pymode_lint_cwindow = 1 - -Place error |signs| *'g:pymode_signs'* -> - let g:pymode_lint_signs = 1 - -Definitions for |signs| -> - let g:pymode_lint_todo_symbol = 'WW' - let g:pymode_lint_comment_symbol = 'CC' - let g:pymode_lint_visual_symbol = 'RR' - let g:pymode_lint_error_symbol = 'EE' - let g:pymode_lint_info_symbol = 'II' - let g:pymode_lint_pyflakes_symbol = 'FF' - -------------------------------------------------------------------------------- -3.1 Set code checkers options ~ - *pymode-lint-options* - -Pymode has the ability to set code checkers options from pymode variables: - -Set PEP8 options *'g:pymode_lint_options_pep8'* -> - let g:pymode_lint_options_pep8 = - \ {'max_line_length': g:pymode_options_max_line_length} - -See https://pep8.readthedocs.org/en/1.4.6/intro.html#configuration for more -info. - -Set Pyflakes options *'g:pymode_lint_options_pyflakes'* -> - let g:pymode_lint_options_pyflakes = { 'builtins': '_' } - -Set mccabe options *'g:pymode_lint_options_mccabe'* -> - let g:pymode_lint_options_mccabe = { 'complexity': 12 } - -Set pep257 options *'g:pymode_lint_options_pep257'* -> - let g:pymode_lint_options_pep257 = {} - -Set pylint options *'g:pymode_lint_options_pylint'* -> - let g:pymode_lint_options_pylint = - \ {'max-line-length': g:pymode_options_max_line_length} - -See http://docs.pylint.org/features.html#options for more info. - - -=============================================================================== -4. Rope support ~ - *pymode-rope* - -Pymode supports Rope refactoring operations, code completion and code assists. - -Commands: -|:PymodeRopeAutoImport| -- Resolve import for element under cursor -|:PymodeRopeModuleToPackage| -- Convert current module to package -|:PymodeRopeNewProject| -- Open new Rope project in current working directory -|:PymodeRopeRedo| -- Redo changes from last refactoring -|:PymodeRopeRegenerate| -- Regenerate the project cache -|:PymodeRopeRenameModule| -- Rename current module -|:PymodeRopeUndo| -- Undo changes from last refactoring - - -Turn on the rope script *'g:pymode_rope'* -> - let g:pymode_rope = 1 - -Set the prefix for rope commands *'g:pymode_rope_prefix'* -> - let g:pymode_rope_refix = '' - -.ropeproject Folder ~ - *.ropeproject* - -*:PymodeRopeNewProject* [] -- Open new Rope project in the given path -*:PymodeRopeRegenerate* -- Regenerate the project cache - -Rope uses a folder inside projects for holding project configuration and data. -Its default name is `.ropeproject`. It is recommended that you do not add the -.ropeproject folder to version control system. - -Currently it is used for things such as: - -* The config.py file in this folder contains project configuration. Have - a look at the default config.py file (which is created when it - does not exist) for more information. -* It can be used for saving project history, so that the next time you open the - project you can undo past changes. -* It can be used to save information about object inferences. -* It can be used to save a global name cache, which is used for auto-import. - -By default, if `.ropeproject` is not found in the current directory, rope will -look recursively for it in parent folders. - -Warning: If rope finds `.ropeproject` in a parent dir, it will use it with -all its child directories, which may slow scanning down (because of many, -possibly unrelated, files) - -Enable searching for |.ropeproject| in parent directories - *'g:pymode_rope_lookup_project'* -> - let g:pymode_rope_lookup_project = 0 - -You can also manually set the rope project directory. If not specified rope will -use the current directory. - *'g:pymode_rope_project_root'* -> - let g:pymode_rope_project_root = "" - - -The location of the `.ropeproject` folder may also be overridden if you wish to -keep it outside of your project root. The rope library treats this folder as a -project resource, so the path will always be relative to your project root (a -leading '/' will be ignored). You may use `'..'` path segments to place the -folder outside of your project root. - *'g:pymode_rope_ropefolder'* -> - let g:pymode_rope_ropefolder='.ropeproject' - - -Show documentation for element under cursor ~ - -Show documentation for object under cursor. *'g:pymode_rope_show_doc_bind'* -Leave empty to disable the key binding. -> - let g:pymode_rope_show_doc_bind = 'd' - -Regenerate project cache on every save (if file has been modified) -> - let g:pymode_rope_regenerate_on_write = 1 - -------------------------------------------------------------------------------- -4.1 Completion ~ - *pymode-completion* - -By default you can use for autocompletion. The first entry will -be automatically selected and you can press to insert the entry in -your code. and / works too. - -Autocompletion is also called by typing a period in |Insert| mode by default. - -If there's only one complete item, vim may be inserting it automatically -instead of using a popup menu. If the complete item which inserted is not -your wanted, you can roll it back use '' in |Insert| mode or setup -'completeopt' with `menuone` and `noinsert` in your vimrc. .e.g. -> - set completeopt=menuone,noinsert - -Turn on code completion support in the plugin *'g:pymode_rope_completion'* -> - let g:pymode_rope_completion = 1 - -Turn on autocompletion when typing a period - *'g:pymode_rope_complete_on_dot'* -> - let g:pymode_rope_complete_on_dot = 1 - -Keymap for autocomplete *'g:pymode_rope_completion_bind'* -> - let g:pymode_rope_completion_bind = '' - -Extended autocompletion (rope could complete objects which have not been -imported) from project *'g:pymode_rope_autoimport'* -> - let g:pymode_rope_autoimport = 0 - -Load modules to autoimport by default *'g:pymode_rope_autoimport_modules'* -> - let g:pymode_rope_autoimport_modules = ['os', 'shutil', 'datetime'] - -Offer to unresolved import object after completion. -> - let g:pymode_rope_autoimport_import_after_complete = 0 - - -------------------------------------------------------------------------------- -4.2 Find definition ~ - *pymode-rope-findit* - -By default when you press *g* on any object in your code you will be moved -to definition. -Leave empty for disable key binding. *'g:pymode_rope_goto_definition_bind'* -> - let g:pymode_rope_goto_definition_bind = 'g' - -Command for open window when definition has been found -Values are (`e`, `new`, `vnew`) *'g:pymode_rope_goto_definition_cmd'* -> - let g:pymode_rope_goto_definition_cmd = 'new' - -------------------------------------------------------------------------------- -4.3 Refactoring ~ - *pymode-rope-refactoring* - -Rename method/function/class/variable in the project ~ - -Pymode can rename everything: classes, functions, modules, packages, methods, -variables and keyword arguments. - -Keymap for rename method/function/class/variables under cursor - *'g:pymode_rope_rename_bind'* -> - let g:pymode_rope_rename_bind = 'rr' - - -Rename a current module/package ~ - -*:PymodeRopeRenameModule* -- Rename current module - -Keymap for rename current module *'g:pymode_rope_rename_module_bind'* -> - let g:pymode_rope_rename_module_bind = 'r1r' - - -Imports ~ - -*:PymodeRopeAutoImport* -- Resolve import for element under cursor - -Organize imports sorts imports, too. It does that according to PEP8. Unused -imports will be dropped. -Keymap *'g:pymode_rope_organize_imports_bind'* -> - let g:pymode_rope_organize_imports_bind = 'ro' - -Insert import for current word under cursor *'g:pymode_rope_autoimport_bind'* -Should be enabled |'g:pymode_rope_autoimport'| -> - let g:pymode_rope_autoimport_bind = 'ra' - - -Convert module to package ~ - *'g:pymode_rope_module_to_package_bind'* - -*:PymodeRopeModuleToPackage* -- convert current module to package - -Keybinding: -> - let g:pymode_rope_module_to_package_bind = 'r1p' - - -Extract method/variable ~ - *pymode-rope-extract* - -Extract method/variable from selected lines. - - *'g:pymode_rope_extract_method_bind'* - *'g:pymode_rope_extract_variable_bind'* -> - let g:pymode_rope_extract_method_bind = 'rm' - let g:pymode_rope_extract_variable_bind = 'rl' - - -Use function ~ - *pymode-rope-use* - -It tries to find the places in which a function can be used and changes the -code to call it instead. -> - let g:pymode_rope_use_function_bind = 'ru' - - -Move method/fields ~ - *pymode-rope-move* - -It happens when you perform move refactoring on a method of a class. In this -refactoring, a method of a class is moved to the class of one of its -attributes. The old method will call the new method. If you want to change all -of the occurrences of the old method to use the new method you can inline it -afterwards. -> - let g:pymode_rope_move_bind = 'rv' - -Change function signature ~ -> - let g:pymode_rope_change_signature_bind = 'rs' - - -------------------------------------------------------------------------------- -4.4 Undo/Redo changes ~ - *pymode-rope-undo* - *pymode-rope-redo* - -Commands: - -*:PymodeRopeUndo* -- Undo last changes in the project -*:PymodeRopeRedo* -- Redo last changes in the project - - -=============================================================================== -5. Syntax ~ - *pymode-syntax* - -Turn on pymode syntax *'g:pymode_syntax'* -> - let g:pymode_syntax = 1 - -Slower syntax synchronization that is better at handling code blocks in -docstrings. Consider disabling this on slower hardware. - *'g:pymode_syntax_slow_sync'* -> - let g:pymode_syntax_slow_sync = 1 - -Enable all python highlights *'g:pymode_syntax_all'* -> - let g:pymode_syntax_all = 1 - -Highlight "print" as a function *'g:pymode_syntax_print_as_function'* -> - let g:pymode_syntax_print_as_function = 0 - -Highlight "async/await" keywords *'g:pymode_syntax_highlight_async_await'* -> - let g:pymode_syntax_highlight_async_await = g:pymode_syntax_all - -Highlight '=' operator *'g:pymode_syntax_highlight_equal_operator'* -> - let g:pymode_syntax_highlight_equal_operator = g:pymode_syntax_all - -Highlight ':=' operator *'g:pymode_syntax_highlight_walrus_operator'* -> - let g:pymode_syntax_highlight_walrus_operator = g:pymode_syntax_all - -Highlight '*' operator *'g:pymode_syntax_highlight_stars_operator'* -> - let g:pymode_syntax_highlight_stars_operator = g:pymode_syntax_all - -Highlight 'self' keyword *'g:pymode_syntax_highlight_self'* -> - let g:pymode_syntax_highlight_self = g:pymode_syntax_all - -Highlight indent's errors *'g:pymode_syntax_indent_errors'* -> - let g:pymode_syntax_indent_errors = g:pymode_syntax_all - -Highlight space's errors *'g:pymode_syntax_space_errors'* -> - let g:pymode_syntax_space_errors = g:pymode_syntax_all - -Highlight string formatting *'g:pymode_syntax_string_formatting'* - *'g:pymode_syntax_string_format'* - *'g:pymode_syntax_string_templates'* - *'g:pymode_syntax_doctests'* -> - let g:pymode_syntax_string_formatting = g:pymode_syntax_all - let g:pymode_syntax_string_format = g:pymode_syntax_all - let g:pymode_syntax_string_templates = g:pymode_syntax_all - let g:pymode_syntax_doctests = g:pymode_syntax_all - -Highlight builtin objects (True, False, ...) *'g:pymode_syntax_builtin_objs'* -> - let g:pymode_syntax_builtin_objs = g:pymode_syntax_all - -Highlight builtin types (str, list, ...) *'g:pymode_syntax_builtin_types'* -> - let g:pymode_syntax_builtin_types = g:pymode_syntax_all - -Highlight exceptions (TypeError, ValueError, ...) - *'g:pymode_syntax_highlight_exceptions'* -> - let g:pymode_syntax_highlight_exceptions = g:pymode_syntax_all - -Highlight docstrings as pythonDocstring (otherwise as pythonString) - *'g:pymode_syntax_docstrings'* -> - let g:pymode_syntax_docstrings = g:pymode_syntax_all - - -=============================================================================== -6. FAQ ~ - *pymode-faq* - -1. Python-mode doesn't work ---------------------------- - -First remember to get the latest and updated version of the project source -code and also update the project submodules. - -Clear all python cache/compiled files (`*.pyc` files and `__pycache__` -directory and everything under it). In Linux/Unix/MacOS you can run: - -`find . -type f -name '*.pyc' -delete && find . -type d -name '__pycache__' -delete` - -Then start python mode with: -`vim -i NONE -u /debugvimrc.vim` - -Reproduce the error and submit your python mode debug file. You can check its -location with `:messages` for something like: - -`pymode debug msg 1: Starting debug on: 2017-11-18 16:44:13 with file /tmp/pymode_debug_file.txt` - -Please submit the entire content of the file along with a reasoning of why the -plugin seems broken. - - *Underlined do check for sensitive information in the file before - *Underlined submitting! - - - -2. Rope completion is very slow *pymode-rope-slow* -------------------------------- - -Rope creates a project-level service directory in |.ropeproject| - -If ``.ropeproject`` is not found in the current directory, rope will walk -upwards looking for a ``.ropeproject`` in every dir of the parent path. If -rope finds ``.ropeproject`` in a parent dir, it sets the project for all child -dirs and the scan may be slow for so many dirs and files. - -Solutions: - -- Delete `.ropeproject` from the parent dir to make rope create `.ropeproject` - in the current dir. -- Run ``:PymodeRopeNewProject`` to make rope create ``.ropeproject`` in the - current dir. -- Set |'g:pymode_rope_lookup_project'| to 0 for prevent searching in parent - dirs. - -You may also set |'g:pymode_rope_project_root'| to manually specify the project -root path. - - -3. Pylint check is very slow ----------------------------- - -In some projects pylint may check slowly, because it also scans imported -modules if possible. Try using another code checker: see -|'g:pymode_lint_checkers'|. - -You may set |exrc| and |secure| in your |vimrc| to auto-set custom settings -from `.vimrc` from your projects directories. - -4. OSX cannot import urandom ----------------------------- - -See: https://groups.google.com/forum/?fromgroups=#!topic/vim_dev/2NXKF6kDONo - -The sequence of commands that fixed this: -> - brew unlink python - brew unlink macvim - brew remove macvim - brew install -v --force macvim - brew link macvim - brew link python - -5. Folding is slow ------------------- - -Python mode adds folding for definitions and multi line docstrings. These may -be costly to compute on large files. To disable them one simple has to to add: - - let g:pymode_folding = 1 - -to their vimrc file. - -Beware that when editing python files in multiple windows vim computes the -folding for every typed character. Thus it may be useful to define: - - augroup unset_folding_in_insert_mode - autocmd! - autocmd InsertEnter *.py setlocal foldmethod=marker - autocmd InsertLeave *.py setlocal foldmethod=expr - augroup END - -=============================================================================== -7. Development~ - *pymode-development* - -This section briefly defines development guidelines for python-mode. - -1. This help file uses vim's conventions defined at |help-writing|. -2. The name of the plugin shall be referred to as 'python-mode' throughout -documentation (except as a first word in a sentence in which case is -'Python-mode'). -3. All defined functions should use vim's conventions and start with 'Pymode'. -4. Special marks for project development are `XXX` and `TODO`. They provide a -easy way for developers to check pending issues. -5. If submitting a pull request then a test should be added which smartly -covers the found bug/new feature. Check out the `tests/test.sh` (1) file and -other executed files. -A suggested structure is the following: add your test to -`tests/test_bash` (2) and a vim script to be sourced at -`tests/test_procedures_vimscript` (3). Try to make use of the already existing -files at `tests/test_python_sample_code` (4). File (1) should be trigger the -newly added file (2). This latter file should invoke vim which in turn sources -file (3). File (3) may then read (4) as a first part of its assertion -structure and then execute the remaning of the instructions/assertions. - -=============================================================================== -8. Credits ~ - *pymode-credits* - Kirill Klenov - http://klen.github.com/ - http://github.com/klen/ - - Rope - Copyright (C) 2006-2010 Ali Gholami Rudi - Copyright (C) 2009-2010 Anton Gritsay - - Pylint - Copyright (C) 2003-2011 LOGILAB S.A. (Paris, FRANCE). - http://www.logilab.fr/ - - Pyflakes: - Copyright (c) 2005-2011 Divmod, Inc. - Copyright (c) 2013-2014 Florent Xicluna - https://github.com/PyCQA/pyflakes - - PEP8: - Copyright (c) 2006 Johann C. Rocholl - http://github.com/jcrocholl/pep8 - - autopep8: - Copyright (c) 2012 hhatto - https://github.com/hhatto/autopep8 - - Python syntax for vim: - Copyright (c) 2010 Dmitry Vasiliev - http://www.hlabs.spb.ru/vim/python.vim - - PEP8 VIM indentation - Copyright (c) 2012 Hynek Schlawack - http://github.com/hynek/vim-python-pep8-indent - - -=============================================================================== -9. License ~ - *pymode-license* - -Python-mode is released under the GNU lesser general public license. -See: http://www.gnu.org/copyleft/lesser.html - -If you like this plugin, I would very appreciated if you kindly send me a -postcard :) - -My address is: "Russia, 143500, MO, Istra, pos. Severny 8-3" to "Kirill -Klenov". Thanks for your support! - - -------------------------------------------------------------------------------- - - vim:tw=79:ts=8:ft=help:norl: diff --git a/readme.md b/readme.md index 49b30ea9..374ba2b2 100644 --- a/readme.md +++ b/readme.md @@ -1,272 +1,31 @@ -[![Testing python-mode](https://github.com/python-mode/python-mode/workflows/Testing%20python-mode/badge.svg?branch=develop)](https://github.com/python-mode/python-mode/actions?query=workflow%3A%22Testing+python-mode%22+branch%3Adevelop) - ![](https://raw.github.com/python-mode/python-mode/develop/logo.png) -# Python-mode, a Python IDE for Vim - -------------------------------------------------------------------------------- - -*This project needs contributors.* - -**Documentation:** -- ``:help pymode`` -- - -------------------------------------------------------------------------------- - -

- -

- -***Important notes***: - - * From 2017-11-19 onwards python-mode uses submodules instead of - hard coding 3rd party libraries into its codebase. Please issue the command: - `git submodule update --init --recursive` inside your python-mode folder. - - * From 2019-12-14 onwards `python-mode` **dropped python2 support**. If you - still need to use it with python2 you should look for the `last-py2-support` - branch and/or tag. - -If you are a new user please clone the repos using the recursive flag: +# vim-python-mode-indent -> git clone --recurse-submodules https://github.com/python-mode/python-mode - -------------------------------------------------------------------------------- - -Python-mode is a Vim plugin that magically converts Vim into a Python IDE. - -Why Python-mode? - -1. **Be more productive**: Pymode saves time by bringing all the tools - necessary for professional developers so that you can focus on bigger - things. It has been finely tuned based on decades of experience working - with Vim and is constantly kept up to date. -2. **Get smart assistance**: Pymode knows all about your code. We use the - best-in-class intellisense code completion, on-the-fly error checking and - quick-fixes; easy project navigation and much more. -3. **Use the full power and capabilities of Vim**: Unlike traditional IDEs - which can only provide a small subset of Vim functionalities, you can do - everything and anything that you can in Vim. -4. **Modular structure**: We attempt to create Python-mode with the same - principles of python: i.e. have a modular structure, so that as and when - better libraries evolve, we can provide you the best experience, while - abstracting the details so that you can get back to what you do best. -5. **Written mostly in Python**: 96.1% written in Python. Well, we love Python - :) - -The plugin contains all you need to develop python applications in Vim. - -* Support Python and 3.6+ -* Syntax highlighting -* Virtualenv support -* Run python code (`r`) -* Add/remove breakpoints (`b`) -* Improved Python indentation -* Python motions and operators (`]]`, `3[[`, `]]M`, `vaC`, `viM`, - `daC`, `ciM`, ...) -* Improved Python folding -* Run multiple code checkers simultaneously (`:PymodeLint`) -* Autofix PEP8 errors (`:PymodeLintAuto`) -* Search in python documentation (`K`) -* Code refactoring -* Intellisense code-completion -* Go to definition (`g`) -* And more, more ... - -See a screencast here: . - -Another old presentation here: . - -**To read python-mode documentation in Vim, use** `:help pymode`. +The Vim plugin will improved your Python indentation (extracted from python-mode). # Requirements -Vim >= 7.3 (most features needed +python3 support) (also -`--with-features=big` if you want `g:pymode_lint_signs`). +Vim >= 7.3 # How to install ## Manually (according to vim's package structure) -As of vim8 there is an officially supported way of adding plugins. See `:tab +As of Vim 8 there is an officially supported way of adding plugins. See `:tab help packages` in vim for details. - cd ~/.vim/pack/python-mode/start - git clone --recurse-submodules https://github.com/python-mode/python-mode.git - cd python-mode - -Note. Windows OS users need to add `-c core.symlinks=true`. See below. - -## pathogen - - cd ~/.vim - mkdir -p bundle && cd bundle - git clone --recurse-submodules https://github.com/python-mode/python-mode.git - - -Enable [pathogen](https://github.com/tpope/vim-pathogen) in your `~/.vimrc`: - - " Pathogen load - filetype off - - call pathogen#infect() - call pathogen#helptags() - - filetype plugin indent on - syntax on - -## vim-plug - -Include the following in the [vim-plug](https://github.com/junegunn/vim-plug) -section of your `~/.vimrc`: - - Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' } - -## NeoBundle - -Add the following: - - " python-mode: PyLint, Rope, Pydoc, breakpoints from box. - " https://github.com/python-mode/python-mode - NeoBundleLazy 'python-mode/python-mode', { 'on_ft': 'python' } - -## Manually - - % git clone --recurse-submodules https://github.com/python-mode/python-mode.git - % cd python-mode - % cp -R * ~/.vim - -Then rebuild **helptags** in vim: - - :helptags ~/.vim/doc/ - -**filetype-plugin** (`:help filetype-plugin-on`) and **filetype-indent** -(`:help filetype-indent-on`) must be enabled to use python-mode. - -# Troubleshooting/Debugging + cd ~/.vim/pack/python-mode-indent/start + git clone https://github.com/jamescherti/python-mode-indent.git + cd python-mode-indent -First read our short -[FAQ](https://github.com/python-mode/python-mode/blob/develop/doc/pymode.txt) -or using `:help pymode-faq`. -If your question is not described there then you already know what to do -(because you read the first item of our FAQ :) ). +### Installation with a third-party plugin manager -Nevertheless just a refresher on how to submit bugs: - -**(From the FAQ)** - -Clear all python cache/compiled files (`*.pyc` files and `__pycache__` -directory and everything under it) from your _python-mode_ install directory. - -In Linux/Unix/MacOS you can run: - -`find -type f -iname '*.pyc' -o -iname '*.pyo' -delete && find . -type d -name '__pycache__' -delete` - -Then start python mode with: - -`vim -i NONE -u /debugvimrc.vim` - -Reproduce the error and submit your python mode debug file. You can check its -location with `:messages` for something like: - -> pymode debug msg 1: Starting debug on: 2017-11-18 16:44:13 with file /tmp/pymode_debug_file.txt - -Please submit the entire content of the file along with a reasoning of why the -plugin seems broken. - -***Do check for sensitive information in the file before submitting.*** - -Please, also provide more contextual information such as: - -* your Operational System (Linux, WIndows, Mac) and which version -* the `vim --version` output -* which is your default python (`python --version`) -* the python version that vim has loaded in your tests: - * `:PymodePython import sys; print(sys.version_info)` output. -* and if you are using virtualenvs and/or conda, also state that, please. -* It would be good also to provide the output of the two following commands: -* `git status` (under your _python-mode_ directory) -* `tree ` or something similar (such as `ls -lR`) - -# Frequent problems - -Read this section before opening an issue on the tracker. - -## Python 2/3 vim support - -Vim [has issues](https://github.com/vim/vim/issues/3585) to work with both -python2 and python3 at the same time, so if your VIM is compiled with support -to both version you may find problems. The best way to handle it is to build -your vim again with only python3 support. -[Here](https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source) -is a good reference on how to build vim from source. - -## Python 3 syntax - -`python-mode` supports only python3, so, if you are using python2 we cannot -help you that much. Look for our branch with python2-support (old version, -not maintained anymore) (`last-py2-support`). - -## Symlinks on Windows - -Users on Windows OS might need to add `-c core.symlinks=true` switch to -correctly clone / pull repository. Example: `git clone --recurse-submodules -https://github.com/python-mode/python-mode -c core.symlinks=true` - -## Error updating the plugin - -If you are trying to update the plugin (using a plugin manager or manually) and -you are seeing an error such as: - -> Server does not allow request for unadvertised object - -Then we probably changed some repo reference or some of our dependencies had a -`git push --force` in its git history. So the best way for you to handle it is -to run, inside the `python-mode` directory: - -* `git submodule update --recursive --init --force` -* `git submodule sync --recursive` - -# Documentation - -Documentation is available in your vim `:help pymode`. - -# Bugtracker - -If you have any suggestions, bug reports or annoyances please report them to -the issue tracker at: - - -# Contributing - -The contributing guidelines for this plugin are outlined at -`:help pymode-development`. - -* Author: Kirill Klenov () -* Maintainers: - * Felipe Vieira () - * Diego Rabatone Oliveira () - -Also see the AUTHORS file. - -Development of python-mode happens at github: - - -Please make a pull request to development branch and add yourself to AUTHORS. - -### Python libraries - -Vendored Python modules are located mostly in -[pymode/libs/](https://github.com/python-mode/python-mode/tree/develop/pymode/libs). +You can also install this Vim plugin with any third-party plugin manager such as Pathogen or Vundle. # Copyright -Copyright © 2013-2015 Kirill Klenov (). +Copyright © 2013-2021 Kirill Klenov, Daniel Hahler, Jacob Niehus, Jongwook Choi. # License -Licensed under a [GNU lesser general public license](). - -If you like this plugin, I would very appreciated if you kindly send me -a postcard :) My address is here: "Russia, 143500, MO, Istra, pos. Severny 8-3" -to "Kirill Klenov". **Thanks for support!** +Licensed under a GNU lesser general public license. From a5c8e6f4a3ad5a4d04fda990958aef7cbd69ac53 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 14:41:48 -0500 Subject: [PATCH 03/14] Rename variables and functions. --- CHANGELOG.md | 411 ------------------------------------- after/indent/python.vim | 2 +- autoload/pymode/indent.vim | 2 +- 3 files changed, 2 insertions(+), 413 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 001a9194..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,411 +0,0 @@ -# Changelog - -## TODO - -- Move changelog rst syntax to markdown -- `pymode_rope`: check disables -- Remove supoort for python 2. From 0.11.0 on we will focus on supporting - python 3+ (probably 3.5+). -- Inspect why files starting with the following code do not get loaded: - - ```python - def main(): - pass - - if __name__ == '__main__': - main() - ``` - -## 2019-05-11 0.10.0 - -After many changes, including moving most of our dependencies from copied -source code to submodules, and lot's of problems maintaining Python 2 and -Python 3 support, this (0.10.x) is the last version of python-mode that will -support Python 2. Some patches may be done in order to fix issues related to -Python 2 or some backward compatible changes that can be applied. - -## 2017-07-xxx 0.9.5 - -- pylama: migrated to submodule - -## 2017-07-11 0.9.4 - -- pylama: fixed erratic behavior of skip option causing unintended - skipping of lint checkers - -- PEP257 requires `snowbalstemmer`: added as submodule - -- Fixed handling of `g:pymode_lint_ignore` and `g:pymode_lint_select`: from - strings to list - -- Migrated modules from pymode/libs to - [submodules/](https://github.com/fmv1992/python-mode/tree/develop/submodules) - - - Rationale: no need to single handedly update each module; - removes burden from developers - -- Improved folding accuracy - - - Improved nested definitions folding - - Improved block delimiting - -## (changelog poorly maintained) 0.8.2 - -- Pylama updated to version 5.0.5 -- Rope libs updated -- Add wdb to debugger list in breakpoint cmd -- Add `pymode_options_max_line_length` option -- Add ability to set related checker options `:help pymode-lint-options` - Options added: `pymode_lint_options_pep8`, `pymode_lint_options_pep257`, - `pymode_lint_options_mccabe`, `pymode_lint_options_pyflakes`, - `pymode_lint_options_pylint` -- Highlight comments inside class/function arg lists -- Don't fold single line def -- Don't skip a line when the first docstring contains text -- Add Python documentation vertical display option -- Rope: correct refactoring function calls - -## 2014-06-11 0.8.1 - -- Pylama updated to version 3.3.2 - -- Get fold's expression symbol from &fillchars; - -- Fixed error when setting `g:pymode_breakpoint_cmd` (expobrain); - -- Fixed code running; - -- Ability to override rope project root and .ropeproject folder - -- Added path argument to PymodeRopeNewProject which skips prompt - -- Disable `pymode_rope_lookup_project` by default - -- Options added: - - `pymode_rope_project_root`, `pymode_rope_ropefolder` - -## 2013-12-04 0.7.8b - -- Update indentation support; - -- Python3 support; - -- Removed pymode modeline support; - -- Disabled async code checking support; - -- Options changes: - - `pymode_doc_key` -> `pymode_doc_bind` - - `pymode_run_key` -> `pymode_run_bind` - - `pymode_breakpoint_key` -> `pymode_breakpoint_bind` - - `pymode_breakpoint_template` -> `pymode_breakpoint_cmd` - - `pymode_lint_write` -> `pymode_lint_on_write` - - `pymode_lint_onfly` -> `pymode_lint_on_fly` - - `pymode_lint_checker` -> `pymode_lint_checkers` - - `pymode_lint_minheight` -> `pymode_quickfix_minheight` - - `pymode_lint_maxheight` -> `pymode_quickfix_maxheight` - - `pymode_rope_autocomplete_map` -> `pymode_rope_completion_bind` - - `pymode_rope_enable_autoimport` -> `pymode_rope_autoimport` - -- Options removed: - - - `pymode_lint_hold`, `pymode_lint_config`, `pymode_lint_jump`, - `pymode_lint_signs_always_visible`, `pymode_rope_extended_complete`, - `pymode_rope_auto_project`, `pymode_rope_autoimport_generate`, - `pymode_rope_autoimport_underlines`, `pymode_rope_codeassist_maxfixes`, - `pymode_rope_sorted_completions`, `pymode_rope_extended_complete`, - `pymode_rope_confirm_saving`, `pymode_rope_global_prefix`, - `pymode_rope_local_prefix`, `pymode_rope_vim_completion`, - `pymode_rope_guess_project`, `pymode_rope_goto_def_newwin`, - `pymode_rope_always_show_complete_menu` - -- Options added: - - - `pymode_rope_regenerate_on_write`, `pymode_rope_completion`, - `pymode_rope_complete_on_dot`, `pymode_lint_sort`, - `pymode_rope_lookup_project`, `pymode_lint_unmodified` - -- Commands added: - - - `PymodeVirtualenv` - -- Commands changed: - - - `PyDoc` -> `PymodeDoc` - - `Pyrun` -> `PymodeRun` - - `PyLintToggle` -> `PymodeLintToggle` - - `PyLint` -> `PymodeLint` - - `PyLintAuto` -> `PymodeLintAuto` - - `RopeOpenProject` -> `PymodeRopeNewProject` - - `RopeUndo` -> `PymodeRopeUndo` - - `RopeRedo` -> `PymodeRopeRedo` - - `RopeRenameCurrentModule` -> `PymodeRopeRenameModule` - - `RopeModuleToPackage` -> `PymodeRopeModuleToPackage` - - `RopeGenerateAutoimportCache` -> `PymodeRopeRegenerate` - - `RopeOrgamizeImports` -> `PymodeRopeAutoImport` - -- Commands removed: - - `PyLintCheckerToggle`, `RopeCloseProject`, `RopeProjectConfig`, - `RopeRename`, `RopeCreate<...>`, `RopeWriteProject`, `RopeRename`, - `RopeExtractVariable`, `RopeExtractMethod`, `RopeInline`, `RopeMove`, - `RopeRestructure`, `RopeUseFunction`, `RopeIntroduceFactory`, - `RopeChangeSignature`, `RopeMoveCurrentModule`, `RopeGenerate<...>`, - `RopeAnalizeModule`, `RopeAutoImport` - -## 2013-10-29 0.6.19 - -- Added `g:pymode_rope_autocomplete_map` option; -- Removed `g:pymode_rope_map_space` option; -- Added PEP257 checker; -- Support 'pudb' in breakpoints; -- Pyrun can now operate on a range of lines, and does not need to save - (c) lawrenceakka -- Update pylama to version 1.5.0 -- Add a set of `g:pymode_lint_*_symbol` options (c) kdeldycke; -- Support virtualenv for python3 (c) mlmoses; - -## 2013-05-15 0.6.18 - -- Fixed autopep8 (PyLintAuto) command; -- Fix error on non-ascii characters in docstrings; -- Update python syntax; - -## 2013-05-03 0.6.17 - -- Update Pylint to version 0.28.0; -- Update pyflakes to version 0.7.3; -- Fixed lint\_ignore options bug; -- Fixed encoding problems when code running; - -## 2013-04-26 0.6.16 - -- Improvement folding (thanks @alvinfrancis); - -## 2013-04-01 0.6.15 - -- Bugfix release - -## 2013-03-16 0.6.14 - -- Update PEP8 to version 1.4.5; -- Update Pylint to version 0.27.0; -- Update pyflakes to version 0.6.1; -- Update autopep8 to version 0.8.7; -- Fix breakpoint definition; -- Update python syntax; -- Fixed run-time error when output non-ascii in multibyte locale; -- Move initialization into ftplugin as it is python specific; -- Pyrex (Cython) files support; -- Support raw\_input in run python code; - -## 2012-09-07 0.6.10 - -- Dont raise an exception when Logger has no message handler (c) nixon -- Improve performance of white space removal (c) Dave Smith -- Improve ropemode support (c) s0undt3ch -- Add `g:pymode_updatetime` option -- Update autopep8 to version 0.8.1 - -## 2012-09-07 0.6.9 - -- Update autopep8 -- Improve `pymode#troubleshooting#Test()` - -## 2012-09-06 0.6.8 - -- Add PEP8 indentation `:help pymode_indent` - -## 2012-08-15 0.6.7 - -- Fix documentation. Thanks (c) bgrant; -- Fix pymode "async queue" support. - -## 2012-08-02 0.6.6 - -- Updated Pep8 to version 1.3.3 -- Updated Pylint to version 0.25.2 -- Fixed virtualenv support for windows users -- Added pymode modeline `:help PythonModeModeline` -- Added diagnostic tool `:call pymode#troubleshooting#Test()` -- Added PyLintAuto command `:help PyLintAuto` -- Code checking is async operation now -- More, more fast the pymode folding -- Repaired execution of python code - -## 2012-05-24 0.6.4 - -- Add `pymode_paths` option -- Rope updated to version 0.9.4 - -## 2012-04-18 0.6.3 - -- Fix pydocs integration - -## 2012-04-10 0.6.2 - -- Fix `pymode_run` for "unnamed" clipboard -- Add `pymode_lint_mccabe_complexity` option -- Update Pep8 to version 1.0.1 -- Warning! Change `pymode_rope_goto_def_newwin` option for open "goto - definition" in new window, set it to 'new' or 'vnew' for horizontally or - vertically split If you use default behaviour (in the same buffer), not - changes needed. - -## 2012-03-13 0.6.0 - -- Add `pymode_lint_hold` option -- Improve pymode loading speed -- Add pep8, mccabe lint checkers -- Now `g:pymode_lint_checker` can have many values Ex. "pep8,pyflakes,mccabe" -- Add `pymode_lint_ignore` and `pymode_lint_select` options -- Fix rope keys -- Fix python motion in visual mode -- Add folding `pymode_folding` -- Warning: `pymode_lint_checker` now set to 'pyflakes,pep8,mccabe' by default - -## 2012-02-12 0.5.8 - -- Fix pylint for Windows users -- Python documentation search running from Vim (delete `g:pydoc` option) -- Python code execution running from Vim (delete `g:python` option) - -## 2012-02-11 0.5.7 - -- Fix `g:pymode_lint_message` mode error -- Fix breakpoints -- Fix python paths and virtualenv detection - -## 2012-02-06 0.5.6 - -- Fix `g:pymode_syntax` option -- Show error message in bottom part of screen see `g:pymode_lint_message` -- Fix pylint for windows users -- Fix breakpoint command (Use pdb when idpb not installed) - -## 2012-01-17 0.5.5 - -- Add a sign for info messages from pylint. (c) Fredrik Henrysson -- Change motion keys: vic - viC, dam - daM and etc -- Add `g:pymode_lint_onfly` option - -## 2012-01-09 0.5.3 - -- Prevent the configuration from breaking python-mode (c) Dirk Wallenstein - -## 2012-01-08 0.5.2 - -- Fix ropeomnicompletion -- Add preview documentation - -## 2012-01-06 0.5.1 - -- Happy new year! -- Objects and motion fixes - -## 2011-11-30 0.5.0 - -- Add python objects and motions (beta) `:h pymode_motion` - -## 2011-11-27 0.4.8 - -- Add PyLintWindowToggle command -- Fix some bugs - -## 2011-11-23 0.4.6 - -- Enable all syntax highlighting For old settings set in your vimrc: - - ``` - let g:pymode_syntax_builtin_objs = 0 - let g:pymode_syntax_builtin_funcs = 0 - ``` - -- Change namespace of syntax variables See README - -## 2011-11-18 0.4.5 - -- Add `g:pymode_syntax` option -- Highlight 'self' keyword - -## 2011-11-16 0.4.4 - -- Minor fixes - -## 2011-11-11 0.4.3 - -- Fix pyflakes - -## 2011-11-09 0.4.2 - -- Add FAQ -- Some refactoring and fixes - -## 2011-11-08 0.4.0 - -- Add alternative code checker "pyflakes" See `:h pymode_lint_checker` -- Update install docs - -## 2011-10-30 0.3.3 - -- Fix RopeShowDoc - -## 2011-10-28 0.3.2 - -- Add `g:pymode_options_*` stuff, for ability to disable default pymode options - for python buffers - -## 2011-10-27 0.3.1 - -- Add `g:pymode_rope_always_show_complete_menu` option -- Some pylint fixes - -## 2011-10-25 0.3.0 - -- Add `g:pymode_lint_minheight` and `g:pymode_lint_maxheight` options -- Fix PyLintToggle -- Fix Rope and PyLint libs loading - -## 2011-10-21 0.2.12 - -- Auto open cwindow with results on rope find operations - -## 2011-10-20 0.2.11 - -- Add `pymode_lint_jump` option - -## 2011-10-19 0.2.10 - -- Minor fixes (virtualenv loading, buffer commands) - -## 2011-10-18 0.2.6 - -- Add `` shortcut for macvim users. -- Add VIRTUALENV support - -## 2011-10-17 0.2.4 - -- Add current work path to sys.path -- Add `g:pymode` option (disable/enable pylint and rope) -- Fix pylint copyright -- Hotfix rope autocomplete - -## 2011-10-15 0.2.1 - -- Change rope variables (`ropevim_` -> `pymode_rope_`) -- Add `pymode_rope_auto_project` option (default: 1) -- Update and fix docs -- `pymode_rope_extended_complete` set by default -- Auto generate rope project and cache -- `r a` for RopeAutoImport - -## 2011-10-12 0.1.4 - -- Add default pylint configuration - -## 2011-10-12 0.1.3 - -- Fix pylint and update docs - -## 2011-10-11 0.1.2 - -- First public release diff --git a/after/indent/python.vim b/after/indent/python.vim index 98399b40..4ca4e54e 100644 --- a/after/indent/python.vim +++ b/after/indent/python.vim @@ -9,5 +9,5 @@ setlocal shiftwidth=4 setlocal shiftround setlocal expandtab setlocal autoindent -setlocal indentexpr=pymode#indent#get_indent(v:lnum) +setlocal indentexpr=python_mode_indent#get_indent(v:lnum) setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except diff --git a/autoload/pymode/indent.vim b/autoload/pymode/indent.vim index e964f378..0f174353 100644 --- a/autoload/pymode/indent.vim +++ b/autoload/pymode/indent.vim @@ -7,7 +7,7 @@ " License: Public Domain -function! pymode#indent#get_indent(lnum) +function! python_mode_indent#get_indent(lnum) " First line has indent 0 if a:lnum == 1 From a6f5f49337c049f5fd4c6019847a63c45a745a66 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 14:44:25 -0500 Subject: [PATCH 04/14] Fixed: undefined variable g:pymode_indent_hanging_width. --- autoload/pymode/indent.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoload/pymode/indent.vim b/autoload/pymode/indent.vim index 0f174353..7f938fa8 100644 --- a/autoload/pymode/indent.vim +++ b/autoload/pymode/indent.vim @@ -24,8 +24,10 @@ function! python_mode_indent#get_indent(lnum) if closing_paren return indent(parlnum) else - let l:indent_width = (g:pymode_indent_hanging_width > 0 ? - \ g:pymode_indent_hanging_width : &shiftwidth) + let l:indent_width = get(g:, 'pymode_indent_hanging_width', -1) + if l:indent_width <= 0 + let l:indent_width = &shiftwidth + endif return indent(parlnum) + l:indent_width endif else From f8cc88745f6044784ef70ef6cff5191b33aab76b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 15:00:46 -0500 Subject: [PATCH 05/14] Improved readme.md and AUTHORS. after/indent/python.vim does not require g:pymode and g:pymode_indent anymore. --- AUTHORS | 12 ++++-------- after/indent/python.vim | 4 ---- readme.md | 10 +++------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/AUTHORS b/AUTHORS index 70ccc091..5489e6e4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,13 +1,11 @@ -Author: +vim-pythonmodeindent authors: * Kirill Klenov +* Daniel Hahler (http://github.com/blueyed); +* James Cherti (https://github.com/jamescherti); -Maintainers: - +Other contributors (python-mode): * Diego Rabatone Oliveira (https://github.com/diraol); - -Contributors: - * Alvin Francis (http://github.com/alvinfrancis); * Amir Eldor (https://github.com/amireldor); * Andriy Kohut (https://github.com/andriykohut); @@ -22,7 +20,6 @@ Contributors: * Brad Mease (http://github.com/bmease); * Brendan Maguire (https://github.com/brendanmaguire); * Bryce Guinta (https://github.com/brycepg); -* Daniel Hahler (http://github.com/blueyed); * David Vogt (http://github.com/winged); * Denis Kasak (http://github.com/dkasak); * Dimitrios Semitsoglou-Tsiapos (https://github.com/dset0x); @@ -76,4 +73,3 @@ Contributors: * Xiangyu Xu (https://github.com/bkbncn); * Zach Himsel (https://github.com/zhimsel); * Nathan Pemberton (https://github.com/NathanTP); -* James Cherti (https://github.com/jamescherti); diff --git a/after/indent/python.vim b/after/indent/python.vim index 4ca4e54e..5b678e46 100644 --- a/after/indent/python.vim +++ b/after/indent/python.vim @@ -1,7 +1,3 @@ -if !g:pymode || !g:pymode_indent - finish -endif - setlocal nolisp setlocal tabstop=4 setlocal softtabstop=4 diff --git a/readme.md b/readme.md index 374ba2b2..8cd1bf2b 100644 --- a/readme.md +++ b/readme.md @@ -9,23 +9,19 @@ Vim >= 7.3 # How to install -## Manually (according to vim's package structure) +### Installation with Vim's built-in package manager (Vim 8 and above) As of Vim 8 there is an officially supported way of adding plugins. See `:tab help packages` in vim for details. cd ~/.vim/pack/python-mode-indent/start - git clone https://github.com/jamescherti/python-mode-indent.git - cd python-mode-indent + git clone https://github.com/jamescherti/vim-pythonmodeindent.git + cd vim-pythonmodeindent ### Installation with a third-party plugin manager You can also install this Vim plugin with any third-party plugin manager such as Pathogen or Vundle. -# Copyright - -Copyright © 2013-2021 Kirill Klenov, Daniel Hahler, Jacob Niehus, Jongwook Choi. - # License Licensed under a GNU lesser general public license. From fb33518aa1698e1e7139384f28a2d0ec2a70b9c7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 15:01:43 -0500 Subject: [PATCH 06/14] Author added to "./AUTHORS". --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 5489e6e4..0df5a5f7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,6 +2,7 @@ vim-pythonmodeindent authors: * Kirill Klenov * Daniel Hahler (http://github.com/blueyed); +* Arun Mahapatra * James Cherti (https://github.com/jamescherti); Other contributors (python-mode): From 8a3da1dbeaac25be6024b35f1da56ee440a96546 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 15:03:45 -0500 Subject: [PATCH 07/14] README. --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 8cd1bf2b..59519f70 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ ![](https://raw.github.com/python-mode/python-mode/develop/logo.png) # vim-python-mode-indent -The Vim plugin will improved your Python indentation (extracted from python-mode). +The Vim plugin will improved your Python indentation (based on python-mode indent plugin). # Requirements From e0677e48307e4aaf5dde07d5868dd2921f05ff2a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 15:23:14 -0500 Subject: [PATCH 08/14] ftplugin/ removed. --- ftplugin/pyrex.vim | 1 - 1 file changed, 1 deletion(-) delete mode 100644 ftplugin/pyrex.vim diff --git a/ftplugin/pyrex.vim b/ftplugin/pyrex.vim deleted file mode 100644 index 93e0556d..00000000 --- a/ftplugin/pyrex.vim +++ /dev/null @@ -1 +0,0 @@ -runtime ftplugin/python/pymode.vim From f32c144488b4c531640508a74e4efe3943d1b0a6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 16:13:51 -0500 Subject: [PATCH 09/14] readme.md updated. --- readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 59519f70..4b0cf99b 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,5 @@ ![](https://raw.github.com/python-mode/python-mode/develop/logo.png) -# vim-python-mode-indent +# vim-pythonmodeindent The Vim plugin will improved your Python indentation (based on python-mode indent plugin). @@ -14,7 +14,8 @@ Vim >= 7.3 As of Vim 8 there is an officially supported way of adding plugins. See `:tab help packages` in vim for details. - cd ~/.vim/pack/python-mode-indent/start + mkdir -p ~/.vim/pack/jamescherti/start + cd ~/.vim/pack/jamescherti/start git clone https://github.com/jamescherti/vim-pythonmodeindent.git cd vim-pythonmodeindent From 6ad4832cb19db6e80585b65ea9591d673cca464a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 12 Mar 2022 16:16:41 -0500 Subject: [PATCH 10/14] Logo added. --- logo.png | Bin 0 -> 16429 bytes readme.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 logo.png diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..b873f5cbeecd98729f2c9759dc43f975640fdf70 GIT binary patch literal 16429 zcmb`ubyOY8wmynO&|twOxVt;S-QC?~;j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*TPp^`uB(aSb5NA+6L zQHoI|@}!T66vf-T5soT_jf2#`U(_0{^qT;ozsov=j0jRIgT*DIG<&7+!+45gP06wv zJ1f~-zF_2dC&BUMnN2rhK9)2z56Dy+@XA~dT5$I|r!Cr%pL@utgv3YM)j);UAz2&V z*lC4H6~}YDHTjXD4VeaaH+y{0{MA%*yPxcL9E@&^_2cHF>1LXIGok-)N+063zD=@9 z$kIe`;Q|E%Pq-ucFYe$KLUt(kgcf7F9}U5ww^(D=RMM`zC8kS;smLwiE2d*#{>x=R zB~8GIZtw*Jy~K?Xe%Q}8oGmi0g;Avl7d=)kv7(N0Wi8iaZ^FwNj8^0!4$1I!VOW_-xVP3H=-PQ6VN!2d?!8)8DK(Slcp@- Date: Sat, 12 Mar 2022 16:26:21 -0500 Subject: [PATCH 11/14] Documentation added: 'doc/pythonmodeindent.txt'. --- doc/pythonmodeindent.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc/pythonmodeindent.txt diff --git a/doc/pythonmodeindent.txt b/doc/pythonmodeindent.txt new file mode 100644 index 00000000..f9267c5b --- /dev/null +++ b/doc/pythonmodeindent.txt @@ -0,0 +1,30 @@ +*pythonmodeindent.txt* For Vim Version 8.0 + + ____ _ _ ____ _ _ _____ _ _ __ __ _____ ____ ____ ~ + ( _ \( \/ )(_ _)( )_( )( _ )( \( )___( \/ )( _ )( _ \( ___) ~ + )___/ \ / )( ) _ ( )(_)( ) ((___)) ( )(_)( )(_) ))__) ~ + (__) (__) (__) (_) (_)(_____)(_)\_) (_/\/\_)(_____)(____/(____) ~ + PYTHONMODEINDENT + + +=============================================================================== +CONTENTS *pythonmodeindent-contents* + +1. Common functionality................................|pythonmodeindent-common| + 1.1 Python indentation.............................|pythonmodeindent-indent| + +=============================================================================== +1. Common functionality ~ + *pythonmodeindent-common* + +------------------------------------------------------------------------------- +1.1 Python indentation ~ + *pythonmodeindent-indent* + + *'g:pythonmodeindent_indent_hanging_width'* + +Customize hanging indent size different than &shiftwidth. + +> + let g:pythonmodeindent_indent_hanging_width = &shiftwidth + let g:pythonmodeindent_indent_hanging_width = 4 From fa73658da7edc7268108e38210cb990fc64cbe4e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 18 Mar 2022 11:57:56 -0400 Subject: [PATCH 12/14] Rename main indent function. --- after/indent/python.vim | 2 +- autoload/{pymode/indent.vim => pythonmodeindent.vim} | 2 +- plugin/pythonmodeindent.vim | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) rename autoload/{pymode/indent.vim => pythonmodeindent.vim} (99%) create mode 100644 plugin/pythonmodeindent.vim diff --git a/after/indent/python.vim b/after/indent/python.vim index 5b678e46..e91cbbf7 100644 --- a/after/indent/python.vim +++ b/after/indent/python.vim @@ -5,5 +5,5 @@ setlocal shiftwidth=4 setlocal shiftround setlocal expandtab setlocal autoindent -setlocal indentexpr=python_mode_indent#get_indent(v:lnum) +setlocal indentexpr=pythonmodeindent#get_indent(v:lnum) setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except diff --git a/autoload/pymode/indent.vim b/autoload/pythonmodeindent.vim similarity index 99% rename from autoload/pymode/indent.vim rename to autoload/pythonmodeindent.vim index 7f938fa8..007728ae 100644 --- a/autoload/pymode/indent.vim +++ b/autoload/pythonmodeindent.vim @@ -7,7 +7,7 @@ " License: Public Domain -function! python_mode_indent#get_indent(lnum) +function! pythonmodeindent#get_indent(lnum) " First line has indent 0 if a:lnum == 1 diff --git a/plugin/pythonmodeindent.vim b/plugin/pythonmodeindent.vim new file mode 100644 index 00000000..22d2bd1d --- /dev/null +++ b/plugin/pythonmodeindent.vim @@ -0,0 +1,6 @@ +if exists("loaded_pythonmodeindent") + finish +endif +let g:loaded_pythonmodeindent = 1 + +let g:pymode_indent_hanging_width = get(g:, 'pymode_indent_hanging_width', -1) From bcb933294d558ec46c14940cbaf7f49680c3f97b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 25 Dec 2022 18:13:12 -0500 Subject: [PATCH 13/14] Remove .gitmodules --- .gitmodules | 59 ----------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 59d00541..00000000 --- a/.gitmodules +++ /dev/null @@ -1,59 +0,0 @@ -[submodule "submodules/autopep8"] - path = submodules/autopep8 - url = https://github.com/hhatto/autopep8 - ignore = dirty - shallow = true -[submodule "submodules/pycodestyle"] - path = submodules/pycodestyle - url = https://github.com/PyCQA/pycodestyle - ignore = dirty - shallow = true -[submodule "submodules/pydocstyle"] - path = submodules/pydocstyle - url = https://github.com/PyCQA/pydocstyle - ignore = dirty - shallow = true -[submodule "submodules/mccabe"] - path = submodules/mccabe - url = https://github.com/PyCQA/mccabe - ignore = dirty - shallow = true -[submodule "submodules/pyflakes"] - path = submodules/pyflakes - url = https://github.com/PyCQA/pyflakes - ignore = dirty - shallow = true -[submodule "submodules/snowball_py"] - path = submodules/snowball_py - url = https://github.com/diraol/snowball_py - ignore = dirty - branch = develop - shallow = true -[submodule "submodules/pylint"] - path = submodules/pylint - url = https://github.com/PyCQA/pylint - shallow = true -[submodule "submodules/rope"] - path = submodules/rope - url = https://github.com/python-rope/rope - shallow = true -[submodule "submodules/astroid"] - path = submodules/astroid - url = https://github.com/PyCQA/astroid - shallow = true -[submodule "submodules/pylama"] - path = submodules/pylama - url = https://github.com/klen/pylama - shallow = true -[submodule "submodules/toml"] - path = submodules/toml - url = https://github.com/uiri/toml.git -[submodule "submodules/pytoolconfig"] - path = submodules/pytoolconfig - url = https://github.com/bagel897/pytoolconfig.git -[submodule "submodules/tomli"] - path = submodules/tomli - url = https://github.com/hukkin/tomli.git -[submodule "submodules/appdirs"] - path = submodules/appdirs - url = https://github.com/ActiveState/appdirs.git From 7f5aee238861abbcc337c6044f65217ebadd0220 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 25 Dec 2022 21:57:23 -0500 Subject: [PATCH 14/14] Remove ./submodules/ and .pymode/ --- pymode/libs/appdirs.py | 1 - pymode/libs/pytoolconfig | 1 - pymode/libs/tomli | 1 - submodules/appdirs | 1 - submodules/pytoolconfig | 1 - submodules/tomli | 1 - 6 files changed, 6 deletions(-) delete mode 120000 pymode/libs/appdirs.py delete mode 120000 pymode/libs/pytoolconfig delete mode 120000 pymode/libs/tomli delete mode 160000 submodules/appdirs delete mode 160000 submodules/pytoolconfig delete mode 160000 submodules/tomli diff --git a/pymode/libs/appdirs.py b/pymode/libs/appdirs.py deleted file mode 120000 index da7cbf20..00000000 --- a/pymode/libs/appdirs.py +++ /dev/null @@ -1 +0,0 @@ -../../submodules/appdirs/appdirs.py \ No newline at end of file diff --git a/pymode/libs/pytoolconfig b/pymode/libs/pytoolconfig deleted file mode 120000 index 0a2d520c..00000000 --- a/pymode/libs/pytoolconfig +++ /dev/null @@ -1 +0,0 @@ -../../submodules/pytoolconfig/pytoolconfig/ \ No newline at end of file diff --git a/pymode/libs/tomli b/pymode/libs/tomli deleted file mode 120000 index 2413e2b5..00000000 --- a/pymode/libs/tomli +++ /dev/null @@ -1 +0,0 @@ -../../submodules/tomli/src/tomli \ No newline at end of file diff --git a/submodules/appdirs b/submodules/appdirs deleted file mode 160000 index 193a2cbb..00000000 --- a/submodules/appdirs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 193a2cbba58cce2542882fcedd0e49f6763672ed diff --git a/submodules/pytoolconfig b/submodules/pytoolconfig deleted file mode 160000 index 549787fa..00000000 --- a/submodules/pytoolconfig +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 549787fa7d100c93333f48aaa9b07619f171736e diff --git a/submodules/tomli b/submodules/tomli deleted file mode 160000 index 7e563eed..00000000 --- a/submodules/tomli +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7e563eed5286b5d46b8290a9f56a86d955b23a9a