def response_soup(self): "Returns a BeautifulSoup object of the response." if not self._response_soup: try: from bs4 import BeautifulStoneSoup except ImportError: from BeautifulSoup import BeautifulStoneSoup log.warn('DeprecationWarning: BeautifulSoup 3 or earlier is deprecated; install bs4 instead\n') self._response_soup = BeautifulStoneSoup( smart_decode(self.response_content) ) return self._response_soup
def response_soup(self): "Returns a BeautifulSoup object of the response." if not self._response_soup: try: from bs4 import BeautifulStoneSoup except ImportError: from BeautifulSoup import BeautifulStoneSoup log.warn( 'DeprecationWarning: BeautifulSoup 3 or earlier is deprecated; install bs4 instead\n' ) self._response_soup = BeautifulStoneSoup( smart_decode(self.response_content)) return self._response_soup
def error(self): "Builds and returns the api error message." error_array = [] if self._response_error: error_array.append(self._response_error) error_array.extend(self._get_resp_body_errors()) if len(error_array) > 0: # Force all errors to be unicode in a proper way error_array = [smart_decode(smart_encode(e)) for e in error_array] error_string = u"{verb}: {message}".format(verb=self.verb, message=u", ".join(error_array)) return error_string return None
def error(self): "Builds and returns the api error message." error_array = [] if self._response_error: error_array.append(self._response_error) error_array.extend(self._get_resp_body_errors()) if len(error_array) > 0: # Force all errors to be unicode in a proper way error_array = [smart_decode(smart_encode(e)) for e in error_array] error_string = u"{verb}: {message}".format( verb=self.verb, message=u", ".join(error_array)) return error_string return None