mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-25 07:55:36 +01: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
1 changed files with 5 additions and 6 deletions
|
|
@ -143,12 +143,11 @@ def start_gui(self, db):
|
|||
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…
Reference in a new issue