Esempio n. 1
0
 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()
Esempio n. 2
0
    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)
        )
Esempio n. 3
0
 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()
Esempio n. 4
0
 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()