#NEWLINE# def load( self , irc , msg , args , optlist , name ) : #NEWLINE# #INDENT# "[--deprecated] <plugin>\n\n        Loads the plugin <plugin> from any of the directories in\n        conf.supybot.directories.plugins; usually this includes the main\n        installed directory and 'plugins' in the current directory.\n        --deprecated is necessary if you wish to load deprecated plugins.\n        " #NEWLINE# ignoreDeprecation = False #NEWLINE# for ( option , argument ) in optlist : #NEWLINE# #INDENT# if ( option == 'deprecated' ) : #NEWLINE# #INDENT# ignoreDeprecation = True #NEWLINE# #UNINDENT# #UNINDENT# if name . endswith ( '.py' ) : #NEWLINE# #INDENT# name = name [ : ( - 3 ) ] #NEWLINE# #UNINDENT# if irc . getCallback ( name ) : #NEWLINE# #INDENT# irc . error ( ( '%s is already loaded.' % name . capitalize ( ) ) ) #NEWLINE# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# module = plugin . loadPluginModule ( name , ignoreDeprecation ) #NEWLINE# #UNINDENT# except plugin . Deprecated : #NEWLINE# #INDENT# irc . error ( ( '%s is deprecated.  Use --deprecated to force it to load.' % name . capitalize ( ) ) ) #NEWLINE# return #NEWLINE# #UNINDENT# except ImportError as e : #NEWLINE# #INDENT# if str ( e ) . endswith ( name ) : #NEWLINE# #INDENT# irc . error ( ( 'No plugin named %s exists.' % utils . str . dqrepr ( name ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( "No module named 'config'" in str ( e ) ) : #NEWLINE# #INDENT# irc . error ( 'This plugin may be incompatible with your current Python version. Try running 2to3 on it.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# irc . error ( str ( e ) ) #NEWLINE# #UNINDENT# #UNINDENT# return #NEWLINE# #UNINDENT# cb = plugin . loadPluginClass ( irc , module ) #NEWLINE# name = cb . name ( ) #NEWLINE# conf . registerPlugin ( name , True ) #NEWLINE# irc . replySuccess ( )