Skip to content

Commit 1234d71

Browse files
author
vim-IDE
committed
Merge branch 'develop' of https://github.com/klen/python-mode into develop
2 parents fdef905 + 2ad7970 commit 1234d71

Some content is hidden

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

71 files changed

+1382
-862
lines changed

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Contributors:
1616
* Daniel Hahler (http://github.com/blueyed)
1717
* David Vogt (http://github.com/winged);
1818
* Denis Kasak (http://github.com/dkasak);
19+
* Dimitrios Semitsoglou-Tsiapos (https://github.com/dset0x)
1920
* Dirk Wallenstein (http://github.com/dirkwallenstein);
2021
* Florent Xicluna (http://github.com/florentx);
2122
* Fredrik Henrysson (http://github.com/fhenrysson);
@@ -40,6 +41,7 @@ Contributors:
4041
* Sorin Ionescu (sorin-ionescu);
4142
* Steve Losh (http://github.com/sjl);
4243
* Tommy Allen (https://github.com/tweekmonster)
44+
* Tyler Fenby (https://github.com/TFenby)
4345
* Wayne Ye (https://github.com/WayneYe)
4446
* bendavis78 (http://github.com/bendavis78)
4547
* fwuzju (http://github.com/fwuzju)

Changelog.rst

Lines changed: 2 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

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

pymode/libs2/rope/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""rope, a python refactoring library"""
22

33
INFO = __doc__
4-
VERSION = '0.9.4'
4+
VERSION = '0.10.2'
55
COPYRIGHT = """\
66
Copyright (C) 2006-2012 Ali Gholami Rudi
77
Copyright (C) 2009-2012 Anton Gritsay

pymode/libs2/rope/base/arguments.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def get_pynames(self, parameters):
7272

7373
def get_instance_pyname(self):
7474
return self.pynames[0]
75+
76+
7577
class MixedArguments(object):
7678

7779
def __init__(self, pyname, arguments, scope):

pymode/libs2/rope/base/builtins.py

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ def _get_builtin(*args):
149149
return cls._generated[args]
150150
return _get_builtin
151151

152+
152153
def _create_builtin_getter(cls):
153154
type_getter = _create_builtin_type_getter(cls)
155+
154156
def _get_builtin(*args):
155157
return pyobjects.PyObject(type_getter(*args))
156158
return _get_builtin
@@ -233,7 +235,7 @@ def __call__(self, name, returned=None, function=None,
233235
except AttributeError:
234236
if check_existence:
235237
raise
236-
builtin=None
238+
builtin = None
237239
self.attributes[name] = BuiltinName(
238240
BuiltinFunction(returned=returned, function=function,
239241
argnames=argnames, builtin=builtin))
@@ -252,7 +254,8 @@ def __init__(self, holding=None):
252254
collector('__new__', function=self._new_list)
253255

254256
# Adding methods
255-
collector('append', function=self._list_add, argnames=['self', 'value'])
257+
collector('append', function=self._list_add,
258+
argnames=['self', 'value'])
256259
collector('__setitem__', function=self._list_add,
257260
argnames=['self', 'index', 'value'])
258261
collector('insert', function=self._list_add,
@@ -306,7 +309,6 @@ class Dict(BuiltinClass):
306309
def __init__(self, keys=None, values=None):
307310
self.keys = keys
308311
self.values = values
309-
item = get_tuple(self.keys, self.values)
310312
collector = _AttributeCollector(dict)
311313
collector('__new__', function=self._new_dict)
312314
collector('__setitem__', function=self._dict_add)
@@ -327,7 +329,8 @@ def do_create(holding=None):
327329
if holding is None:
328330
return get_dict()
329331
type = holding.get_type()
330-
if isinstance(type, Tuple) and len(type.get_holding_objects()) == 2:
332+
if isinstance(type, Tuple) and \
333+
len(type.get_holding_objects()) == 2:
331334
return get_dict(*type.get_holding_objects())
332335
return _create_builtin(args, do_create)
333336

@@ -384,7 +387,7 @@ def _self_set(self, context):
384387
if new_dict and isinstance(new_dict.get_object().get_type(), Dict):
385388
args = arguments.ObjectArguments([new_dict])
386389
items = new_dict.get_object()['popitem'].\
387-
get_object().get_returned_object(args)
390+
get_object().get_returned_object(args)
388391
context.save_per_name(items)
389392
else:
390393
holding = _infer_sequence_for_pyname(new_dict)
@@ -405,7 +408,8 @@ def __init__(self, *objects):
405408
first = objects[0]
406409
attributes = {
407410
'__getitem__': BuiltinName(BuiltinFunction(first)),
408-
'__getslice__': BuiltinName(BuiltinFunction(pyobjects.PyObject(self))),
411+
'__getslice__':
412+
BuiltinName(BuiltinFunction(pyobjects.PyObject(self))),
409413
'__new__': BuiltinName(BuiltinFunction(function=self._new_tuple)),
410414
'__iter__': BuiltinName(BuiltinFunction(get_iterator(first)))}
411415
super(Tuple, self).__init__(tuple, attributes)
@@ -485,8 +489,9 @@ def __init__(self):
485489

486490
self_methods = ['__getitem__', '__getslice__', 'capitalize', 'center',
487491
'decode', 'encode', 'expandtabs', 'join', 'ljust',
488-
'lower', 'lstrip', 'replace', 'rjust', 'rstrip', 'strip',
489-
'swapcase', 'title', 'translate', 'upper', 'zfill']
492+
'lower', 'lstrip', 'replace', 'rjust', 'rstrip',
493+
'strip', 'swapcase', 'title', 'translate', 'upper',
494+
'zfill']
490495
for method in self_methods:
491496
collector(method, self_object)
492497

@@ -514,6 +519,7 @@ def get_object(self):
514519
def get_definition_location(self):
515520
return (None, None)
516521

522+
517523
class Iterator(pyobjects.AbstractClass):
518524

519525
def __init__(self, holding=None):
@@ -539,7 +545,8 @@ def __init__(self, holding=None):
539545
self.holding = holding
540546
self.attributes = {
541547
'next': BuiltinName(BuiltinFunction(self.holding)),
542-
'__iter__': BuiltinName(BuiltinFunction(get_iterator(self.holding))),
548+
'__iter__': BuiltinName(BuiltinFunction(
549+
get_iterator(self.holding))),
543550
'close': BuiltinName(BuiltinFunction()),
544551
'send': BuiltinName(BuiltinFunction()),
545552
'throw': BuiltinName(BuiltinFunction())}
@@ -556,10 +563,10 @@ def get_returned_object(self, args):
556563
class File(BuiltinClass):
557564

558565
def __init__(self):
559-
self_object = pyobjects.PyObject(self)
560566
str_object = get_str()
561567
str_list = get_list(get_str())
562568
attributes = {}
569+
563570
def add(name, returned=None, function=None):
564571
builtin = getattr(file, name, None)
565572
attributes[name] = BuiltinName(
@@ -587,7 +594,8 @@ def __init__(self, fget=None, fset=None, fdel=None, fdoc=None):
587594
'fget': BuiltinName(BuiltinFunction()),
588595
'fset': BuiltinName(pynames.UnboundName()),
589596
'fdel': BuiltinName(pynames.UnboundName()),
590-
'__new__': BuiltinName(BuiltinFunction(function=_property_function))}
597+
'__new__': BuiltinName(
598+
BuiltinFunction(function=_property_function))}
591599
super(Property, self).__init__(property, attributes)
592600

593601
def get_property_object(self, args):
@@ -631,7 +639,7 @@ def get_attributes(self):
631639
return {}
632640

633641
def get_name(self):
634-
return 'lambda'
642+
return 'lambda'
635643

636644
def get_param_names(self, special_args=True):
637645
result = [node.id for node in self.arguments.args
@@ -671,7 +679,7 @@ def _infer_sequence_for_pyname(pyname):
671679
iter = obj.get_returned_object(args)
672680
if iter is not None and 'next' in iter:
673681
holding = iter['next'].get_object().\
674-
get_returned_object(args)
682+
get_returned_object(args)
675683
return holding
676684

677685

@@ -690,12 +698,15 @@ def _create_builtin(args, creator):
690698
def _range_function(args):
691699
return get_list()
692700

701+
693702
def _reversed_function(args):
694703
return _create_builtin(args, get_iterator)
695704

705+
696706
def _sorted_function(args):
697707
return _create_builtin(args, get_list)
698708

709+
699710
def _super_function(args):
700711
passed_class, passed_self = args.get_arguments(['type', 'self'])
701712
if passed_self is None:
@@ -709,6 +720,7 @@ def _super_function(args):
709720
return pyobjects.PyObject(supers[0])
710721
return passed_self
711722

723+
712724
def _zip_function(args):
713725
args = args.get_pynames(['sequence'])
714726
objects = []
@@ -721,6 +733,7 @@ def _zip_function(args):
721733
tuple = get_tuple(*objects)
722734
return get_list(tuple)
723735

736+
724737
def _enumerate_function(args):
725738
passed = args.get_pynames(['sequence'])[0]
726739
if passed is None:
@@ -730,6 +743,7 @@ def _enumerate_function(args):
730743
tuple = get_tuple(None, holding)
731744
return get_iterator(tuple)
732745

746+
733747
def _iter_function(args):
734748
passed = args.get_pynames(['sequence'])[0]
735749
if passed is None:
@@ -738,6 +752,7 @@ def _iter_function(args):
738752
holding = _infer_sequence_for_pyname(passed)
739753
return get_iterator(holding)
740754

755+
741756
def _input_function(args):
742757
return get_str()
743758

@@ -751,17 +766,25 @@ def _input_function(args):
751766
'file': BuiltinName(get_file_type()),
752767
'open': BuiltinName(get_file_type()),
753768
'unicode': BuiltinName(get_str_type()),
754-
'range': BuiltinName(BuiltinFunction(function=_range_function, builtin=range)),
755-
'reversed': BuiltinName(BuiltinFunction(function=_reversed_function, builtin=reversed)),
756-
'sorted': BuiltinName(BuiltinFunction(function=_sorted_function, builtin=sorted)),
757-
'super': BuiltinName(BuiltinFunction(function=_super_function, builtin=super)),
758-
'property': BuiltinName(BuiltinFunction(function=_property_function, builtin=property)),
769+
'range': BuiltinName(BuiltinFunction(function=_range_function,
770+
builtin=range)),
771+
'reversed': BuiltinName(BuiltinFunction(function=_reversed_function,
772+
builtin=reversed)),
773+
'sorted': BuiltinName(BuiltinFunction(function=_sorted_function,
774+
builtin=sorted)),
775+
'super': BuiltinName(BuiltinFunction(function=_super_function,
776+
builtin=super)),
777+
'property': BuiltinName(BuiltinFunction(function=_property_function,
778+
builtin=property)),
759779
'zip': BuiltinName(BuiltinFunction(function=_zip_function, builtin=zip)),
760-
'enumerate': BuiltinName(BuiltinFunction(function=_enumerate_function, builtin=enumerate)),
780+
'enumerate': BuiltinName(BuiltinFunction(function=_enumerate_function,
781+
builtin=enumerate)),
761782
'object': BuiltinName(BuiltinObject()),
762783
'type': BuiltinName(BuiltinType()),
763-
'iter': BuiltinName(BuiltinFunction(function=_iter_function, builtin=iter)),
764-
'raw_input': BuiltinName(BuiltinFunction(function=_input_function, builtin=raw_input)),
765-
}
784+
'iter': BuiltinName(BuiltinFunction(function=_iter_function,
785+
builtin=iter)),
786+
'raw_input': BuiltinName(BuiltinFunction(function=_input_function,
787+
builtin=raw_input)),
788+
}
766789

767790
builtins = BuiltinModule('__builtin__', initial=_initial_builtins)

0 commit comments

Comments
 (0)