Skip to content

Commit cef445f

Browse files
authored
Merge pull request #234 from bfredl/nopy26
remove python 2.6 support
2 parents a5e3d2d + 25a39c5 commit cef445f

File tree

10 files changed

+20
-19
lines changed

10 files changed

+20
-19
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ filter:
131131
tools:
132132
external_code_coverage:
133133
timeout: 1200
134-
runs: 6
134+
runs: 5

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ matrix:
1717
python:
1818
# If the build matrix gets bigger, also update the number of runs
1919
# at the bottom of .scrutinizer.yml.
20-
- 2.6
2120
- 2.7
2221
- 3.3
2322
- 3.4

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ connecting to and scripting Nvim processes through its msgpack-rpc API.
99

1010
#### Installation
1111

12+
Supports python 2.7, and 3.3 or later.
13+
1214
```sh
1315
pip2 install neovim
1416
pip3 install neovim

neovim/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def setup_logging(name):
118118
if 'NVIM_PYTHON_LOG_FILE' in os.environ:
119119
prefix = os.environ['NVIM_PYTHON_LOG_FILE'].strip()
120120
major_version = sys.version_info[0]
121-
logfile = '{0}_py{1}_{2}'.format(prefix, major_version, name)
121+
logfile = '{}_py{}_{}'.format(prefix, major_version, name)
122122
handler = logging.FileHandler(logfile, 'w')
123123
handler.formatter = logging.Formatter(
124124
'%(asctime)s [%(levelname)s @ '

neovim/api/nvim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def handler():
341341
fn(*args, **kwargs)
342342
except Exception as err:
343343
msg = ("error caught while executing async callback:\n"
344-
"{0!r}\n{1}\n \nthe call was requested at\n{2}"
344+
"{!r}\n{}\n \nthe call was requested at\n{}"
345345
.format(err, format_exc_skip(1, 5), call_point))
346346
self._err_cb(msg)
347347
raise

neovim/msgpack_rpc/event_loop/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(self, transport_type, *args):
8585
self._on_data = None
8686
self._error = None
8787
self._init()
88-
getattr(self, '_connect_{0}'.format(transport_type))(*args)
88+
getattr(self, '_connect_{}'.format(transport_type))(*args)
8989
self._start_reading()
9090

9191
def connect_tcp(self, address, port):
@@ -149,7 +149,7 @@ def stop(self):
149149
debug('Stopped event loop')
150150

151151
def _on_signal(self, signum):
152-
msg = 'Received {0}'.format(self._signames[signum])
152+
msg = 'Received {}'.format(self._signames[signum])
153153
debug(msg)
154154
if signum == signal.SIGINT and self._transport_type == 'stdio':
155155
# When the transport is stdio, we are probably running as a Nvim

neovim/msgpack_rpc/event_loop/uv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _init(self):
2121
def _on_connect(self, stream, error):
2222
self.stop()
2323
if error:
24-
msg = 'Cannot connect to {0}: {1}'.format(
24+
msg = 'Cannot connect to {}: {}'.format(
2525
self._connect_address, pyuv.errno.strerror(error))
2626
self._connection_error = IOError(msg)
2727
return
@@ -49,7 +49,7 @@ def _disconnected(self, *args):
4949

5050
def _connect_tcp(self, address, port):
5151
stream = pyuv.TCP(self._loop)
52-
self._connect_address = '{0}:{1}'.format(address, port)
52+
self._connect_address = '{}:{}'.format(address, port)
5353
stream.connect((address, port), self._on_connect)
5454

5555
def _connect_socket(self, path):

neovim/msgpack_rpc/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def request(self, method, *args, **kwargs):
8282
return
8383

8484
if kwargs:
85-
raise ValueError("request got unsupported keyword argument(s): {0}"
85+
raise ValueError("request got unsupported keyword argument(s): {}"
8686
.format(', '.join(kwargs.keys())))
8787

8888
if self._is_running:
@@ -122,13 +122,13 @@ def on_setup():
122122
gr.switch()
123123

124124
if self._setup_exception:
125-
error('Setup error: {0}'.format(self._setup_exception))
125+
error('Setup error: {}'.format(self._setup_exception))
126126
raise self._setup_exception
127127

128128
# Process all pending requests and notifications
129129
while self._pending_messages:
130130
msg = self._pending_messages.popleft()
131-
getattr(self, '_on_{0}'.format(msg[0]))(*msg[1:])
131+
getattr(self, '_on_{}'.format(msg[0]))(*msg[1:])
132132
self._async_session.run(self._on_request, self._on_notification)
133133
self._is_running = False
134134
self._request_cb = None

neovim/plugin/decorators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def command(name, nargs=0, complete=None, range=None, count=None, bang=False,
4646
register=False, sync=False, eval=None):
4747
"""Tag a function or plugin method as a Nvim command handler."""
4848
def dec(f):
49-
f._nvim_rpc_method_name = 'command:{0}'.format(name)
49+
f._nvim_rpc_method_name = 'command:{}'.format(name)
5050
f._nvim_rpc_sync = sync
5151
f._nvim_bind = True
5252
f._nvim_prefix_plugin_path = True
@@ -86,7 +86,7 @@ def dec(f):
8686
def autocmd(name, pattern='*', sync=False, eval=None):
8787
"""Tag a function or plugin method as a Nvim autocommand handler."""
8888
def dec(f):
89-
f._nvim_rpc_method_name = 'autocmd:{0}:{1}'.format(name, pattern)
89+
f._nvim_rpc_method_name = 'autocmd:{}:{}'.format(name, pattern)
9090
f._nvim_rpc_sync = sync
9191
f._nvim_bind = True
9292
f._nvim_prefix_plugin_path = True
@@ -111,7 +111,7 @@ def dec(f):
111111
def function(name, range=False, sync=False, eval=None):
112112
"""Tag a function or plugin method as a Nvim function handler."""
113113
def dec(f):
114-
f._nvim_rpc_method_name = 'function:{0}'.format(name)
114+
f._nvim_rpc_method_name = 'function:{}'.format(name)
115115
f._nvim_rpc_sync = sync
116116
f._nvim_bind = True
117117
f._nvim_prefix_plugin_path = True

neovim/plugin/host.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _load(self, plugins):
120120
for path in plugins:
121121
err = None
122122
if path in self._loaded:
123-
error('{0} is already loaded'.format(path))
123+
error('{} is already loaded'.format(path))
124124
continue
125125
try:
126126
if path == "script_host.py":
@@ -133,7 +133,7 @@ def _load(self, plugins):
133133
self._discover_classes(module, handlers, path)
134134
self._discover_functions(module, handlers, path)
135135
if not handlers:
136-
error('{0} exports no handlers'.format(path))
136+
error('{} exports no handlers'.format(path))
137137
continue
138138
self._loaded[path] = {'handlers': handlers, 'module': module}
139139
except Exception as e:
@@ -179,20 +179,20 @@ def predicate(o):
179179

180180
method = fn._nvim_rpc_method_name
181181
if fn._nvim_prefix_plugin_path:
182-
method = '{0}:{1}'.format(plugin_path, method)
182+
method = '{}:{}'.format(plugin_path, method)
183183

184184
fn_wrapped = functools.partial(self._wrap_function, fn,
185185
sync, decode, nvim_bind, method)
186186
self._copy_attributes(fn, fn_wrapped)
187187
# register in the rpc handler dict
188188
if sync:
189189
if method in self._request_handlers:
190-
raise Exception(('Request handler for "{0}" is ' +
190+
raise Exception(('Request handler for "{}" is ' +
191191
'already registered').format(method))
192192
self._request_handlers[method] = fn_wrapped
193193
else:
194194
if method in self._notification_handlers:
195-
raise Exception(('Notification handler for "{0}" is ' +
195+
raise Exception(('Notification handler for "{}" is ' +
196196
'already registered').format(method))
197197
self._notification_handlers[method] = fn_wrapped
198198
if hasattr(fn, '_nvim_rpc_spec'):

0 commit comments

Comments
 (0)