def _getphotosets(self):
sets={}<EOL>if not self._connectToFB():<EOL><INDENT>print("<STR_LIT>")<EOL>return sets<EOL><DEDENT>psets = self.fb.get_connections(USER_ID,"<STR_LIT>")['<STR_LIT:data>']<EOL>for myset in psets:<EOL><INDENT>key=myset['<STR_LIT:name>']<EOL>sets[key]={}<EOL>try:<EOL><INDENT>sets[key]['<STR_LIT>']=int(myset['<STR_LIT:count>'])<EOL><DEDENT>except:<EOL><INDENT>sets[key]['<STR_LIT>']=<NUM_LIT:0><EOL><DEDENT>try:<EOL><INDENT>sets[key]['<STR_LIT>']=myset['<STR_LIT>']<EOL><DEDENT>except:<EOL><INDENT>sets[key]['<STR_LIT>']=None<EOL><DEDENT>sets[key]['<STR_LIT:id>']=int(myset['<STR_LIT:id>'])<EOL>sets[key]['<STR_LIT:url>']=myset['<STR_LIT>']<EOL><DEDENT>return sets<EOL>
Returns dictionary of photosets retrieved from fb
        d['title']['number_photos'] : Number of photos
        d['title']['id']            : ID of photoset
        d['title']['photo_id']      : ID of primary photo
        d['title']['url']           : URL to photoset