xmyshell 0.2.12__tar.gz → 0.2.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xmyshell-0.2.12/xmyshell.egg-info → xmyshell-0.2.13}/PKG-INFO +1 -1
- {xmyshell-0.2.12 → xmyshell-0.2.13}/pyproject.toml +1 -1
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/kernel.py +19 -8
- {xmyshell-0.2.12 → xmyshell-0.2.13/xmyshell.egg-info}/PKG-INFO +1 -1
- {xmyshell-0.2.12 → xmyshell-0.2.13}/LICENSE +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/README.md +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/setup.cfg +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/__init__.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/__main__.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/completer.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/data/commands.json +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/environment.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/init.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/keybindings.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/lexer.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/main.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/meta.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/stubs/__init__.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/stubs/__init__.pyi +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/stubs/py.typed +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/themes.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/update.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell/utils.py +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell.egg-info/SOURCES.txt +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell.egg-info/dependency_links.txt +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell.egg-info/entry_points.txt +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell.egg-info/requires.txt +0 -0
- {xmyshell-0.2.12 → xmyshell-0.2.13}/xmyshell.egg-info/top_level.txt +0 -0
|
@@ -2,6 +2,7 @@ from collections.abc import Generator, Sequence
|
|
|
2
2
|
from contextlib import contextmanager
|
|
3
3
|
import os
|
|
4
4
|
import sys
|
|
5
|
+
import re
|
|
5
6
|
import runpy
|
|
6
7
|
import subprocess
|
|
7
8
|
import signal
|
|
@@ -322,21 +323,31 @@ def xmyshell(cmd_line: str) -> int:
|
|
|
322
323
|
try:
|
|
323
324
|
target_dir = os.path.expanduser(target_dir)
|
|
324
325
|
# only works on Windows
|
|
325
|
-
if os.name == "nt"
|
|
326
|
-
import re
|
|
327
|
-
|
|
326
|
+
if os.name == "nt":
|
|
328
327
|
if target_dir.startswith("/"):
|
|
329
|
-
m = re.match(r"^/([a-zA-Z])
|
|
328
|
+
m = re.match(r"^/([a-zA-Z])(/.*)?$", target_dir)
|
|
330
329
|
if m:
|
|
331
330
|
drive = m.group(1).upper()
|
|
332
|
-
|
|
333
|
-
|
|
331
|
+
rest = m.group(2) or ""
|
|
332
|
+
target_dir = drive + ":" + rest
|
|
333
|
+
target_dir = target_dir.replace("\\", "/")
|
|
334
|
+
_splited = shlex.split(target_dir)
|
|
335
|
+
if len(_splited) > 1:
|
|
336
|
+
pyerror("too many arguments")
|
|
337
|
+
return -1
|
|
338
|
+
os.chdir(_splited[0])
|
|
334
339
|
return 0
|
|
335
340
|
except FileNotFoundError:
|
|
336
|
-
pyerror(f"file not found:
|
|
341
|
+
pyerror(f"file not found: {target_dir!r}")
|
|
337
342
|
return -1
|
|
338
343
|
except NotADirectoryError:
|
|
339
|
-
pyerror(f"not a directory:
|
|
344
|
+
pyerror(f"not a directory: {target_dir!r}")
|
|
345
|
+
return -1
|
|
346
|
+
except PermissionError:
|
|
347
|
+
pyerror(f"permission denied: {target_dir!r}")
|
|
348
|
+
return -1
|
|
349
|
+
except (OSError, ValueError):
|
|
350
|
+
pyerror(f"wrong path format: {target_dir!r}")
|
|
340
351
|
return -1
|
|
341
352
|
|
|
342
353
|
case "source":
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|