From 85212fb0c1478da590a14ef5da325f565755837a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Oct 2012 18:39:39 +0530 Subject: [PATCH] Add an output profile for the Kindle PaperWhite --- src/calibre/customize/profiles.py | 13 ++++++++++++- src/calibre/gui2/wizard/__init__.py | 9 +++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 78b61d4345..00ec6294fb 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -654,6 +654,17 @@ class KindleDXOutput(OutputProfile): return u'%s
%s' % (', '.join(tags), 'ttt '.join(tags)+'ttt ') +class KindlePaperWhiteOutput(KindleOutput): + + name = 'Kindle PaperWhite' + short_name = 'kindle_pw' + description = _('This profile is intended for the Amazon Kindle PaperWhite') + + # Screen size is a best guess + screen_size = (658, 940) + dpi = 212.0 + comic_screen_size = screen_size + class KindleFireOutput(KindleDXOutput): name = 'Kindle Fire' @@ -766,6 +777,6 @@ output_profiles = [OutputProfile, SonyReaderOutput, SonyReader300Output, SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput, IRexDR1000Output, IRexDR800Output, JetBook5Output, NookOutput, BambookOutput, NookColorOutput, PocketBook900Output, GenericEink, - GenericEinkLarge, KindleFireOutput] + GenericEinkLarge, KindleFireOutput, KindlePaperWhiteOutput] output_profiles.sort(cmp=lambda x,y:cmp(x.name.lower(), y.name.lower())) diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index 784b899464..b5d71dd9aa 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -85,7 +85,7 @@ class Kindle(Device): output_profile = 'kindle' output_format = 'MOBI' - name = 'Kindle Paperwhite/Touch/1-4' + name = 'Kindle Touch/1-4' manufacturer = 'Amazon' id = 'kindle' @@ -118,6 +118,11 @@ class KindleFire(KindleDX): output_profile = 'kindle_fire' supports_color = True +class KindlePW(Kindle): + name = 'Kindle PaperWhite' + id = 'kindle_pw' + output_profile = 'kindle_pw' + class Sony505(Device): output_profile = 'sony' @@ -550,7 +555,7 @@ class DevicePage(QWizardPage, DeviceUI): def nextId(self): idx = list(self.device_view.selectionModel().selectedIndexes())[0] dev = self.dev_model.data(idx, Qt.UserRole) - if dev in (Kindle, KindleDX): + if dev in (Kindle, KindleDX, KindleFire, KindlePW): return KindlePage.ID if dev is iPhone: return StanzaPage.ID