def download_manager(ret: Any) -> None: if ret.id: # 没有入口.. download_id = ret.id status = ret.status if download_id is None or status is None: print_error("No id or status specified.") print_success("Download status has been marked as {}".format( DOWNLOAD_CHOICE_LIST_DICT.get(int(status)))) else: status = ret.status status = int(status) if status is not None else None delegate = get_download_class() delegate.download_status(status=status)
def download_manager(ret): if ret.id: # 没有入口.. download_id = ret.id status = ret.status if download_id is None or status is None: print_error('No id or status specified.') # download_obj = NeoDownload.get(_id=download_id) # if not download_obj: # print_error('Download object does not exist.') # print_info('Download Object <{0} - {1}>, Status: {2}'.format(download_obj.name, download_obj.episode, # download_obj.status)) # download_obj.status = status # download_obj.save() print_success('Download status has been marked as {0}'.format( DOWNLOAD_CHOICE_LIST_DICT.get(int(status)))) else: status = ret.status status = int(status) if status is not None else None delegate = get_download_class(instance=False) delegate.download_status(status=status)
def install(): get_download_class(DOWNLOAD_DELEGATE, instance=False).install()
def install() -> None: get_download_class().install()