def _update_config_sets(self,directory,files=None):
if not self._connectToFlickr():<EOL><INDENT>print(("<STR_LIT>"%(directory)))<EOL>return False<EOL><DEDENT>_sets=self._load_sets(directory)<EOL>psets=self._getphotosets()<EOL>db = self._loadDB(directory)<EOL>primary_pid=db[list(db.keys())[<NUM_LIT:0>]]['<STR_LIT>']<EOL>for myset in _sets:<EOL><INDENT>if myset not in psets:<EOL><INDENT>logger.info('<STR_LIT>'%(myset))<EOL>self._createphotoset(myset,primary_pid)<EOL><DEDENT><DEDENT>psets=self._getphotosets()<EOL>for fn in db:<EOL><INDENT>if files and fn not in files:<EOL><INDENT>continue<EOL><DEDENT>pid=db[fn]['<STR_LIT>']<EOL>psets_for_photo=self._getphotosets_forphoto(pid)<EOL>for myset in _sets:<EOL><INDENT>if myset in psets_for_photo:<EOL><INDENT>logger.debug("<STR_LIT>"%(fn,myset))<EOL>continue<EOL><DEDENT>logger.info("<STR_LIT>" %(fn,myset))<EOL>psid=psets[myset]['<STR_LIT:id>']<EOL>logger.debug("<STR_LIT>"%(fn,psid))<EOL>resp=self.flickr.photosets_addPhoto(photoset_id=psid,photo_id=pid)<EOL>if resp.attrib['<STR_LIT>']!='<STR_LIT>':<EOL><INDENT>logger.error("<STR_LIT>",resp.attrib['<STR_LIT>']);<EOL>return False<EOL><DEDENT><DEDENT>for pset in psets_for_photo:<EOL><INDENT>if pset not in _sets:<EOL><INDENT>psid=psets[pset]['<STR_LIT:id>']<EOL>logger.info("<STR_LIT>" %(fn,pset))<EOL>logger.debug("<STR_LIT>"%(fn,psid))<EOL>resp=self.flickr.photosets_removePhoto(photoset_id=psid,photo_id=pid)<EOL>if resp.attrib['<STR_LIT>']!='<STR_LIT>':<EOL><INDENT>logger.error("<STR_LIT>",resp.attrib['<STR_LIT>']);<EOL>return False<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return True<EOL>
Loads set information from file and updates on flickr, 
only reads first line. Format is comma separated eg.
travel, 2010, South Africa, Pretoria
If files is None, will update all files in DB, otherwise
will only update files that are in the flickr DB and files list