summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2014-09-08 11:01:43 -0700
committerJeff Forcier <jeff@bitprophet.org>2014-09-08 11:02:09 -0700
commitfb9c4cbb0c31fe22125e7e400f08fba4638dce33 (patch)
tree6c3a0d8e0c200c8cff9135264dc05c58bbbbba02
parent69cb2248dc442ebebf7c143534b1865a23b10f61 (diff)
downloadparamiko-fb9c4cbb0c31fe22125e7e400f08fba4638dce33.tar.gz
Make new decorator name a bit slimmer re #377
-rw-r--r--paramiko/channel.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/paramiko/channel.py b/paramiko/channel.py
index 38772283..dadfe184 100644
--- a/paramiko/channel.py
+++ b/paramiko/channel.py
@@ -44,7 +44,7 @@ from paramiko import pipe
MIN_PACKET_SIZE = 1024
-def requires_open_channel(func):
+def open_only(func):
"""
Decorator for `.Channel` methods which performs an openness check.
@@ -143,7 +143,7 @@ class Channel (object):
out += '>'
return out
- @requires_open_channel
+ @open_only
def get_pty(self, term='vt100', width=80, height=24, width_pixels=0,
height_pixels=0):
"""
@@ -177,7 +177,7 @@ class Channel (object):
self.transport._send_user_message(m)
self._wait_for_event()
- @requires_open_channel
+ @open_only
def invoke_shell(self):
"""
Request an interactive shell session on this channel. If the server
@@ -203,7 +203,7 @@ class Channel (object):
self.transport._send_user_message(m)
self._wait_for_event()
- @requires_open_channel
+ @open_only
def exec_command(self, command):
"""
Execute a command on the server. If the server allows it, the channel
@@ -229,7 +229,7 @@ class Channel (object):
self.transport._send_user_message(m)
self._wait_for_event()
- @requires_open_channel
+ @open_only
def invoke_subsystem(self, subsystem):
"""
Request a subsystem on the server (for example, ``sftp``). If the
@@ -254,7 +254,7 @@ class Channel (object):
self.transport._send_user_message(m)
self._wait_for_event()
- @requires_open_channel
+ @open_only
def resize_pty(self, width=80, height=24, width_pixels=0, height_pixels=0):
"""
Resize the pseudo-terminal. This can be used to change the width and
@@ -330,7 +330,7 @@ class Channel (object):
m.add_int(status)
self.transport._send_user_message(m)
- @requires_open_channel
+ @open_only
def request_x11(self, screen_number=0, auth_protocol=None, auth_cookie=None,
single_connection=False, handler=None):
"""
@@ -391,7 +391,7 @@ class Channel (object):
self.transport._set_x11_handler(handler)
return auth_cookie
- @requires_open_channel
+ @open_only
def request_forward_agent(self, handler):
"""
Request for a forward SSH Agent on this channel.