Skip to content
Permalink
Browse files

add help to magic command remote_cmd, fix dependencies

  • Loading branch information...
sdpython committed Nov 1, 2015
1 parent 468f04d commit 3a933b914d632a88581a4bca0a17d4c9b060e75f
Showing with 14 additions and 11 deletions.
  1. +1 −1 setup.py
  2. +13 −10 src/pyensae/remote/magic_remote_ssh.py
@@ -180,7 +180,7 @@ def write_version():
packages=packages,
package_dir=package_dir,
package_data=package_data,
install_requires=["pyquickhelper", "colormap", "qgrid"],
install_requires=["pyquickhelper", "colormap", "qgrid", "easydev"],
extras_require={
'graph_helper': ['matplotlib'],
'languages': ['antlr4-python3-runtime'],
@@ -369,18 +369,21 @@ def remote_cmd(self, line, cell=None):
In the second case, if __PASSWORD__ is found, it will be replaced by the password stored in
workspace.
"""
ssh = self.get_connection()
if "--help" in line:
print("Usage: %remote_cmd <cmd>")
else:
ssh = self.get_connection()

if isinstance(cell, str):
cell = self._replace_params(cell)
if isinstance(cell, str):
cell = self._replace_params(cell)

out, err = ssh.execute_command(
line, no_exception=True, fill_stdin=cell)
if len(err) > 0 and (
len(out) == 0 or "ERROR" in err or "FATAL" in err or "Exception" in err):
return HTML("<pre>\n%s\n</pre>" % err)
else:
return HTML("<pre>\n%s\n</pre>" % out)
out, err = ssh.execute_command(
line, no_exception=True, fill_stdin=cell)
if len(err) > 0 and (
len(out) == 0 or "ERROR" in err or "FATAL" in err or "Exception" in err):
return HTML("<pre>\n%s\n</pre>" % err)
else:
return HTML("<pre>\n%s\n</pre>" % out)

@staticmethod
def remote_up_parser():

0 comments on commit 3a933b9

Please sign in to comment.
You can’t perform that action at this time.