flyshell 1.3.6__tar.gz → 1.3.7__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.
- {flyshell-1.3.6/src/flyshell.egg-info → flyshell-1.3.7}/PKG-INFO +1 -1
- {flyshell-1.3.6 → flyshell-1.3.7}/setup.py +0 -1
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/constants.py +2 -2
- flyshell-1.3.7/src/flyshell/native/diskops_bridge.py +49 -0
- flyshell-1.3.7/src/flyshell/startup/__init__.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7/src/flyshell.egg-info}/PKG-INFO +1 -1
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell.egg-info/SOURCES.txt +2 -1
- flyshell-1.3.6/c_src/diskops/shared/placeholder.c +0 -2
- {flyshell-1.3.6 → flyshell-1.3.7}/LICENSE +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/README.md +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/c_src/diskops/diskops.c +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/c_src/diskops/posix/placeholder.c +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/pyproject.toml +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/setup.cfg +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/__init__.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/abstract/__init__.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/abstract/base_cmd.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/abstract/base_plugin.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/abstract/parent_cmd.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/accounts/__init__.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/accounts/auth.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/bin/__init__.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/builtin/__init__.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/builtin/diskops.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/builtin/fs.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/builtin/pkg.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/builtin/system.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/builtin/utils.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/core/__init__.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/core/console.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/core/data.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/core/directory.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/main.py +0 -0
- {flyshell-1.3.6/src/flyshell/startup → flyshell-1.3.7/src/flyshell/native}/__init__.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/startup/deps.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/startup/env.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell/startup/loader.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell.egg-info/dependency_links.txt +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell.egg-info/entry_points.txt +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell.egg-info/requires.txt +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/src/flyshell.egg-info/top_level.txt +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_auth.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_data.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_deps.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_directory.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_diskops.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_env.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_fs.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_loader.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_pkg.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_security.py +0 -0
- {flyshell-1.3.6 → flyshell-1.3.7}/tests/test_utils.py +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# src/flyshell/native/diskops_bridge.py
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
_HAS_NATIVE: bool = False
|
|
6
|
+
_native: Any = None
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
from flyshell.bin import _native_diskops
|
|
10
|
+
|
|
11
|
+
if hasattr(_native_diskops, "ping") and _native_diskops.ping() == 42:
|
|
12
|
+
_native = _native_diskops
|
|
13
|
+
_HAS_NATIVE = True
|
|
14
|
+
except (ImportError, AttributeError):
|
|
15
|
+
_HAS_NATIVE = False
|
|
16
|
+
_native = None
|
|
17
|
+
|
|
18
|
+
ERROR_MAP = {
|
|
19
|
+
-1: ("System Error", "File or path not found"),
|
|
20
|
+
-2: ("System Error", "Permission denied"),
|
|
21
|
+
-3: ("System Error", "Target is a directory, not a file"),
|
|
22
|
+
-4: ("System Error", "Target is not a directory"),
|
|
23
|
+
-5: ("System Error", "Item already exists"),
|
|
24
|
+
-6: ("Directory Error", "Directory is not empty"),
|
|
25
|
+
-7: ("System Error", "Source and destination are the same"),
|
|
26
|
+
-8: ("System Error", "Target file is empty"),
|
|
27
|
+
-9: ("Command Error", "Invalid path syntax or file name"),
|
|
28
|
+
-10: ("System Error", "Cannot move directly across devices or partitions"),
|
|
29
|
+
-11: ("System Error", "File is currently in use or locked by another process"),
|
|
30
|
+
-12: ("System Error", "No space left on device"),
|
|
31
|
+
-13: ("System Error", "Read/write I/O failure"),
|
|
32
|
+
-14: ("System Error", "Failed to decode content as UTF-8"),
|
|
33
|
+
-15: ("System Error", "Failed to launch application or file"),
|
|
34
|
+
-99: ("System Error", "Unexpected native filesystem error"),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def has_native_support() -> bool:
|
|
39
|
+
return _HAS_NATIVE
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def translate_error(code: int, target: str = "") -> tuple[int, str]:
|
|
43
|
+
category, default_msg = ERROR_MAP.get(
|
|
44
|
+
code, ("System Error", "Unknown native error.")
|
|
45
|
+
)
|
|
46
|
+
target_str = f"for '{target}'" if target else ""
|
|
47
|
+
if target_str:
|
|
48
|
+
return (1, f"\n{category}: {default_msg} {target_str}\n")
|
|
49
|
+
return (1, f"\n{category}: {default_msg}.")
|
|
File without changes
|
|
@@ -4,7 +4,6 @@ pyproject.toml
|
|
|
4
4
|
setup.py
|
|
5
5
|
c_src/diskops/diskops.c
|
|
6
6
|
c_src/diskops/posix/placeholder.c
|
|
7
|
-
c_src/diskops/shared/placeholder.c
|
|
8
7
|
src/flyshell/__init__.py
|
|
9
8
|
src/flyshell/constants.py
|
|
10
9
|
src/flyshell/main.py
|
|
@@ -31,6 +30,8 @@ src/flyshell/core/__init__.py
|
|
|
31
30
|
src/flyshell/core/console.py
|
|
32
31
|
src/flyshell/core/data.py
|
|
33
32
|
src/flyshell/core/directory.py
|
|
33
|
+
src/flyshell/native/__init__.py
|
|
34
|
+
src/flyshell/native/diskops_bridge.py
|
|
34
35
|
src/flyshell/startup/__init__.py
|
|
35
36
|
src/flyshell/startup/deps.py
|
|
36
37
|
src/flyshell/startup/env.py
|
|
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
|
|
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
|