Ejemplo n.º 1
0
 def mad_apk_download(self, *args, **kwargs):
     parsed = parse_frontend(**kwargs)
     if type(parsed) == Response:
         return parsed
     apk_type, apk_arch = parsed
     return stream_package(self._db_wrapper, self.__storage_obj, apk_type,
                           apk_arch)
Ejemplo n.º 2
0
 def get(self, apk_type: APK_Type, apk_arch: APK_Arch):
     if flask.request.url.split('/')[-1] == 'download':
         return stream_package(self.dbc, self.storage_obj, apk_type,
                               apk_arch)
     else:
         data = get_apk_status(self.storage_obj)
         if apk_type is None and apk_arch is APK_Arch.noarch:
             return (get_apk_status(self.storage_obj), 200)
         else:
             try:
                 return (data[apk_type][apk_arch], 200)
             except KeyError:
                 return (data[apk_type], 200)