Welcome wizard: Non-standard pages (email and web) were not having any effect

This commit is contained in:
Kovid Goyal 2009-07-28 15:02:49 -06:00
parent 2c25153079
commit 208fa57895
3 changed files with 13 additions and 5 deletions

View File

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

View File

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

View File

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