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
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Commitf00f284

Browse files
Shougoroxma
authored andcommitted
Fix flake8 errors
1 parent41fa755 commitf00f284

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

‎pythonx/neovim_rpc_methods.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ def nvim_get_current_buf():
1818
defnvim_list_bufs():
1919
returnlist(vim.buffers)
2020

21-
# {'return_type': 'Integer', 'since': 1, 'method': True, 'parameters': [['Buffer', 'buffer']], 'name': 'nvim_buf_get_number'}
22-
2321

2422
defnvim_buf_get_number(buf):
2523
returnbuf.number

‎pythonx/neovim_rpc_server.py‎

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
importmsgpack
1111
importneovim_rpc_server_api_info
1212
importneovim_rpc_methods
13-
importthreading
14-
importsocket
1513
importneovim_rpc_protocol
1614

1715
vim_error=vim.Function('neovim_rpc#_error')
@@ -62,7 +60,7 @@ class VimHandler(socketserver.BaseRequestHandler):
6260
defnotify(cls,cmd=None):
6361
try:
6462
ifcmdisNone:
65-
cmd=vim_py+" neovim_rpc_server.process_pending_requests()"
63+
cmd=vim_py+" neovim_rpc_server.process_pending_requests()"
6664
ifnotVimHandler._sock:
6765
return
6866
withVimHandler._lock:
@@ -112,7 +110,8 @@ def handle(self):
112110

113111
# Send a response if the sequence number is positive.
114112
# Negative numbers are used for "eval" responses.
115-
iflen(decoded)>=2anddecoded[0]>=0anddecoded[1]=='neovim_rpc_setup':
113+
if (len(decoded)>=2anddecoded[0]>=0and
114+
decoded[1]=='neovim_rpc_setup'):
116115

117116
VimHandler._sock=self.request
118117

@@ -135,6 +134,7 @@ def handle(self):
135134
args,
136135
rspid)
137136

137+
138138
classSocketToStream():
139139

140140
def__init__(self,sock):
@@ -198,13 +198,13 @@ def handle(self):
198198

199199
logger.info('channel %s closed.',channel)
200200

201-
except:
201+
exceptException:
202202
logger.exception('unpacker failed.')
203203
finally:
204204
try:
205205
NvimHandler.channel_sockets.pop(channel)
206206
sock.close()
207-
except:
207+
exceptException:
208208
pass
209209

210210
@classmethod
@@ -284,11 +284,11 @@ def _setup_logging(name):
284284
logging.root.addHandler(handler)
285285
level=logging.INFO
286286
if'NVIM_PYTHON_LOG_LEVEL'inos.environ:
287-
l=getattr(logging,
288-
os.environ['NVIM_PYTHON_LOG_LEVEL'].strip(),
289-
level)
290-
ifisinstance(l,int):
291-
level=l
287+
lv=getattr(logging,
288+
os.environ['NVIM_PYTHON_LOG_LEVEL'].strip(),
289+
level)
290+
ifisinstance(lv,int):
291+
level=lv
292292
logger.setLevel(level)
293293

294294

@@ -297,7 +297,8 @@ class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
297297

298298

299299
ifsys.platformin ['linux','darwin']:
300-
classThreadedUnixServer(socketserver.ThreadingMixIn,socketserver.UnixStreamServer):
300+
classThreadedUnixServer(socketserver.ThreadingMixIn,
301+
socketserver.UnixStreamServer):
301302
pass
302303
has_unix=True
303304
else:
@@ -327,7 +328,7 @@ def start():
327328
ifos.path.exists(nvim_server_addr):
328329
try:
329330
os.unlink(nvim_server_addr)
330-
except:
331+
exceptException:
331332
pass
332333
_nvim_server=ThreadedUnixServer(nvim_server_addr,NvimHandler)
333334
elifnothas_unix:
@@ -408,7 +409,7 @@ def process_pending_requests():
408409
exceptExceptionasex:
409410
logger.exception("process failed: %s",ex)
410411

411-
exceptQueueEmptyasem:
412+
exceptQueueEmpty:
412413
pass
413414
exceptExceptionasex:
414415
logger.exception("exception during process: %s",ex)
@@ -429,7 +430,9 @@ def _process_request(channel, method, args):
429430
else:
430431
logger.error("method %s not implemented",method)
431432
vim_error(
432-
"rpc method [%s] not implemented in pythonx/neovim_rpc_methods.py. Please send PR or contact the mantainer."%method)
433+
"rpc method [%s] not implemented in "
434+
"pythonx/neovim_rpc_methods.py. "
435+
"Please send PR or contact the mantainer."%method)
433436
raiseException('%s not implemented'%method)
434437

435438

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp