finalizes some code, changes name, and adds shebang
This commit is contained in:
parent
3d72386e87
commit
58c367dc4c
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
import csv
|
||||
|
||||
read_books = []
|
||||
|
@ -34,8 +35,9 @@ def sort_books():
|
|||
|
||||
def write_file():
|
||||
gemini_file = open("reading.gmi", "w")
|
||||
gemini_file.write("# Reading List\n")
|
||||
gemini_file.write("# swiftmandolin's reading list\n")
|
||||
write_books(gemini_file)
|
||||
write_footer(gemini_file)
|
||||
|
||||
def write_list(title, book_list, file):
|
||||
file.write(f"## {title} ({len(book_list)})\n")
|
||||
|
@ -44,9 +46,13 @@ def write_list(title, book_list, file):
|
|||
file.write("\n")
|
||||
|
||||
def write_books(file):
|
||||
write_list("Currently Reading", current, file)
|
||||
write_list("Want to Read", to_read_books, file)
|
||||
write_list("Finished Reading", read_books, file)
|
||||
write_list("currently reading", current, file)
|
||||
write_list("want to read", to_read_books, file)
|
||||
write_list("finished reading", read_books, file)
|
||||
|
||||
def write_footer(file):
|
||||
file.write("\n")
|
||||
file.write("<= https://git.sr.ht/~swiftmandolin/gemini-goodreads generated from goodreads CSV")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Reference in New Issue