mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Allow passing multiple filenames as command line arguments to calibre to add multiple books. Fixes #907968 (Right click open with)
This commit is contained in:
parent
146e4812b4
commit
f33ed84cd3
@ -143,12 +143,11 @@ class GuiRunner(QObject):
|
|||||||
add_filesystem_book = partial(main.iactions['Add Books'].add_filesystem_book, allow_device=False)
|
add_filesystem_book = partial(main.iactions['Add Books'].add_filesystem_book, allow_device=False)
|
||||||
sys.excepthook = main.unhandled_exception
|
sys.excepthook = main.unhandled_exception
|
||||||
if len(self.args) > 1:
|
if len(self.args) > 1:
|
||||||
p = os.path.abspath(self.args[1])
|
files = [os.path.abspath(p) for p in self.args[1:] if not
|
||||||
if os.path.isdir(p):
|
os.path.isdir(p)]
|
||||||
prints('Ignoring directory passed as command line argument:',
|
if len(files) < len(sys.argv[1:]):
|
||||||
self.args[1])
|
prints('Ignoring directories passed as command line arguments')
|
||||||
else:
|
add_filesystem_book(files)
|
||||||
add_filesystem_book(p)
|
|
||||||
self.app.file_event_hook = add_filesystem_book
|
self.app.file_event_hook = add_filesystem_book
|
||||||
self.main = main
|
self.main = main
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user