mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-10 18:48:54 +02:00
icat: Add support for file:// URLs as well
This commit is contained in:
@@ -339,6 +339,16 @@ def main(args=sys.argv):
|
||||
item = tf.name
|
||||
is_tempfile = True
|
||||
process(item, args, is_tempfile)
|
||||
elif item.lower().startswith('file://'):
|
||||
from urllib.parse import urlparse
|
||||
from urllib.request import url2pathname
|
||||
item = urlparse(item)
|
||||
if os.sep == '\\':
|
||||
item = item.netloc + item.path
|
||||
else:
|
||||
item = item.path
|
||||
item = url2pathname(item)
|
||||
process(item, args, is_tempfile)
|
||||
else:
|
||||
if os.path.isdir(item):
|
||||
for x in scan(item):
|
||||
|
||||
Reference in New Issue
Block a user