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

Commit26bba03

Browse files
committed
Merge branch 'release/0.7.1b'
2 parents4f4ecbd +df0d73d commit26bba03

File tree

171 files changed

+185
-96
lines changed

Some content is hidden

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

171 files changed

+185
-96
lines changed

‎Changelog.rst‎

Lines changed: 1 addition & 1 deletion

‎Makefile‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
PYMODE =$(CURDIR)/pymode
2+
LIBS =$(PYMODE)/libs
3+
PYLAMA =$(LIBS)/pylama
4+
15
.PHONY: clean
26
clean:
37
find. -name"*.pyc" -delete
@@ -9,6 +13,12 @@ test:
913

1014
.PHONY: pylama
1115
pylama:
12-
rm -rf pylibs/pylama
13-
cp -r~/Dropbox/projects/pylama/pylama pylibs/pylama
14-
cp -r~/Dropbox/projects/pylama/plugins/pylama_pylint/pylama_pylint/ pylibs/pylama/lint/pylama_pylint
16+
rm -rf$(PYLAMA)
17+
make$(PYLAMA)
18+
make$(PYLAMA)/lint/pylama_pylint
19+
20+
$(PYLAMA):
21+
cp -r~/Dropbox/projects/pylama/pylama$(PYLAMA)
22+
23+
$(PYLAMA)/lint/pylama_pylint:
24+
cp -r~/Dropbox/projects/pylama/plugins/pylama_pylint/pylama_pylint/$(PYLAMA)/lint/pylama_pylint

‎autoload/pymode/lint.vim‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ fun! pymode#lint#check() "{{{
4646

4747
letb:pymode_errors= {}
4848

49-
if!pymode#save()
50-
return0
51-
endif
52-
5349
callpymode#wide_message('Code checking is running ...')
5450

5551
PymodePythoncode_check()

‎doc/pymode.txt‎

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

88

9-
Version: 0.7.0b
9+
Version: 0.7.1b
1010

1111
==============================================================================
1212
CONTENTS*pymode-contents*

‎ftplugin/python/pymode.vim‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ if !pymode#default('g:pymode_init', 1)
77
callpymode#init(expand('<sfile>:p:h:h:h'),g:pymode_paths)
88
callpymode#virtualenv#init()
99
callpymode#breakpoint#init()
10+
PymodePython from pymode.utilsimport patch_paths
11+
PymodePythonpatch_paths()
1012
endif
1113

1214
augrouppymode

‎plugin/pymode.vim‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
" vi:fdl=1
2-
letg:pymode_version="0.7.0b"
2+
letg:pymode_version="0.7.1b"
33

44
com! PymodeVersionechomsg"Current python-mode version:" .g:pymode_version
55
com! PymodeTroubleshootingcallpymode#troubleshooting#test()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
"""
77

8-
version_info=2,0,1
8+
version_info=2,0,3
99

1010
__version__=version='.'.join(map(str,version_info))
1111
__project__=__name__
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
from .importversion
1010
from .coreimportLOGGER,STREAM
11-
from .iniramaimportNamespace
12-
from .lintimportLINTERS
11+
from .libs.iniramaimportNamespace
12+
from .lint.extensionsimportLINTERS
1313

1414

1515
#: A default checkers
@@ -127,6 +127,8 @@ def parse_linters(csp_str):
127127
linter=LINTERS.get(name)
128128
iflinter:
129129
result.append((name,linter))
130+
else:
131+
logging.warn("Linter `%s` not found."%name)
130132
returnresult
131133

132134
parser.add_argument(
Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66
importlogging
77
importre
8-
from .lintimportLINTERS
8+
from .lint.extensionsimportLINTERS
99

1010
#: The skip pattern
1111
SKIP_PATTERN=re.compile(r'# *noqa\b',re.I).search
@@ -20,7 +20,9 @@
2020
LOGGER.addHandler(STREAM)
2121

2222

23-
defrun(path,ignore=None,select=None,linters=None,config=None,**meta):
23+
defrun(
24+
path,ignore=None,select=None,linters=None,config=None,code=None,
25+
**meta):
2426
""" Run a code checkers with given params.
2527
2628
:return errors: list of dictionaries with error's information
@@ -29,11 +31,9 @@ def run(path, ignore=None, select=None, linters=None, config=None, **meta):
2931
errors= []
3032
linters=lintersorLINTERS.items()
3133
params=dict(ignore=ignore,select=select)
32-
code=None
3334
try:
34-
withopen(path,'rU')asf:
35-
code=f.read()+'\n\n'
36-
35+
withCodeContext(code,path)asctx:
36+
code=ctx.code
3737
params=prepare_params(
3838
parse_modeline(code),config,ignore=ignore,select=select
3939
)
@@ -78,7 +78,7 @@ def run(path, ignore=None, select=None, linters=None, config=None, **meta):
7878

7979
errors= [erforerinerrorsiffilter_errors(er,**params)]
8080

81-
ifcode:
81+
ifcodeanderrors:
8282
errors=filter_skiplines(code,errors)
8383

8484
returnsorted(errors,key=lambdax:x['lnum'])
@@ -158,3 +158,23 @@ def filter_skiplines(code, errors):
158158
errors= [erforerinerrorsifnoter['lnum']inremoved]
159159

160160
returnerrors
161+
162+
163+
classCodeContext(object):
164+
165+
""" Read file if code is None. """
166+
167+
def__init__(self,code,path):
168+
self.code=code
169+
self.path=path
170+
self._file=None
171+
172+
def__enter__(self):
173+
ifself.codeisNone:
174+
self._file=open(self.path,'rU')
175+
self.code=self._file.read()+'\n\n'
176+
returnself
177+
178+
def__exit__(self):
179+
ifnotself._fileisNone:
180+
self._file.close()
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ def run(command):
2929

3030
defgit_hook():
3131
""" Run pylama after git commit. """
32-
3332
from .mainimportcheck_files
33+
3434
_,files_modified,_=run("git diff-index --cached --name-only HEAD")
3535

3636
options=parse_options()
3737
setup_logger(options)
38-
check_files(
39-
[fforfinmap(str,files_modified)iff.endswith('.py')],options
40-
)
38+
check_files([fforfinmap(str,files_modified)],options)
4139

4240

4341
defhg_hook(ui,repo,node=None,**kwargs):
@@ -53,8 +51,7 @@ def hg_hook(ui, repo, node=None, **kwargs):
5351
iffile_inseenornotop.exists(file_):
5452
continue
5553
seen.add(file_)
56-
iffile_.endswith('.py'):
57-
paths.append(file_)
54+
paths.append(file_)
5855

5956
options=parse_options()
6057
setup_logger(options)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp