mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -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)
|
||||
sys.excepthook = main.unhandled_exception
|
||||
if len(self.args) > 1:
|
||||
p = os.path.abspath(self.args[1])
|
||||
if os.path.isdir(p):
|
||||
prints('Ignoring directory passed as command line argument:',
|
||||
self.args[1])
|
||||
else:
|
||||
add_filesystem_book(p)
|
||||
files = [os.path.abspath(p) for p in self.args[1:] if not
|
||||
os.path.isdir(p)]
|
||||
if len(files) < len(sys.argv[1:]):
|
||||
prints('Ignoring directories passed as command line arguments')
|
||||
add_filesystem_book(files)
|
||||
self.app.file_event_hook = add_filesystem_book
|
||||
self.main = main
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user