mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-13 12:09:35 +03:00
icat kitten: Fix a regression that broke passing directories to icat
Fixes #1683
This commit is contained in:
parent
c509ecca52
commit
c0a96f2087
@ -22,6 +22,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- panel kitten: Fix the contents of the panel kitten not being positioned
|
||||
correctly on the vertical axis
|
||||
|
||||
- icat kitten: Fix a regression that broke passing directories to icat
|
||||
(:iss:`1683`)
|
||||
|
||||
- Linux: Disable the Wayland backend on GNOME by default as GNOME has no
|
||||
support for server side decorations. Can be controlled by
|
||||
:opt:`linux_display_server`.
|
||||
|
@ -270,7 +270,7 @@ help_text = (
|
||||
usage = 'image-file-or-url-or-directory ...'
|
||||
|
||||
|
||||
def process_single_item(item, args, url_pat, maybe_dir=True):
|
||||
def process_single_item(item, args, url_pat=None, maybe_dir=True):
|
||||
is_tempfile = False
|
||||
try:
|
||||
if isinstance(item, bytes):
|
||||
@ -278,7 +278,7 @@ def process_single_item(item, args, url_pat, maybe_dir=True):
|
||||
tf.write(item), tf.close()
|
||||
item = tf.name
|
||||
is_tempfile = True
|
||||
if url_pat.match(item) is not None:
|
||||
if url_pat is not None and url_pat.match(item) is not None:
|
||||
from urllib.request import urlretrieve
|
||||
with NamedTemporaryFile(prefix='url-image-data-', delete=False) as tf:
|
||||
try:
|
||||
@ -300,8 +300,8 @@ def process_single_item(item, args, url_pat, maybe_dir=True):
|
||||
process(item, args, is_tempfile)
|
||||
else:
|
||||
if maybe_dir and os.path.isdir(item):
|
||||
for x in scan(item):
|
||||
process_single_item(item, args, url_pat, maybe_dir=False)
|
||||
for (x, mt) in scan(item):
|
||||
process_single_item(x, args, url_pat=None, maybe_dir=False)
|
||||
else:
|
||||
process(item, args, is_tempfile)
|
||||
finally:
|
||||
|
Loading…
Reference in New Issue
Block a user