From 8cc31fa4d492ac9c15eb93d4996c1e6f5103bbcd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 6 Dec 2017 08:28:16 +0530 Subject: [PATCH] Nook driver: Fix books sent via calibre not appearing under My Files on the Glowlight 3 Plus --- src/calibre/devices/nook/driver.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/calibre/devices/nook/driver.py b/src/calibre/devices/nook/driver.py index bb6d7fe4dc..7268f6439e 100644 --- a/src/calibre/devices/nook/driver.py +++ b/src/calibre/devices/nook/driver.py @@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en' Device driver for Barns and Nobel's Nook ''' -import os +import os, errno import cStringIO @@ -111,8 +111,13 @@ class NOOK_COLOR(NOOK): prints('Opened NOOK with product id:', product_id) if product_id == 0xb: if DEBUG: - prints('Setting Nook upload directory to NOOK') - self.EBOOK_DIR_MAIN = 'NOOK' + prints('Setting Nook upload directory to NOOK/My Files') + self.EBOOK_DIR_MAIN = 'NOOK/My Files' + try: + os.makedirs(os.path.join(self._main_prefix, *self.EBOOK_DIR_MAIN.split('/'))) + except EnvironmentError as err: + if err.errno != errno.EEXIST: + self.EBOOK_DIR_MAIN = 'NOOK' def get_carda_ebook_dir(self, for_upload=False): if for_upload: