def read_from_fallback(self, basepath, *filename_parts): for filename in filename_parts: basepath += filename response = load_online_fallback(basepath, timeout = 1) if self.is_file_parsable(basepath): return self.parse_content(response.read(), True) else: return response.read()
def return_fallback_content(self, basepath, *filename_parts): for filename_part in filename_parts: basepath += filename_part response = load_online_fallback(basepath, timeout = 1) return self.return_message( response.read(), self.get_mime_typ(basepath) )
def read_from_fallback(self, url): response = load_online_fallback(url, timeout = 1) if self.is_file_parsable(url): return self.parse_content(response.read(), True) else: return response.read()
def read_from_fallback(self, url): response = load_online_fallback(url, timeout=1) if self.is_file_parsable(url): return self.parse_content(response.read(), True) else: return response.read()