def loadPlugIn(self, path): """ Loads and returns the given plug-in. May return None if loading was unsuccessful (in which case this method prints a message saying so). Used by loadPlugIns(). """ plugIn = None path = self.serverSidePath(path) try: plugIn = PlugIn(self, path) willNotLoadReason = plugIn.load() if willNotLoadReason: print ' Plug-in %s cannot be loaded because:\n %s' % ( path, willNotLoadReason) return None plugIn.install() except: import traceback traceback.print_exc(file=sys.stderr) self.error('Plug-in %s raised exception.' % path) return plugIn
def loadPlugIn(self, name, module, verbose=True): """Load and return the given plug-in. May return None if loading was unsuccessful (in which case this method prints a message saying so). Used by `loadPlugIns` (note the **s**). """ try: plugIn = PlugIn(self.app, name, module) willNotLoadReason = plugIn.load(verbose=verbose) if willNotLoadReason: print(f' Plug-in {name} cannot be loaded because:\n' f' {willNotLoadReason}') return None plugIn.install() except Exception: print() print(f'Plug-in {name} raised exception.') raise return plugIn
def loadPlugIn(self, path): """Load and return the given plug-in. May return None if loading was unsuccessful (in which case this method prints a message saying so). Used by `loadPlugIns` (note the **s**). """ path = self.serverSidePath(path) try: plugIn = PlugIn(self, path) willNotLoadReason = plugIn.load() if willNotLoadReason: print (' Plug-in %s cannot be loaded because:\n' ' %s' % (path, willNotLoadReason)) return None plugIn.install() except Exception: print print 'Plug-in', path, 'raised exception.' raise return plugIn