def _update_config_location(self,directory,files=None):
if not self._connectToFlickr():<EOL><INDENT>print(("<STR_LIT>"%(filename)))<EOL>return False<EOL><DEDENT>fullfile=os.path.join(directory,LOCATION_FILE)<EOL>try:<EOL><INDENT>location=open(fullfile).readline().strip()<EOL><DEDENT>except:<EOL><INDENT>logger.info('<STR_LIT>');<EOL>return False<EOL><DEDENT>logger.debug('<STR_LIT>'%(location))<EOL>try:<EOL><INDENT>results = Geocoder.geocode(location)<EOL><DEDENT>except:<EOL><INDENT>logger.error("<STR_LIT>"%(location))<EOL>return False<EOL><DEDENT>logger.debug('<STR_LIT>'%(results[<NUM_LIT:0>]))<EOL>_lat,_lon=results[<NUM_LIT:0>].coordinates<EOL>placename=results[<NUM_LIT:0>]<EOL>db = self._loadDB(directory)<EOL>for fn in db:<EOL><INDENT>if files and fn not in files:<EOL><INDENT>continue<EOL><DEDENT>logger.debug('<STR_LIT>'%(fn))<EOL>exif_lat,exif_lon=pusher_utils.getexif_location(directory,fn)<EOL>if exif_lat and exif_lon:<EOL><INDENT>logger.info("<STR_LIT>"%(fn,exif_lat,exif_lon))<EOL>continue<EOL><DEDENT>else:<EOL><INDENT>logger.info("<STR_LIT>"%(fn))<EOL><DEDENT>logger.info("<STR_LIT>"%(fn,_lat,_lon,placename))<EOL>pid=db[fn]['<STR_LIT>']<EOL>resp=self.flickr.photos_geo_setLocation(photo_id=pid,lat=_lat,lon=_lon)<EOL>if resp.attrib['<STR_LIT>']!='<STR_LIT>':<EOL><INDENT>logger.error("<STR_LIT>",resp.attrib['<STR_LIT>']);<EOL>return False<EOL><DEDENT><DEDENT>return True<EOL>
Loads location and applies to all files in given
        files list (or if none, all files in flickr DB)

        google reverse GEO to figure out location lat/long
        file can contain things like:
        Australia
        Sydney, Australia
        Holcomb Campground, California.

        If image already has Lat/Lon in EXIF, it's location will
        not be updated.

        FIXME: Could save location lookup results in .file
        such that other files don't need to do it again