Nook driver: Fix books sent via calibre not appearing under My Files on the Glowlight 3 Plus

This commit is contained in:
Kovid Goyal 2017-12-06 08:28:16 +05:30
parent 9ede39bcd1
commit 8cc31fa4d4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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: