Merge branch 'development' of helene.linode:/mnt/repos/books.alexwlchan.net into...
[books.alexwlchan.net] / scripts / add_book.py
index ad3cde9..aa2f7fa 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import datetime
 import os
@@ -68,10 +68,10 @@ def get_review_info():
     today = datetime.datetime.now()
 
     if date_read == "today":
-        date_read = today.strftime("%Y-%m-%d")
+        date_read = today.date()
     elif date_read == "yesterday":
         yesterday = today - datetime.timedelta(days=1)
-        date_read = yesterday.strftime("%Y-%m-%d")
+        date_read = yesterday.date()
     else:
         date_read_question2 = [
             inquirer.Text("date_read", message="When did you finish reading it?")
@@ -146,6 +146,7 @@ def save_cover(slug, cover_image_url):
 
     return cover_name
 
+
 if __name__ == "__main__":
     book_info = get_book_info()