mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-30 05:18:51 -06:00
fix: read a typed folder the same in both modes
Line mode dropped quotes only when both ends had one, so a half-selected paste made a folder whose name starts with a quote. The screen's reader is now the only one: any quote at either end goes, variables expand before ~.
This commit is contained in:
1 parent
ee2e6e80ce
commit
8c74f3f0bc
7 files changed
+27
-31
No files matched your search
@@ -19,13 +19,12 @@ def _typed_folder(raw: str) -> Path:
|
||||
|
||||
Explorer's "Copy as path" puts quotes around it, and users quote a path
|
||||
with spaces: kept, they sent the files into a folder named `"` under
|
||||
the current directory, and the run said Done.
|
||||
the current directory, and the run said Done. A half-selected copy
|
||||
quotes one end only.
|
||||
"""
|
||||
text = raw.strip()
|
||||
if len(text) >= 2 and text[0] == text[-1] and text[0] in "'\"":
|
||||
text = text[1:-1].strip()
|
||||
text = raw.strip().strip("\"'").strip()
|
||||
# Under WSL, D: and D:\ are the Windows drive the screen calls D:.
|
||||
return _host_path(os.path.expandvars(os.path.expanduser(text)))
|
||||
return _host_path(os.path.expanduser(os.path.expandvars(text)))
|
||||
|
||||
|
||||
def _ask(prompt: str) -> str:
|
||||
|
||||
Reference in new issue
Block a user