From 3d113eaec49cc9d1bc801a3e68d1929dd78b27ff Mon Sep 17 00:00:00 2001 From: Aaron Walker Date: Wed, 20 May 2020 00:44:32 -0400 Subject: [PATCH] comments --- docs/configuration.md | 10 +++++----- python3/vimspector/debug_session.py | 17 ++++------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 7ac5991..6c82584 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -419,7 +419,7 @@ Vimspector then orchestrates the various tools to set you up. // %CMD% replaced with the remote-cmdLine configured in the launch // configuration. (mandatory) "launchCommmand": [ - "python", "-m", "debugpy", "--listen 0.0.0.0:${port}", + "python", "-m", "debugpy", "--listen", "0.0.0.0:${port}", "%CMD%" ] @@ -449,7 +449,7 @@ Vimspector then orchestrates the various tools to set you up. // Command to attach the debugger; %PID% replaced with output of // pidCommand above (mandatory) "attachCommand": [ - "python", "-m", "debugpy", "--listen 0.0.0.0:${port}", + "python", "-m", "debugpy", "--listen", "0.0.0.0:${port}", "--pid", "%PID%" ] @@ -624,7 +624,7 @@ port. // %CMD% replaced with the remote-cmdLine configured in the launch // configuration. (mandatory) "launchCommmand": [ - "python", "-m", "debugpy", "--listen 0.0.0.0:${port}", + "python", "-m", "debugpy", "--listen", "0.0.0.0:${port}", "%CMD%" ] @@ -648,13 +648,13 @@ port. // call a custom command to returm the PID for a named service, so // here's an examle: // - "sh", "-c", "pgrep", "-f ${filename}" + "sh", "-c", "pgrep", "-f", "${filename}" ], // Command to attach the debugger; %PID% replaced with output of // pidCommand above (mandatory) "attachCommand": [ - "sh", "-c", "python", "-m", "debugpy", "--listen 0.0.0.0:${port}", + "sh", "-c", "python", "-m", "debugpy", "--listen", "0.0.0.0:${port}", "--pid", "%PID%" ] diff --git a/python3/vimspector/debug_session.py b/python3/vimspector/debug_session.py index 775a03c..6e65f20 100644 --- a/python3/vimspector/debug_session.py +++ b/python3/vimspector/debug_session.py @@ -695,23 +695,14 @@ class DebugSession( object ): return ssh def _GetDockerCommand( self, remote ): - if 'container' not in remote: - raise ValueError( 'Invalid container; must be string' ) - - docker = [ 'docker exec' ] + docker = [ 'docker', 'exec' ] docker.append( remote[ 'container' ] ) return docker def _GetRemoteExecCommand( self, remote ): - is_ssh_cmd = any( - remote.get( 'ssh' ), - remote.get( 'account' ), - remote.get( 'host' ), - ) - is_docker_cmd = any( - remote.get( 'docker' ), - remote.get( 'container' ), - ) + is_ssh_cmd = any( key in remote for key in [ 'ssh','host', 'account' ] ) + is_docker_cmd = 'container' in remote + if is_ssh_cmd: return self._GetSSHCommand( remote ) elif is_docker_cmd: