'Returns a list of filename, progress tuples indicating the progress
for every file selected using set_selected_files. Progress is a float
between 0 and 1'

def get_files_completion(self):

    if (len(self.download.get_selected_files()) > 0):
        files = self.download.get_selected_files()
    else:
        files = self.download.get_def().get_files()
    completion = []
    if self.filepieceranges:
        for (t, tl, o, f) in self.filepieceranges:
            if ((f in files) and (self.progress == 1.0)):
                completion.append((f, 1.0))
            else:
                total_pieces = (tl - t)
                if (total_pieces and getattr(self, 'haveslice_total', False)):
                    completed = 0
                    for index in range(t, tl):
                        if self.haveslice_total[index]:
                            completed += 1
                    completion.append((f, (completed / (total_pieces * 1.0))))
                elif (f in files):
                    completion.append((f, 0.0))
    elif files:
        completion.append((files[0], self.get_progress()))
    return completion
