lib.Uri: Treat paths starting with ~" specially #48
1 changed files with 3 additions and 1 deletions
|
|
@ -17,6 +17,8 @@ class Uri:
|
||||||
self, scheme: bool, credentials: bool, secure: bool, path: bool
|
self, scheme: bool, credentials: bool, secure: bool, path: bool
|
||||||
) -> str:
|
) -> str:
|
||||||
ret = ''
|
ret = ''
|
||||||
|
if self.__p.path.startswith('~'):
|
||||||
|
return self.path
|
||||||
if scheme:
|
if scheme:
|
||||||
ret += f'{self.protocol}://'
|
ret += f'{self.protocol}://'
|
||||||
if credentials and self.username:
|
if credentials and self.username:
|
||||||
|
|
@ -62,7 +64,7 @@ class Uri:
|
||||||
@cached_property
|
@cached_property
|
||||||
def scheme(self) -> str:
|
def scheme(self) -> str:
|
||||||
ret = self.__p.scheme
|
ret = self.__p.scheme
|
||||||
if not ret:
|
if not ret and not self.__p.path.startswith('~'):
|
||||||
return 'file'
|
return 'file'
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue