Changeset 17756 in niluje


Ignore:
Timestamp:
Sep 10, 2020, 2:38:59 PM (10 days ago)
Author:
NiLuJe
Message:

Display a progress percentage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Configs/trunk/Kindle/Kobo_Hacks/Patches/koreader_to_nickel.py

    r17746 r17756  
    9191
    9292# And now loop over every book in the History
     93book_i = 0
     94book_total = len(history)
    9395for book in history.values():
     96        book_i+=1
     97
    9498        f = book["file"]
    9599        print("* Checking `{}`".format(f))
     
    116120                continue
    117121
     122        # Make the counter a percentage
     123        spinner = int(book_i / book_total * 100)
    118124        # Okay!
    119125        if "authors" in meta["doc_props"].keys():
     
    123129                if "\\\n" in author:
    124130                        author = author.replace("\\\n", " & ")
    125                 log("Marking `{}` by `{}` as read".format(meta["doc_props"]["title"], author))
     131                log("[{:3d}%] Marking `{}` by `{}` as read".format(spinner, meta["doc_props"]["title"], author))
    126132        else:
    127                 log("Marking `{}` as read".format(meta["doc_props"]["title"]))
     133                log("[{:3d}%] Marking `{}` as read".format(spinner, meta["doc_props"]["title"]))
    128134
    129135        # Convert the last open date into a mostly-accurate representation of the SQL format...
     
    160166                print("SQL update failed!")
    161167
     168log("[100%] Done!")
    162169FBInk.fbink_close(fbfd)
Note: See TracChangeset for help on using the changeset viewer.