mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Tag release
This commit is contained in:
parent
af3753d079
commit
0cf2089c8d
@ -632,6 +632,10 @@ def main(outfile, args=sys.argv[1:]):
|
||||
except tokenize.TokenError, e:
|
||||
print >> sys.stderr, '%s: %s, line %d, column %d' % (
|
||||
e[0], filename, e[1][0], e[1][1])
|
||||
except IndentationError, e:
|
||||
print >> sys.stderr, '%s: %s, line %s, column %s' % (
|
||||
e[0], filename, e.lineno, e[1][1])
|
||||
|
||||
finally:
|
||||
if closep:
|
||||
fp.close()
|
||||
|
@ -95,11 +95,11 @@ class AddAction(InterfaceAction):
|
||||
for x in books:
|
||||
mi = MetaInformation(None)
|
||||
mi.isbn = x['isbn']
|
||||
db = self.gui.library_view.model().db
|
||||
if x['path'] is not None:
|
||||
ids.add(self.gui.library_view.model().db.import_book(mi, [x['path']]))
|
||||
os.remove(x['path'])
|
||||
else:
|
||||
ids.add(self.gui.library_view.model().db.import_book(mi, []))
|
||||
ids.add(db.import_book(mi, [x['path']]))
|
||||
else:
|
||||
ids.add(db.import_book(mi, []))
|
||||
self.gui.library_view.model().books_added(len(books))
|
||||
self.gui.iactions['Edit Metadata'].do_download_metadata(ids)
|
||||
|
||||
|
@ -12,7 +12,6 @@ from PyQt4.Qt import QDialog, QApplication
|
||||
from calibre.gui2.dialogs.add_from_isbn_ui import Ui_Dialog
|
||||
from calibre.ebooks.metadata import check_isbn
|
||||
from calibre.constants import iswindows
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
|
||||
class AddFromISBN(QDialog, Ui_Dialog):
|
||||
|
||||
@ -56,10 +55,7 @@ class AddFromISBN(QDialog, Ui_Dialog):
|
||||
book = {'isbn': isbn, 'path': None}
|
||||
if len(parts) > 1 and parts[1] and \
|
||||
os.access(parts[1], os.R_OK) and os.path.isfile(parts[1]):
|
||||
pt = PersistentTemporaryFile(os.path.splitext(parts[1])[1])
|
||||
pt.write(open(parts[1], 'rb').read())
|
||||
pt.close()
|
||||
book['path'] = pt.name
|
||||
book['path'] = parts[1]
|
||||
self.books.append(book)
|
||||
QDialog.accept(self, *args)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user