From 208fa578952bf979b1c1bbe2c6516576793d3b1d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 28 Jul 2009 15:02:49 -0600 Subject: [PATCH] Welcome wizard: Non-standard pages (email and web) were not having any effect --- src/calibre/ebooks/conversion/cli.py | 5 ++++- src/calibre/ebooks/conversion/plumber.py | 2 -- src/calibre/gui2/wizard/__init__.py | 11 +++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/calibre/ebooks/conversion/cli.py b/src/calibre/ebooks/conversion/cli.py index 43199a6dea..2ddd8b06ef 100644 --- a/src/calibre/ebooks/conversion/cli.py +++ b/src/calibre/ebooks/conversion/cli.py @@ -14,7 +14,7 @@ from calibre.utils.config import OptionParser from calibre.utils.logging import Log from calibre.constants import preferred_encoding from calibre.customize.conversion import OptionRecommendation - +from calibre import patheq USAGE = '%prog ' + _('''\ input_file output_file [options] @@ -220,6 +220,9 @@ def create_option_parser(args, log): from calibre.ebooks.conversion.plumber import Plumber reporter = ProgressBar(log) + if patheq(input, output): + raise ValueError('Input file is the same as the output file') + plumber = Plumber(input, output, log, reporter) add_input_output_options(parser, plumber) add_pipeline_options(parser, plumber) diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py index f8eba6dac2..cb7cd519f0 100644 --- a/src/calibre/ebooks/conversion/plumber.py +++ b/src/calibre/ebooks/conversion/plumber.py @@ -53,8 +53,6 @@ class Plumber(object): ''' self.input = os.path.abspath(input) self.output = os.path.abspath(output) - if self.input == self.output: - raise ValueError('Input file is the same as the output file') self.log = log self.ui_reporter = report_progress diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index b3f3c94653..8ebb3528d1 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -219,7 +219,7 @@ class KindlePage(QWizardPage, KindleUI): if self.send_email_widget.set_email_settings(True): conf = smtp_prefs() - accounts = conf.get('accounts', {}) + accounts = conf.parse().accounts if not accounts: accounts = {} for y in accounts.values(): y[2] = False @@ -494,6 +494,9 @@ class FinishPage(QWizardPage, FinishUI): def nextId(self): return -1 + def commit(self): + pass + class Wizard(QWizard): @@ -536,7 +539,11 @@ class Wizard(QWizard): def accept(self): - self.device_page.commit() + pages = map(self.page, self.visitedPages()) + for page in pages: + if page is not self.library_page: + page.commit() + if not self.library_page.commit(self.completed): self.completed(None)