diff --git a/paramiko/__init__.py b/paramiko/__init__.py new file mode 100644 index 0000000..e6d5e9f --- /dev/null +++ b/paramiko/__init__.py @@ -0,0 +1,20 @@ + +import sys + +if (sys.version_info[0] < 2) or ((sys.version_info[0] == 2) and (sys.version_info[1] < 3)): + raise RuntimeError('You need python 2.3 for this module.') + + +__author__ = "Robey Pointer " +__date__ = "10 Nov 2003" +__version__ = "0.1-charmander" +__credits__ = "Huzzah!" + + +from auth_transport import Transport +from channel import Channel +from rsakey import RSAKey +from dsskey import DSSKey +from util import hexify + +__all__ = [ 'Transport', 'Channel', 'RSAKey', 'DSSKey', 'hexify' ] diff --git a/paramiko/auth_transport.py b/paramiko/auth_transport.py index 854b358..23f2d02 100644 --- a/paramiko/auth_transport.py +++ b/paramiko/auth_transport.py @@ -4,7 +4,7 @@ from transport import BaseTransport from transport import MSG_SERVICE_REQUEST, MSG_SERVICE_ACCEPT, MSG_USERAUTH_REQUEST, MSG_USERAUTH_FAILURE, \ MSG_USERAUTH_SUCCESS, MSG_USERAUTH_BANNER from message import Message -from paramiko import SSHException +from ssh_exception import SSHException from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL DISCONNECT_SERVICE_NOT_AVAILABLE, DISCONNECT_AUTH_CANCELLED_BY_USER, \ diff --git a/paramiko/channel.py b/paramiko/channel.py index fa0ff7c..43ddcd1 100644 --- a/paramiko/channel.py +++ b/paramiko/channel.py @@ -1,5 +1,5 @@ from message import Message -from paramiko import SSHException +from ssh_exception import SSHException from transport import MSG_CHANNEL_REQUEST, MSG_CHANNEL_CLOSE, MSG_CHANNEL_WINDOW_ADJUST, MSG_CHANNEL_DATA, \ MSG_CHANNEL_EOF, MSG_CHANNEL_SUCCESS, MSG_CHANNEL_FAILURE diff --git a/paramiko/dsskey.py b/paramiko/dsskey.py index a5e5c9a..35d8a8d 100644 --- a/paramiko/dsskey.py +++ b/paramiko/dsskey.py @@ -1,7 +1,7 @@ #!/usr/bin/python import base64 -from paramiko import SSHException +from ssh_exception import SSHException from message import Message from transport import MSG_USERAUTH_REQUEST from util import inflate_long, deflate_long diff --git a/paramiko/kex_gex.py b/paramiko/kex_gex.py index 19bc699..f1b8058 100644 --- a/paramiko/kex_gex.py +++ b/paramiko/kex_gex.py @@ -6,7 +6,7 @@ from message import Message from util import inflate_long, deflate_long, generate_prime, bit_length -from paramiko import SSHException +from ssh_exception import SSHException from transport import MSG_NEWKEYS from Crypto.Hash import SHA from Crypto.Util import number diff --git a/paramiko/kex_group1.py b/paramiko/kex_group1.py index 00988b2..a29c79d 100644 --- a/paramiko/kex_group1.py +++ b/paramiko/kex_group1.py @@ -5,7 +5,7 @@ # "g" generator. from message import Message, inflate_long -from paramiko import SSHException +from ssh_exception import SSHException from transport import MSG_NEWKEYS from Crypto.Hash import SHA from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py new file mode 100644 index 0000000..b6e1846 --- /dev/null +++ b/paramiko/ssh_exception.py @@ -0,0 +1,4 @@ + +class SSHException(Exception): + pass + diff --git a/paramiko/transport.py b/paramiko/transport.py index a646b58..6bbfa75 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -14,7 +14,6 @@ MSG_CHANNEL_OPEN, MSG_CHANNEL_OPEN_SUCCESS, MSG_CHANNEL_OPEN_FAILURE, \ import sys, os, string, threading, socket, logging, struct from message import Message from channel import Channel -from paramiko import SSHException from util import format_binary, safe_string, inflate_long, deflate_long, tb_strings from rsakey import RSAKey from dsskey import DSSKey @@ -53,6 +52,7 @@ except: randpool.randomize() + class BaseTransport(threading.Thread): ''' An SSH Transport attaches to a stream (usually a socket), negotiates an