def update_avatar(self):
def do_update_avatar(info, error=None):<EOL><INDENT>if error or not info:<EOL><INDENT>logger.error('<STR_LIT>' %<EOL>(info, error))<EOL><DEDENT>else:<EOL><INDENT>uk, uname, img_path = info<EOL>self.img_avatar.set_from_file(img_path)<EOL>self.img_avatar.props.tooltip_text = '<STR_LIT:\n>'.join([<EOL>self.profile['<STR_LIT:username>'],<EOL>uname,<EOL>])<EOL><DEDENT><DEDENT>if not self.profile['<STR_LIT>']:<EOL><INDENT>return<EOL><DEDENT>self.img_avatar.props.tooltip_text = '<STR_LIT>'<EOL>cache_path = Config.get_cache_path(self.profile['<STR_LIT:username>'])<EOL>gutil.async_call(gutil.update_avatar, self.cookie, self.tokens,<EOL>cache_path, callback=do_update_avatar)<EOL>
更新用户头像