diff --git a/src/calibre/devices/kindle/driver.py b/src/calibre/devices/kindle/driver.py index 3b72b9b200..93fa1bd0bf 100644 --- a/src/calibre/devices/kindle/driver.py +++ b/src/calibre/devices/kindle/driver.py @@ -8,9 +8,10 @@ from calibre.devices.kindle.apnx import APNXBuilder Device driver for Amazon's Kindle ''' -import datetime, os, re, json, hashlib, errno +import os, re, json, hashlib, errno from calibre.constants import DEBUG, filesystem_encoding +from calibre.utils.date import utcfromtimestamp from calibre.devices.interface import OpenPopupMessage from calibre.devices.kindle.bookmark import Bookmark from calibre.devices.usbms.driver import USBMS @@ -218,9 +219,9 @@ class KINDLE(USBMS): mc_path = get_my_clippings(storage, bookmarked_books) if mc_path: - timestamp = datetime.datetime.utcfromtimestamp(os.path.getmtime(mc_path)) + timestamp = utcfromtimestamp(os.path.getmtime(mc_path)) bookmarked_books['clippings'] = self.UserAnnotation(type='kindle_clippings', - value=dict(path=mc_path,timestamp=timestamp)) + value=dict(path=mc_path, timestamp=timestamp)) # This returns as job.result in gui2.ui.annotations_fetched(self,job) return bookmarked_books @@ -229,7 +230,7 @@ class KINDLE(USBMS): from calibre.ebooks.BeautifulSoup import BeautifulSoup # Returns
...
last_read_location = bookmark.last_read_location - timestamp = datetime.datetime.utcfromtimestamp(bookmark.timestamp) + timestamp = utcfromtimestamp(bookmark.timestamp) percent_read = bookmark.percent_read ka_soup = BeautifulSoup()