def update_(self): active_downloads = api.get_active_downloads() api.update_active_downloads() for download_item in active_downloads.itervalues(): row = self.rows_buffer[download_item.id] #row[0] = download_item.id row[1] = self.icons_dict[download_item.status] row[2] = download_item.name #row[3][0] = download_item.host row[3][1] = self.icons_dict[ cons.DL_RESUME] if download_item.can_resume else None row[3][2] = self.icons_dict[ cons.DL_PREMIUM] if download_item.is_premium else None row[4] = utils.size_format( download_item.size) if download_item.size else None row[5] = utils.size_format( download_item.size_complete ) if download_item.size_complete else None row[6] = download_item.progress row[7] = utils.time_format( download_item.time) if download_item.time else None row[8] = utils.time_format(download_item.time_remain ) if download_item.time_remain else None row[9] = utils.speed_format( download_item.speed) if download_item.speed else None row[10] = self.get_status_msg(download_item) self.__model.refresh()
def update_(self): active_downloads = api.get_active_downloads() api.update_active_downloads() for download_item in active_downloads.itervalues(): row = self.rows_buffer[download_item.id] #row[0] = download_item.id row[1] = self.icons_dict[download_item.status] row[2] = download_item.name #row[3][0] = download_item.host row[3][1] = self.icons_dict[cons.DL_RESUME] if download_item.can_resume else None row[3][2] = self.icons_dict[cons.DL_PREMIUM] if download_item.is_premium else None row[4] = utils.size_format(download_item.size) if download_item.size else None row[5] = utils.size_format(download_item.size_complete) if download_item.size_complete else None row[6] = download_item.progress row[7] = utils.time_format(download_item.time) if download_item.time else None row[8] = utils.time_format(download_item.time_remain) if download_item.time_remain else None row[9] = utils.speed_format(download_item.speed) if download_item.speed else None row[10] = self.get_status_msg(download_item) self.__model.refresh()
def update_(self): active_downloads = api.get_active_downloads() api.update_active_downloads() for download_item in active_downloads.itervalues(): try: row = self.rows_buffer[download_item.id] #row[0] = download_item.id #this column is hidden and wont be modificated. row[1] = self.icons_dict[download_item.status] #col 1 row[2] = download_item.name #col 2 #row[3][0] = download_item.host #download_item.host #col 3 row[3][1] = self.icons_dict[cons.DL_RESUME] if download_item.can_resume else None #download_item.host #col 3 row[3][2] = self.icons_dict[cons.DL_PREMIUM] if download_item.is_premium else None #download_item.host #col 3 row[4] = misc.size_format(download_item.size) if download_item.size else None row[5] = misc.size_format(download_item.size_complete) if download_item.size_complete else None row[6] = download_item.progress row[7] = misc.time_format(download_item.time) if download_item.time else None row[8] = misc.time_format(download_item.time_remain) if download_item.time_remain else None row[9] = misc.speed_format(download_item.speed) if download_item.speed else None row[10] = self.get_status_msg(download_item) except KeyError as err: logger.debug(err) #uncomment if model doesnt get upated. self.__model.refresh()