Skip to content
Snippets Groups Projects
Commit 0889585b authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

util.url: add an 'islocal' method

This returns True if the URL represents a path that can be opened locally,
without needing to go through the entire URL open mechanism.
parent 9139dede
Branches
Tags
No related merge requests found
......@@ -1875,6 +1875,11 @@
return path
return self._origpath
def islocal(self):
'''whether localpath will return something that posixfile can open'''
return (not self.scheme or self.scheme == 'file'
or self.scheme == 'bundle')
def hasscheme(path):
return bool(url(path).scheme)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment