def do_command(self):
     super(MarkCompletedCommand, self).do_command()
     for task in self.items:
         if task.completed():
             task.setCompletionDate(date.Date())
         else:
             task.setCompletionDate()
 def edit(self, tasks=None, edits=None):
     tasks = tasks or []
     editcommand = command.EditTaskCommand(self.taskList, tasks)
     for task in tasks:
         task.setSubject('New subject')
         task.setDescription('New description')
         task.setBudget(date.TimeDelta(hours=1))
         task.setCompletionDate()
         att = attachment.FileAttachment('attachment')
         if att in task.attachments():
             task.removeAttachments(att)
         else:
             task.addAttachments(att)
         if self.category in task.categories():
             task.removeCategory(self.category)
         else:
             task.addCategory(self.category)
         for edit in edits or []:
             edit()
     editcommand.do()