adasilva / journal2ebook

optimize academic pdfs for e-readers
Other
107 stars 12 forks source link

Error when cancel new file open then try to run coversion #25

Closed adasilva closed 11 years ago

adasilva commented 11 years ago

Accidentally pressed New File and chose an invalid filename. Then clicked Ready to convert. Received this error:

Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1473, in call return self.func(*args) File "journal2ebook.py", line 497, in bReadyClick subprocess.call(['k2pdfopt','-x','-col', str(n), '-ml', str(leftmargin), '-mr', str(rightmargin), '-mt', str(topmargin), '-mb', str(bottommargin), '-ui-','-o', newFileName, '"'+self.filename+'.pdf"']) TypeError: cannot concatenate 'str' and 'tuple' objects

jasongullifer commented 11 years ago

Maybe we need a check to ensure that the file exists? If that check fails, bring up the choose file window again?

something like

if not os.path.isfile(filename):