<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def Remove(self,directory,filename):
 """Deletes post from wordpress"""


        db = self._loadDB(directory)

        logger.debug("wp: Attempting to remove %s from wp"%(filename))

        # See if this already exists in our DB
        if db.has_key(filename):
            pid=db[filename]
            logger.debug('wp: Found %s in DB with post id %s'%(filename,pid))
        else:
            print("wp: %s not in our local DB file [%s]"\
                    %(filename,self.DB_FILE))
            return False

        self._connectToWP()
        self.wp.call(DeletePost(pid))

        del db[filename]
        self._saveDB(directory,db)

        return True