[Python-modules-commits] [python-neovim] 03/06: Imported Upstream version 0.1.2
Víctor Cuadrado Juan
viccuad-guest at moszumanska.debian.org
Fri Feb 26 21:57:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
viccuad-guest pushed a commit to branch master
in repository python-neovim.
commit 85389e5954e065638607395aecf696bff809c252
Author: Víctor Cuadrado Juan <me at viccuad.me>
Date: Fri Feb 26 21:02:18 2016 +0100
Imported Upstream version 0.1.2
---
neovim/api/buffer.py | 14 ++++++++++++++
neovim/api/nvim.py | 4 ++++
neovim/msgpack_rpc/async_session.py | 2 +-
neovim/msgpack_rpc/event_loop/asyncio.py | 14 +++++++++++---
neovim/msgpack_rpc/event_loop/base.py | 2 +-
neovim/msgpack_rpc/msgpack_stream.py | 2 +-
neovim/msgpack_rpc/session.py | 2 +-
neovim/plugin/decorators.py | 2 +-
neovim/plugin/host.py | 2 +-
neovim/ui/gtk_ui.py | 6 +++---
setup.cfg | 2 +-
setup.py | 4 ++--
12 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/neovim/api/buffer.py b/neovim/api/buffer.py
index b3ba292..d90280e 100644
--- a/neovim/api/buffer.py
+++ b/neovim/api/buffer.py
@@ -127,6 +127,20 @@ class Buffer(Remote):
"""Return a `Range` object, which represents part of the Buffer."""
return Range(self, start, end)
+ def add_highlight(self, hl_group, line, col_start=0,
+ col_end=-1, src_id=-1, async=None):
+ """Add a highlight to the buffer."""
+ if async is None:
+ async = (src_id != 0)
+ return self._session.request('buffer_add_highlight', self, src_id,
+ hl_group, line, col_start,
+ col_end, async=async)
+
+ def clear_highlight(self, src_id, line_start=0, line_end=-1, async=True):
+ """clear highlights from the buffer."""
+ self._session.request('buffer_clear_highlight', self, src_id,
+ line_start, line_end, async=async)
+
@property
def name(self):
"""Get the buffer name."""
diff --git a/neovim/api/nvim.py b/neovim/api/nvim.py
index d5de63c..7d7ce49 100644
--- a/neovim/api/nvim.py
+++ b/neovim/api/nvim.py
@@ -222,6 +222,10 @@ class Nvim(object):
# ignore it.
pass
+ def new_highlight_source(self):
+ """Return new src_id for use with Buffer.add_highlight."""
+ return self.current.buffer.add_highlight("", 0, src_id=0)
+
class Current(object):
diff --git a/neovim/msgpack_rpc/async_session.py b/neovim/msgpack_rpc/async_session.py
index 20eded0..aa95088 100644
--- a/neovim/msgpack_rpc/async_session.py
+++ b/neovim/msgpack_rpc/async_session.py
@@ -4,7 +4,7 @@ from traceback import format_exc
logger = logging.getLogger(__name__)
-debug, info, warn = (logger.debug, logger.info, logger.warn,)
+debug, info, warn = (logger.debug, logger.info, logger.warning,)
class AsyncSession(object):
diff --git a/neovim/msgpack_rpc/event_loop/asyncio.py b/neovim/msgpack_rpc/event_loop/asyncio.py
index 49db6c5..87ce79a 100644
--- a/neovim/msgpack_rpc/event_loop/asyncio.py
+++ b/neovim/msgpack_rpc/event_loop/asyncio.py
@@ -44,7 +44,7 @@ class AsyncioEventLoop(BaseEventLoop, asyncio.Protocol,
def connection_lost(self, exc):
"""Used to signal `asyncio.Protocol` of a lost connection."""
- self._on_error(exc.message if exc else 'EOF')
+ self._on_error(exc.args[0] if exc else 'EOF')
def data_received(self, data):
"""Used to signal `asyncio.Protocol` of incoming data."""
@@ -55,7 +55,7 @@ class AsyncioEventLoop(BaseEventLoop, asyncio.Protocol,
def pipe_connection_lost(self, fd, exc):
"""Used to signal `asyncio.SubprocessProtocol` of a lost connection."""
- self._on_error(exc.message if exc else 'EOF')
+ self._on_error(exc.args[0] if exc else 'EOF')
def pipe_data_received(self, fd, data):
"""Used to signal `asyncio.SubprocessProtocol` of incoming data."""
@@ -80,7 +80,10 @@ class AsyncioEventLoop(BaseEventLoop, asyncio.Protocol,
self._loop.run_until_complete(coroutine)
def _connect_socket(self, path):
- coroutine = self._loop.create_unix_connection(self._fact, path)
+ if os.name == 'nt':
+ coroutine = self._loop.create_pipe_connection(self._fact, path)
+ else:
+ coroutine = self._loop.create_unix_connection(self._fact, path)
self._loop.run_until_complete(coroutine)
def _connect_stdio(self):
@@ -111,6 +114,11 @@ class AsyncioEventLoop(BaseEventLoop, asyncio.Protocol,
self._loop.call_soon_threadsafe(fn)
def _setup_signals(self, signals):
+ if os.name == 'nt':
+ # add_signal_handler is not supported in win32
+ self._signals = []
+ return
+
self._signals = list(signals)
for signum in self._signals:
self._loop.add_signal_handler(signum, self._on_signal, signum)
diff --git a/neovim/msgpack_rpc/event_loop/base.py b/neovim/msgpack_rpc/event_loop/base.py
index a0dd0c0..a05299e 100644
--- a/neovim/msgpack_rpc/event_loop/base.py
+++ b/neovim/msgpack_rpc/event_loop/base.py
@@ -5,7 +5,7 @@ import threading
logger = logging.getLogger(__name__)
-debug, info, warn = (logger.debug, logger.info, logger.warn,)
+debug, info, warn = (logger.debug, logger.info, logger.warning,)
# When signals are restored, the event loop library may reset SIGINT to SIG_DFL
diff --git a/neovim/msgpack_rpc/msgpack_stream.py b/neovim/msgpack_rpc/msgpack_stream.py
index 77c8894..61d8f87 100644
--- a/neovim/msgpack_rpc/msgpack_stream.py
+++ b/neovim/msgpack_rpc/msgpack_stream.py
@@ -5,7 +5,7 @@ from msgpack import Packer, Unpacker
logger = logging.getLogger(__name__)
-debug, info, warn = (logger.debug, logger.info, logger.warn,)
+debug, info, warn = (logger.debug, logger.info, logger.warning,)
class MsgpackStream(object):
diff --git a/neovim/msgpack_rpc/session.py b/neovim/msgpack_rpc/session.py
index 8882a33..9a74be7 100644
--- a/neovim/msgpack_rpc/session.py
+++ b/neovim/msgpack_rpc/session.py
@@ -8,7 +8,7 @@ import greenlet
logger = logging.getLogger(__name__)
error, debug, info, warn = (logger.error, logger.debug, logger.info,
- logger.warn,)
+ logger.warning,)
class Session(object):
diff --git a/neovim/plugin/decorators.py b/neovim/plugin/decorators.py
index 486b44c..c4179df 100644
--- a/neovim/plugin/decorators.py
+++ b/neovim/plugin/decorators.py
@@ -6,7 +6,7 @@ import logging
from ..compat import IS_PYTHON3
logger = logging.getLogger(__name__)
-debug, info, warn = (logger.debug, logger.info, logger.warn,)
+debug, info, warn = (logger.debug, logger.info, logger.warning,)
__all__ = ('plugin', 'rpc_export', 'command', 'autocmd', 'function',
'encoding', 'shutdown_hook')
diff --git a/neovim/plugin/host.py b/neovim/plugin/host.py
index c6f3d22..b5f6110 100644
--- a/neovim/plugin/host.py
+++ b/neovim/plugin/host.py
@@ -14,7 +14,7 @@ __all__ = ('Host')
logger = logging.getLogger(__name__)
error, debug, info, warn = (logger.error, logger.debug, logger.info,
- logger.warn,)
+ logger.warning,)
class Host(object):
diff --git a/neovim/ui/gtk_ui.py b/neovim/ui/gtk_ui.py
index 89935b2..0ac6696 100644
--- a/neovim/ui/gtk_ui.py
+++ b/neovim/ui/gtk_ui.py
@@ -26,7 +26,7 @@ KEY_TABLE = {
'numbersign': '#',
'dollar': '$',
'percent': '%',
- 'ampersand': '^',
+ 'ampersand': '&',
'asterisk': '*',
'parenleft': '(',
'parenright': ')',
@@ -35,8 +35,8 @@ KEY_TABLE = {
'minus': '-',
'bracketleft': '[',
'bracketright': ']',
- 'braceleft': '[',
- 'braceright': ']',
+ 'braceleft': '{',
+ 'braceright': '}',
'dead_diaeresis': '"',
'dead_acute': "'",
'less': "<",
diff --git a/setup.cfg b/setup.cfg
index bfa6dd1..cceece9 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,2 +1,2 @@
[flake8]
-ignore = D211
+ignore = D211,E731
diff --git a/setup.py b/setup.py
index 9a902bf..04f9f5f 100644
--- a/setup.py
+++ b/setup.py
@@ -35,10 +35,10 @@ if sys.version_info < (3, 0):
entry_points['console_scripts'] = ['pynvim=neovim.ui.cli:main [GUI]']
setup(name='neovim',
- version='0.1.0',
+ version='0.1.2',
description='Python client to neovim',
url='http://github.com/neovim/python-client',
- download_url='https://github.com/neovim/python-client/archive/0.1.0.tar.gz',
+ download_url='https://github.com/neovim/python-client/archive/0.1.2.tar.gz',
author='Thiago de Arruda',
author_email='tpadilha84 at gmail.com',
license='Apache',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-neovim.git
More information about the Python-modules-commits
mailing list