From 682185bac161244838b7d6da0c2247db997145ff Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Thu, 7 Sep 2006 18:55:16 -0700 Subject: [project @ robey@lag.net-20060908015516-1b8ac2af031586fe] better way to change the module name --- paramiko/__init__.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/paramiko/__init__.py b/paramiko/__init__.py index 4d970c5b..ceefe474 100644 --- a/paramiko/__init__.py +++ b/paramiko/__init__.py @@ -92,15 +92,10 @@ from hostkeys import HostKeys from config import SSHConfig # fix module names for epydoc -for x in (Transport, SecurityOptions, Channel, SFTPServer, SSHException, - PasswordRequiredException, BadAuthenticationType, ChannelFile, - SubsystemHandler, AuthHandler, RSAKey, DSSKey, SFTPError, - SFTP, SFTPClient, SFTPServer, Message, Packetizer, SFTPAttributes, - SFTPHandle, SFTPServerInterface, BufferedFile, Agent, AgentKey, - PKey, BaseSFTP, SFTPFile, ServerInterface, HostKeys, SSHClient, - MissingHostKeyPolicy, AutoAddPolicy, RejectPolicy, ChannelException, - SSHConfig, BadHostKeyException, AuthenticationException): - x.__module__ = 'paramiko' +for c in locals().values(): + if issubclass(type(c), type) or type(c).__name__ == 'classobj': + # classobj for exceptions :/ + c.__module__ = __name__ from common import AUTH_SUCCESSFUL, AUTH_PARTIALLY_SUCCESSFUL, AUTH_FAILED, \ OPEN_SUCCEEDED, OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED, OPEN_FAILED_CONNECT_FAILED, \ -- cgit v1.2.3