Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
add magic command something_remote and remote_something
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Oct 25, 2014
1 parent 9c9c30c commit 33b3d7a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/pyensae/remote/magic_remote.py
Expand Up @@ -48,6 +48,13 @@ def PIG(self, line, cell = None):
with open(filename, "w", encoding="utf8") as f :
f.write(cell.replace("\r",""))

@line_magic
def pigsubmit(self, line):
"""
@see me jobsubmit
"""
return self.jobsubmit(line)

@line_magic
def jobsubmit(self, line):
"""
Expand Down Expand Up @@ -114,6 +121,13 @@ def jobsyntax(self, line):
else:
return HTML("<pre>\n%s\n</pre>" % out)

@line_magic
def open_remote(self, line):
"""
@see me remote_open
"""
return self.remote_open(line)

@line_magic
def remote_open (self, line):
"""
Expand Down Expand Up @@ -149,6 +163,13 @@ def remote_open (self, line):
self.shell.user_ns["remote_ssh"] = ssh
return ssh

@line_magic
def close_remote(self, line):
"""
@see me remote_close
"""
return self.remote_close(line)

@line_magic
def remote_close (self, line):
"""
Expand All @@ -157,6 +178,13 @@ def remote_close (self, line):
"""
self.get_connection().close()

@line_magic
def cmd_remote(self, line):
"""
@see me remote_cmd
"""
return self.remote_cmd(line)

@line_magic
def remote_cmd(self, line):
"""
Expand All @@ -173,6 +201,13 @@ def remote_cmd(self, line):
return HTML("<pre>\n%s\n</pre>" % err)
else:
return HTML("<pre>\n%s\n</pre>" % out)

@line_magic
def up_remote(self, line):
"""
@see me remote_up
"""
return self.remote_up(line)

@line_magic
def remote_up(self, line):
Expand All @@ -198,6 +233,13 @@ def remote_up(self, line):
raise FileNotFoundError(localfile)
ssh.upload(localfile, remotepath)

@line_magic
def down_remote(self, line):
"""
@see me remote_down
"""
return self.remote_down(line)

@line_magic
def remote_down(self, line):
"""
Expand Down

0 comments on commit 33b3d7a

Please sign in to comment.