Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8cfbb9c

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
2 parentsa8dcbc8 +f7ccee5 commit8cfbb9c

File tree

163 files changed

+1101
-17199
lines changed

Some content is hidden

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

163 files changed

+1101
-17199
lines changed

‎.bumpversion.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[bumpversion]
2+
commit = True
3+
current_version = 0.9.0
4+
files = plugin/pymode.vim
5+
tag = True
6+
tag_name = {new_version}
7+
8+
[bumpversion:file:doc/pymode.txt]
9+
search = Version: {current_version}
10+
replace = Version: {new_version}
11+

‎.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ rvm:
44
-1.9.3
55
script:
66
-make travis
7-

‎AUTHORS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Maintainer:
1+
Maintainers:
22

33
* Kirill Klenov <horneds@gmail.com>
4+
* Bryce Guinta (https://github.com/brycepg)
45

56

67
Contributors:
@@ -31,6 +32,7 @@ Contributors:
3132
* Lawrence Akka (https://github.com/lawrenceakka);
3233
* Lowe Thiderman (http://github.com/thiderman);
3334
* Martin Brochhaus (http://github.com/mbrochh);
35+
* Matt Dodge (https://github.com/mattdodge);
3436
* Matthew Moses (http://github.com/mlmoses);
3537
* Maxim (https://github.com/mpyatishev);
3638
* Mel Boyce (http://github.com/syngin);

‎Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,31 @@ clean:
88
rm -rf$(CURDIR)/build
99
rm -rf*.deb
1010

11+
VERSION?=minor
12+
# target: release - Bump version
13+
release:
14+
git fetch origin
15+
git checkout master
16+
git rebase
17+
git merge develop
18+
bumpversion$(VERSION)
19+
git checkout develop
20+
git rebase
21+
git merge master
22+
git push origin develop master
23+
git push --tags
24+
25+
.PHONY: minor
26+
minor: release
27+
28+
.PHONY: patch
29+
patch:
30+
make release VERSION=patch
31+
32+
.PHONY: major
33+
major:
34+
make release VERSION=major
35+
1136
# Temporary disable rope tests on Travis
1237
.PHONY: travis
1338
travis:

‎README.rst

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
-----
88

9-
*The project needsmaintainers andcontributors*
9+
*The project needs contributors*
1010

11-
Actually, I have no time for support the project, so if you feel yourself as
12-
strong don't be hesitate to contact me.
11+
** Python-mode Slack Channel is here: https://python-mode.herokuapp.com/ **
1312

1413
-----
1514

@@ -164,6 +163,22 @@ You can override the default key bindings by redefining them in your `.vimrc`, f
164163
let g:pymode_doc_bind = "<C-S-d>"
165164

166165

166+
Frequent Problems
167+
=================
168+
169+
Read this section before opening an issue on the tracker.
170+
171+
Python 3 Syntax
172+
---------------
173+
174+
By default python-mode uses python 2 syntax checking. To enable python 3
175+
syntax checking (e.g. for async) add::
176+
177+
let g:pymode_python = 'python3'
178+
179+
To your vimrc or exrc file
180+
181+
167182
Documentation
168183
=============
169184

@@ -181,7 +196,10 @@ at https://github.com/klen/python-mode/issues
181196
Contributing
182197
============
183198

184-
See the `AUTHORS` file.
199+
* Kirill Klenov (horneds@gmail.com)
200+
* Bryce Guinta (https://github.com/brycepg)
201+
202+
Also see the `AUTHORS` file.
185203

186204
Development of python-mode happens at github:
187205
https://github.com/klen/python-mode

‎autoload/pymode/breakpoint.vim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ fun! pymode#breakpoint#operate(lnum) "{{{
3535
normal dd
3636
else
3737
let plnum=prevnonblank(a:lnum)
38-
callappend(line('.')-1,repeat('',indent(plnum)).g:pymode_breakpoint_cmd)
38+
if &expandtab
39+
let indents=repeat('',indent(plnum))
40+
else
41+
let indents=repeat("\t", plnum / &shiftwidth)
42+
endif
43+
44+
callappend(line('.')-1, indents.g:pymode_breakpoint_cmd)
3945
normalk
4046
endif
4147

‎autoload/pymode/virtualenv.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fun! pymode#virtualenv#init() "{{{
1111

1212
endfunction"}}}
1313

14-
fun!pymode#virtualenv#activate(relpath)"{{{
15-
letg:pymode_virtualenv_path=getcwd() .'/' .a:relpath
14+
fun!pymode#virtualenv#activate(path)"{{{
15+
letg:pymode_virtualenv_path=a:path
1616
callpymode#virtualenv#init()
1717
endfunction"}}}

‎doc/pymode.txt

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

88

9-
Version: 0.8.1
9+
Version: 0.9.0
1010

1111
==============================================================================
1212
CONTENTS*pymode-contents*
@@ -212,8 +212,8 @@ Bind keys to show documentation for current word (selection)
212212
*pymode-virtualenv*
213213

214214
Commands:
215-
*:PymodeVirtualenv*<path> -- Activate virtualenv (pathis related to
216-
current working directory)
215+
*:PymodeVirtualenv*<path> -- Activate virtualenv (pathcan be absolute or
216+
relative tocurrent working directory)
217217

218218
Enable automatic virtualenv detection*'g:pymode_virtualenv'*
219219
>
@@ -486,7 +486,7 @@ imported) from project *'g:pymode_rope_autoimport'*
486486
487487
Load modules to autoimport by default*'g:pymode_rope_autoimport_modules'*
488488
>
489-
let g:pymode_rope_autoimport_modules = ['os', 'shutil', 'datetime'])
489+
let g:pymode_rope_autoimport_modules = ['os', 'shutil', 'datetime']
490490
491491
Offer to unresolved import object after completion.
492492
>

‎plugin/pymode.vim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ call pymode#default("g:pymode_folding_nest_limit", 1000)
4141
" Change for folding customization (by example enable fold for 'if', 'for')
4242
callpymode#default("g:pymode_folding_regex",'^\s*\%(class\|def\|async\s\+def\) .\+\(:\s\+\w\)\@!')
4343

44-
4544
" Enable/disable python motion operators
4645
callpymode#default("g:pymode_motion",1)
4746

‎pylama.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ linters=pep8,pyflakes,pylint
55
skip=1
66

77
[pylama:pylint]
8-
disable=E1120,E1130,E1103,W1401
8+
disable=E1120,E1130,E1103,W1401,F0001

‎pymode/libs2/rope/__init__.pyrenamed to‎pymode/libs/rope/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""rope, a python refactoring library"""
22

33
INFO=__doc__
4-
VERSION='0.10.2'
4+
VERSION='0.10.3'
55
COPYRIGHT="""\
6+
Copyright (C) 2014-2015 Matej Cepl
67
Copyright (C) 2006-2012 Ali Gholami Rudi
78
Copyright (C) 2009-2012 Anton Gritsay
89
File renamed without changes.

‎pymode/libs2/rope/base/ast.pyrenamed to‎pymode/libs/rope/base/ast.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,23 @@
33

44
fromrope.baseimportfscommands
55

6+
try:
7+
unicode
8+
exceptNameError:
9+
unicode=str
10+
611

712
defparse(source,filename='<string>'):
813
# NOTE: the raw string should be given to `compile` function
914
ifisinstance(source,unicode):
1015
source=fscommands.unicode_to_file_data(source)
11-
if'\r'insource:
12-
source=source.replace('\r\n','\n').replace('\r','\n')
13-
ifnotsource.endswith('\n'):
14-
source+='\n'
16+
ifb'\r'insource:
17+
source=source.replace(b'\r\n',b'\n').replace(b'\r',b'\n')
18+
ifnotsource.endswith(b'\n'):
19+
source+=b'\n'
1520
try:
1621
returncompile(source,filename,'exec',_ast.PyCF_ONLY_AST)
17-
except (TypeError,ValueError),e:
22+
except (TypeError,ValueError)ase:
1823
error=SyntaxError()
1924
error.lineno=1
2025
error.filename=filename

‎pymode/libs3/rope/base/astutils.pyrenamed to‎pymode/libs/rope/base/astutils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def _added(self, node, levels):
4040
def_Name(self,node):
4141
self._add_node(node)
4242

43+
def_ExceptHandler(self,node):
44+
self.names.append((node.name, []))
45+
4346
def_Tuple(self,node):
4447
new_levels= []
4548
ifself.levelsisnotNone:

‎pymode/libs2/rope/base/builtins.pyrenamed to‎pymode/libs/rope/base/builtins.py

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
"""This module trys to support builtin types and functions."""
22
importinspect
3+
try:
4+
raw_input
5+
exceptNameError:
6+
raw_input=input
37

48
importrope.base.evaluate
5-
fromrope.baseimportpynames,pyobjects,arguments,utils,ast
9+
fromrope.base.utilsimportpycompat
10+
fromrope.baseimportpynames,pyobjects,arguments,utils
611

712

813
classBuiltinModule(pyobjects.AbstractModule):
@@ -32,7 +37,7 @@ def attributes(self):
3237
result.update(self.initial)
3338
ifself.pycoreisnotNone:
3439
submodules=self.pycore._builtin_submodules(self.name)
35-
forname,moduleinsubmodules.iteritems():
40+
forname,moduleinsubmodules.items():
3641
result[name]=rope.base.builtins.BuiltinName(module)
3742
returnresult
3843

@@ -266,7 +271,10 @@ def __init__(self, holding=None):
266271
# Getting methods
267272
collector('__getitem__',function=self._list_get)
268273
collector('pop',function=self._list_get)
269-
collector('__getslice__',function=self._self_get)
274+
try:
275+
collector('__getslice__',function=self._list_get)
276+
exceptAttributeError:
277+
pass
270278

271279
super(List,self).__init__(list,collector.attributes)
272280

@@ -290,6 +298,10 @@ def _self_set(self, context):
290298

291299
def_list_get(self,context):
292300
ifself.holdingisnotNone:
301+
args=context.get_arguments(['self','key'])
302+
if (len(args)>1andargs[1]isnotNoneand
303+
args[1].get_type()==builtins['slice'].get_object()):
304+
returnget_list(self.holding)
293305
returnself.holding
294306
returncontext.get_per_name()
295307

@@ -407,7 +419,7 @@ def __init__(self, *objects):
407419
ifobjects:
408420
first=objects[0]
409421
attributes= {
410-
'__getitem__':BuiltinName(BuiltinFunction(first)),
422+
'__getitem__':BuiltinName(BuiltinFunction(first)),# TODO: add slice support
411423
'__getslice__':
412424
BuiltinName(BuiltinFunction(pyobjects.PyObject(self))),
413425
'__new__':BuiltinName(BuiltinFunction(function=self._new_tuple)),
@@ -487,14 +499,21 @@ def __init__(self):
487499
collector=_AttributeCollector(str)
488500
collector('__iter__',get_iterator(self_object),check_existence=False)
489501

490-
self_methods= ['__getitem__','__getslice__','capitalize','center',
491-
'decode','encode','expandtabs','join','ljust',
502+
self_methods= ['__getitem__','capitalize','center',
503+
'encode','expandtabs','join','ljust',
492504
'lower','lstrip','replace','rjust','rstrip',
493505
'strip','swapcase','title','translate','upper',
494506
'zfill']
495507
formethodinself_methods:
496508
collector(method,self_object)
497509

510+
py2_self_methods= ["__getslice__","decode"]
511+
formethodinpy2_self_methods:
512+
try:
513+
collector(method,self_object)
514+
exceptAttributeError:
515+
pass
516+
498517
formethodin ['rsplit','split','splitlines']:
499518
collector(method,get_list(self_object))
500519

@@ -568,7 +587,7 @@ def __init__(self):
568587
attributes= {}
569588

570589
defadd(name,returned=None,function=None):
571-
builtin=getattr(file,name,None)
590+
builtin=getattr(open,name,None)
572591
attributes[name]=BuiltinName(
573592
BuiltinFunction(returned=returned,function=function,
574593
builtin=builtin))
@@ -578,7 +597,7 @@ def add(name, returned=None, function=None):
578597
formethodin ['close','flush','lineno','isatty','seek','tell',
579598
'truncate','write','writelines']:
580599
add(method)
581-
super(File,self).__init__(file,attributes)
600+
super(File,self).__init__(open,attributes)
582601

583602

584603
get_file=_create_builtin_getter(File)
@@ -642,12 +661,12 @@ def get_name(self):
642661
return'lambda'
643662

644663
defget_param_names(self,special_args=True):
645-
result= [node.idfornodeinself.arguments.args
646-
ifisinstance(node,ast.Name)]
664+
result= [pycompat.get_ast_arg_arg(node)fornodeinself.arguments.args
665+
ifisinstance(node,pycompat.ast_arg_type)]
647666
ifself.arguments.vararg:
648-
result.append('*'+self.arguments.vararg)
667+
result.append('*'+pycompat.get_ast_arg_arg(self.arguments.vararg))
649668
ifself.arguments.kwarg:
650-
result.append('**'+self.arguments.kwarg)
669+
result.append('**'+pycompat.get_ast_arg_arg(self.arguments.kwarg))
651670
returnresult
652671

653672
@property
@@ -787,4 +806,4 @@ def _input_function(args):
787806
builtin=raw_input)),
788807
}
789808

790-
builtins=BuiltinModule('__builtin__',initial=_initial_builtins)
809+
builtins=BuiltinModule(pycompat.builtins.__name__,initial=_initial_builtins)

‎pymode/libs2/rope/base/change.pyrenamed to‎pymode/libs/rope/base/change.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def _create_resource(self, file_name, kind='file'):
369369
fscommands.create_file(resource_path)
370370
else:
371371
fscommands.create_folder(resource_path)
372-
exceptIOError,e:
372+
exceptIOErrorase:
373373
raiseexceptions.RopeError(e)
374374

375375

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp