|
5 | 5 | import os |
6 | 6 | import os.path |
7 | 7 | import re |
8 | | -import sys |
9 | 8 | from functools import partial |
10 | 9 | from traceback import format_exc |
11 | 10 |
|
12 | 11 | from . import script_host |
13 | 12 | from ..api import decode_if_bytes, walk |
14 | 13 | from ..compat import IS_PYTHON3, find_module |
15 | 14 | from ..msgpack_rpc import ErrorResponse |
16 | | -from ..util import VERSION, format_exc_skip |
| 15 | +from ..util import format_exc_skip, get_client_info |
17 | 16 |
|
18 | 17 | __all__ = ('Host') |
19 | 18 |
|
@@ -156,17 +155,11 @@ def _load(self, plugins): |
156 | 155 | error(err) |
157 | 156 | self._load_errors[path] = err |
158 | 157 |
|
159 | | - if len(plugins) == 1 and has_script: |
160 | | - kind = "script" |
161 | | - else: |
162 | | - kind = "rplugin" |
163 | | - name = "python{}-{}-host".format(sys.version_info[0], kind) |
164 | | - attributes = {"license": "Apache v2", |
165 | | - "website": "github.com/neovim/pynvim"} |
166 | | - self.name = name |
| 158 | + kind = ("script-host" if len(plugins) == 1 and has_script |
| 159 | + else "rplugin-host") |
167 | 160 | self.nvim.api.set_client_info( |
168 | | - name, VERSION.__dict__, "host", host_method_spec, |
169 | | - attributes, async_=True) |
| 161 | + *get_client_info(kind, 'host', host_method_spec), |
| 162 | + async_=True) |
170 | 163 |
|
171 | 164 | def _unload(self): |
172 | 165 | for path, plugin in self._loaded.items(): |
|
0 commit comments