More work on file transmission

This commit is contained in:
Kovid Goyal
2021-10-29 21:52:49 +05:30
parent 5eb87b9f10
commit ee852cf5fc
3 changed files with 20 additions and 10 deletions

View File

@@ -141,6 +141,10 @@ def home_path() -> str:
return _home or os.path.expanduser('~')
def cwd_path() -> str:
return _cwd or os.getcwd()
def expand_home(path: str) -> str:
if path.startswith('~' + os.sep) or (os.altsep and path.startswith('~' + os.altsep)):
return os.path.join(home_path(), path[2:].lstrip(os.sep + (os.altsep or '')))