#NEWLINE# def invoke( self , command , args ) : #NEWLINE# #INDENT# 'Invoke ``command``, or throw a CommandError.\n\n        This is essentially a simple validation mechanism. Feel free\n        to call the individual command methods manually.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# function = self . commands [ command ] #NEWLINE# #UNINDENT# except KeyError as e : #NEWLINE# #INDENT# raise CommandError ( ( 'unknown command: %s' % e ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return function ( ** args )