#NEWLINE# @ internationalizeDocstring #NEWLINE# def remove( self , irc , msg , args , user , tasks ) : #NEWLINE# #INDENT# '<task id> [<task id> ...]\n\n        Removes <task id> from your personal todo list.\n        ' #NEWLINE# invalid = [ ] #NEWLINE# for taskid in tasks : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . db . get ( user . id , taskid ) #NEWLINE# #UNINDENT# except dbi . NoRecordError : #NEWLINE# #INDENT# invalid . append ( taskid ) #NEWLINE# #UNINDENT# #UNINDENT# if ( taskid and ( len ( invalid ) == 1 ) ) : #NEWLINE# #INDENT# irc . error ( format ( _ ( "Task %i could not be removed either because that id doesn't exist or it has been removed already." ) , invalid [ 0 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if invalid : #NEWLINE# #INDENT# irc . error ( format ( _ ( 'No tasks were removed because the following tasks could not be removed: %L.' ) , invalid ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for taskid in tasks : #NEWLINE# #INDENT# self . db . remove ( user . id , taskid ) #NEWLINE# #UNINDENT# irc . replySuccess ( )