Skip to content

Commit

Permalink
[xls] fail on non-local file #2557
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Oct 13, 2024
1 parent 90f7eee commit 035d5dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions visidata/loaders/xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

@VisiData.api
def open_xls(vd, p):
p.is_local() or vd.fail('xls loader does not support remote files')
return XlsIndexSheet(p.base_stem, source=p)

@VisiData.api
def open_xlsx(vd, p):
p.is_local() or vd.fail('xlsx loader does not support remote files')
return XlsxIndexSheet(p.base_stem, source=p)

class XlsxIndexSheet(IndexSheet):
Expand Down
2 changes: 1 addition & 1 deletion visidata/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def is_fifo(self):

def is_local(self):
'Return True if self.filename refers to a file on the local disk.'
return not bool(self.fp) and not bool(self.fptext)
return not bool(self.is_url()) and not bool(self.fp) and not bool(self.fptext)

def is_url(self):
'Return True if the given path appears to be a URL.'
Expand Down

0 comments on commit 035d5dc

Please sign in to comment.