Skip to content

Commit 08ec591

Browse files
committed
Update Rope
1 parent e9bd734 commit 08ec591

File tree

10 files changed

+36
-28
lines changed

10 files changed

+36
-28
lines changed

AUTHORS

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ Contributors:
4040
* Sorin Ionescu (sorin-ionescu);
4141
* Steve Losh (http://github.com/sjl);
4242
* Tommy Allen (https://github.com/tweekmonster)
43+
* Tyler Fenby (https://github.com/TFenby)
4344
* Wayne Ye (https://github.com/WayneYe)
4445
* bendavis78 (http://github.com/bendavis78)
4546
* fwuzju (http://github.com/fwuzju)
4647
* lawrenceakka;
4748
* lee (loyalpartner);
4849
* nixon;
4950
* tramchamploo;
50-
* Tyler Fenby (https://github.com/TFenby)

Changelog.rst

+2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ Changelog
22
=========
33

44
* Pylama updated to version 5.0.5
5+
* Rope libs updated
56
* Add 'pymode_options_max_line_length' option
67
* Add ability to set related checker options `:help pymode-lint-options`
78
Options added: 'pymode_lint_options_pep8', 'pymode_lint_options_pep257',
89
'pymode_lint_options_mccabe', 'pymode_lint_options_pyflakes',
910
'pymode_lint_options_pylint'
1011

12+
1113
## 2014-06-11 0.8.1
1214
-------------------
1315
* Pylama updated to version 3.3.2

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ pylama:
2626
make $(PYLAMA)
2727
make $(PYLAMA)/lint/pylama_pylint
2828

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

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ License
187187

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

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

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

doc/pymode.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ Keymap for autocomplete *'g:pymode_rope_completion_bind'*
482482
Extended autocompletion (rope could complete objects which have not been
483483
imported) from project *'g:pymode_rope_autoimport'*
484484
>
485-
let g:pymode_rope_autoimport = 1
485+
let g:pymode_rope_autoimport = 0
486486
487487
Load modules to autoimport by default *'g:pymode_rope_autoimport_modules'*
488488
>
@@ -781,10 +781,10 @@ The sequence of commands that fixed this:
781781
Python-mode is released under the GNU lesser general public license.
782782
See: http://www.gnu.org/copyleft/lesser.html
783783

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

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

789789

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

plugin/pymode.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ call pymode#default('g:pymode_rope_completion', 1)
183183

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

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

pylama.ini

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

pymode/libs2/rope/base/default_config.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ def set_prefs(prefs):
1313
# '.svn': matches 'pkg/.svn' and all of its children
1414
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
1515
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
16-
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
17-
'.hg', '.svn', '_svn', '.git', '.tox']
16+
prefs['ignored_resources'] = [
17+
'*.pyc', '*~', '.ropeproject', '.hg', '.svn', '_svn', '.git',
18+
'.tox', '.env', 'node_modules', 'bower_components']
1819

1920
# Specifies which files should be considered python files. It is
2021
# useful when you have scripts inside your project. Only files

pymode/libs3/rope/base/default_config.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def set_prefs(prefs):
1313
# '.svn': matches 'pkg/.svn' and all of its children
1414
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
1515
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
16-
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
17-
'.hg', '.svn', '_svn', '.git',
18-
'__pycache__']
16+
prefs['ignored_resources'] = [
17+
'*.pyc', '*~', '.ropeproject', '.hg', '.svn', '_svn', '.git',
18+
'__pycache__', '.tox', '.env', 'node_modules', 'bower_components']
1919

2020
# Specifies which files should be considered python files. It is
2121
# useful when you have scripts inside your project. Only files

pymode/rope.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
""" Rope support in pymode. """
22
from __future__ import absolute_import, print_function
33

4-
import multiprocessing
54
import os.path
65
import re
76
import site
@@ -13,7 +12,6 @@
1312
from rope.contrib import autoimport as rope_autoimport, codeassist, findit, generate # noqa
1413
from rope.refactor import ModuleToPackage, ImportOrganizer, rename, extract, inline, usefunction, move, change_signature, importutils # noqa
1514

16-
from ._compat import StringIO
1715
from .environment import env
1816

1917

@@ -352,8 +350,7 @@ def __init__(self, path, project_path):
352350
""" Init Rope context. """
353351
self.path = path
354352

355-
self.project = project.Project(
356-
project_path, fscommands=FileSystemCommands())
353+
self.project = project.Project(project_path, fscommands=FileSystemCommands())
357354

358355
self.importer = rope_autoimport.AutoImport(
359356
project=self.project, observe=False)
@@ -462,8 +459,8 @@ def run(self):
462459

463460
action = env.user_input_choices(
464461
'Choose what to do:', 'perform', 'preview',
465-
'perform in class hierarchy',
466-
'preview in class hierarchy')
462+
'perform in class hierarchy',
463+
'preview in class hierarchy')
467464

468465
in_hierarchy = action.endswith("in class hierarchy")
469466

@@ -512,7 +509,7 @@ def get_changes(refactor, input_str, in_hierarchy=False):
512509
"""
513510
progress = ProgressHandler('Calculate changes ...')
514511
return refactor.get_changes(
515-
input_str, task_handle=progress.handle, in_hierarchy = in_hierarchy)
512+
input_str, task_handle=progress.handle, in_hierarchy=in_hierarchy)
516513

517514

518515
class RenameRefactoring(Refactoring):
@@ -746,13 +743,12 @@ def get_refactor(ctx):
746743
return change_signature.ChangeSignature(
747744
ctx.project, ctx.resource, offset)
748745

749-
def get_changes(self, refactor, input_string):
746+
def get_changes(self, refactor, input_string, in_hierarchy=False):
750747
""" Function description.
751748
752749
:return Rope.changes:
753750
754751
"""
755-
756752
args = re.sub(r'[\s\(\)]+', '', input_string).split(',')
757753
olds = [arg[0] for arg in refactor.get_args()]
758754

@@ -793,7 +789,7 @@ def get_refactor(self, ctx):
793789
return generate.create_generate(
794790
self.kind, ctx.project, ctx.resource, offset)
795791

796-
def get_changes(self, refactor, input_str):
792+
def get_changes(self, refactor, input_str, in_hierarchy=False):
797793
""" Function description.
798794
799795
:return Rope.changes:
@@ -938,5 +934,3 @@ def _insert_import(name, module, ctx):
938934
progress = ProgressHandler('Apply changes ...')
939935
ctx.project.do(changes, task_handle=progress.handle)
940936
reload_changes(changes)
941-
942-
# pylama:ignore=W1401,E1120,D

0 commit comments

Comments
 (0)