Beispiel #1
0
    def loadAll(self):
        if not self.data_loaded:
            self.all_books = []
            filepaths = self._get_list_of_logs()
            for item in filepaths:
                if not '#DNF' in item:
                    self.all_books.append(Book.from_filepath(item))
                else:
                    print("Skipping discontinued book.")

            # sort the books
            self.all_books.sort()

            # print the index
            print("=====================")
            print("OVERVIEW OF BOOKS:")
            for e, book in enumerate(self.all_books):
                print(f"* ({e+1}) {book.title}")
            print("=====================")
            self.data_loaded = True

            self.CalculateStats()