def get_files_size_with_absolute_path_list(files_name_absolute_path):
    files_size_list = []
    for i in range(len(files_name_absolute_path)):
        file_name_absolute = files_name_absolute_path[i]
        file_size_bytes = os.path.getsize(file_name_absolute)
        files_size_list.append(
            get_readable_filesize(size_bytes=file_size_bytes))
    return files_size_list
 def update_total_size(self, files_names_absolute_list):
     total_size_bytes = 0
     for i in range(len(files_names_absolute_list)):
         file_size = os.path.getsize(files_names_absolute_list[i])
         total_size_bytes += file_size
     self.total_size_bytes = total_size_bytes
     self.total_size_readable = get_readable_filesize(self.total_size_bytes)
     self.setText(self.total_size_readable)
def get_files_size_list(files_list, folder_path):
    files_size_list = []
    for i in range(len(files_list)):
        file_name_absolute = get_file_name_absolute_path(
            file_name=files_list[i], folder_path=folder_path)
        file_size_bytes = os.path.getsize(file_name_absolute)
        files_size_list.append(
            get_readable_filesize(size_bytes=file_size_bytes))
    return files_size_list
Exemplo n.º 4
0
 def set_row_value_size_after_muxing(self, finished_job: SingleJobData,
                                     row_index):
     if finished_job.used_mkvpropedit:
         output_video_name_absolute = Path(finished_job.video_name_absolute)
     else:
         folder_path = Path(GlobalSetting.DESTINATION_FOLDER_PATH)
         output_video_name = Path(
             change_file_extension_to_mkv(finished_job.video_name))
         output_video_name_absolute = os.path.join(folder_path,
                                                   output_video_name)
     try:
         output_video_size_bytes = os.path.getsize(
             output_video_name_absolute)
     except:
         output_video_size_bytes = 0
     if output_video_size_bytes == 0:
         self.delete_video_output_with_zero_size(
             file_path=output_video_name_absolute)
     size_after_muxing = " " + get_readable_filesize(
         output_video_size_bytes)
     self.setCellWidget(row_index, self.column_ids["Size After"],
                        QLabel(size_after_muxing))
 def attachment_unchecked(self, file_absolute_name):
     file_size = os.path.getsize(file_absolute_name)
     self.total_size_bytes -= file_size
     self.total_size_readable = get_readable_filesize(self.total_size_bytes)
     self.setText(self.total_size_readable)