#NEWLINE# def executeTask( taskname , **kwargs ) : #NEWLINE# #INDENT# 'Executes the given task by name with any optional named arguments' #NEWLINE# if ( taskname in __taskRegistry ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# camelCaseArgs = { Util . camelize ( key ) : kwargs [ key ] for key in kwargs } #NEWLINE# __taskRegistry [ taskname ] ( ** camelCaseArgs ) #NEWLINE# #UNINDENT# except UserError as err : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# Console . error ( ( 'Unexpected error! Could not finish task %s successfully!' % taskname ) ) #NEWLINE# raise #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise UserError ( ( 'No such task: %s' % taskname ) )