<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete(self):
 """ Deletes the directory if it exists. """

        if self.exists:
            logger.info("Deleting %s" % self.path)
            shutil.rmtree(self.path)