def _remove_media(self,directory,files=None):
<EOL>if not self._connectToFlickr():<EOL><INDENT>logger.error("<STR_LIT>")<EOL>return False<EOL><DEDENT>db=self._loadDB(directory)<EOL>if not files:<EOL><INDENT>files=list(db.keys())<EOL><DEDENT>if isinstance(files,str):<EOL><INDENT>files=[files]<EOL><DEDENT>for fn in files:<EOL><INDENT>print(("<STR_LIT>"%(fn)))<EOL>try:<EOL><INDENT>pid=db[fn]['<STR_LIT>']<EOL><DEDENT>except:<EOL><INDENT>logger.debug("<STR_LIT>"%(fn))<EOL>continue<EOL><DEDENT>resp=self.flickr.photos_delete(photo_id=pid,format='<STR_LIT>')<EOL>if resp.attrib['<STR_LIT>']!='<STR_LIT>':<EOL><INDENT>print(("<STR_LIT>",resp.attrib['<STR_LIT>']));<EOL>return False<EOL><DEDENT>else:<EOL><INDENT>logger.debug('<STR_LIT>'%(fn))<EOL>del db[fn]<EOL>self._saveDB(directory,db)<EOL><DEDENT><DEDENT>return True<EOL>
Removes specified files from flickr