Skip to content

Commit

Permalink
Fix small style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Aug 5, 2024
1 parent 7e700d7 commit 19f418c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions spyder/plugins/ipythonconsole/widgets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,9 @@ def kernel_restarted_failure_message(self, error=None, shutdown=False):
if isinstance(error, SpyderKernelError):
error = error.args[0]
elif isinstance(error, Exception):
error = _("The error is:<br><br>"
"<tt>{}</tt>").format(traceback.format_exc())
error = _("The error is:<br><br>" "<tt>{}</tt>").format(
traceback.format_exc()
)

# Replace end of line chars with <br>
eol = sourcecode.get_eol_chars(error)
Expand Down
7 changes: 5 additions & 2 deletions spyder/plugins/remoteclient/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,15 +614,18 @@ async def stop_remote_server(self):

# bug in jupyterhub, need to send SIGINT twice
self._logger.debug(
f"Stopping remote server for {self.peer_host} with pid {self._server_info['pid']}"
f"Stopping remote server for {self.peer_host} with pid "
f"{self._server_info['pid']}"
)
try:
async with JupyterAPI(
self.server_url, api_token=self.api_token
) as jupyter:
await jupyter.shutdown_server()
except Exception as err:
self._logger.exception(f"Error stopping remote server", exc_info=err)
self._logger.exception(
"Error stopping remote server", exc_info=err
)

if (
self._remote_server_process
Expand Down
5 changes: 3 additions & 2 deletions spyder/plugins/remoteclient/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def on_first_registration(self):
def on_close(self, cancellable=True):
"""Stops remote server and close any opened connection."""
for client in self._remote_clients.values():
AsyncDispatcher(client.close, loop="asyncssh", early_return=False)()
AsyncDispatcher(
client.close, loop="asyncssh", early_return=False
)()

@on_plugin_available(plugin=Plugins.MainMenu)
def on_mainmenu_available(self):
Expand Down Expand Up @@ -226,7 +228,6 @@ def load_conf(self, config_id):

if options["client_keys"]:
passpharse = self.get_conf(f"{config_id}/passpharse", secure=True)

options["client_keys"] = [options["client_keys"]]

# Passphrase is optional
Expand Down
2 changes: 2 additions & 0 deletions spyder/plugins/remoteclient/widgets/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@


class RemoteClientContainer(PluginMainContainer):

_sig_kernel_restarted = Signal(object, bool)
"""
This private signal is used to inform that a kernel restart took place in
Expand All @@ -40,6 +41,7 @@ class RemoteClientContainer(PluginMainContainer):
Response returned by the server. `None` can happen when the connection
to the server is lost.
"""

_sig_kernel_info = Signal(object, dict)
"""
This private signal is used to inform that a kernel info request took place
Expand Down

0 comments on commit 19f418c

Please sign in to comment.