From 343c0a8d1b06dcd0039e49d7b51075e6068b4b95 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 7 Oct 2012 14:28:02 +0530 Subject: [PATCH] Kobo driver: Delay load a few depenencies to lower startup time of calibre worker processes --- src/calibre/devices/kobo/driver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index f4128d2fdc..9805510c9f 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -12,19 +12,17 @@ Originally developed by Timothy Legge . Extended to support Touch firmware 2.0.0 and later and newer devices by David Forrester ''' -import os, time, calendar +import os, time from contextlib import closing from calibre.devices.usbms.books import BookList from calibre.devices.usbms.books import CollectionsBookList from calibre.devices.kobo.books import KTCollectionsBookList from calibre.devices.kobo.books import Book from calibre.devices.kobo.books import ImageWrapper -from calibre.devices.kobo.bookmark import Bookmark from calibre.devices.mime import mime_type_ext from calibre.devices.usbms.driver import USBMS, debug_print from calibre import prints from calibre.ptempfile import PersistentTemporaryFile - from calibre.constants import DEBUG from calibre.utils.config import prefs @@ -994,6 +992,7 @@ class KOBO(USBMS): return USBMS.create_annotations_path(self, mdata) def get_annotations(self, path_map): + from calibre.devices.kobo.bookmark import Bookmark EPUB_FORMATS = [u'epub'] epub_formats = set(EPUB_FORMATS) @@ -1056,6 +1055,7 @@ class KOBO(USBMS): return bookmarked_books def generate_annotation_html(self, bookmark): + import calendar from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag, NavigableString # Returns
...
#last_read_location = bookmark.last_read_location