flyshell 1.3.13__tar.gz → 1.4.1__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.13/src/flyshell.egg-info → flyshell-1.4.1}/PKG-INFO +28 -6
- {flyshell-1.3.13 → flyshell-1.4.1}/README.md +27 -5
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/diskops.c +21 -26
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/posix/cat.c +5 -5
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/posix/dir.c +9 -9
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/posix/touch.c +3 -3
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/shared/dir_types.c +5 -4
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/shared/dir_types.h +3 -3
- flyshell-1.4.1/c_src/diskops/shared/native_errors.h +108 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/win32/cat.c +8 -14
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/win32/dir.c +6 -6
- {flyshell-1.3.13 → flyshell-1.4.1}/c_src/diskops/win32/touch.c +7 -13
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/constants.py +2 -2
- {flyshell-1.3.13 → flyshell-1.4.1/src/flyshell.egg-info}/PKG-INFO +28 -6
- flyshell-1.3.13/c_src/diskops/shared/native_errors.h +0 -84
- {flyshell-1.3.13 → flyshell-1.4.1}/LICENSE +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/MANIFEST.in +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/pyproject.toml +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/setup.cfg +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/setup.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/abstract/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/abstract/base_cmd.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/abstract/base_plugin.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/abstract/parent_cmd.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/accounts/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/accounts/auth.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/bin/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/builtin/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/builtin/diskops.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/builtin/fs.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/builtin/pkg.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/builtin/system.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/builtin/utils.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/core/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/core/console.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/core/data.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/core/directory.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/main.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/native/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/native/diskops_bridge.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/native/diskops_handler.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/native/legacy/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/native/legacy/diskops.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/startup/__init__.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/startup/deps.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/startup/env.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell/startup/loader.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell.egg-info/SOURCES.txt +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell.egg-info/dependency_links.txt +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell.egg-info/entry_points.txt +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell.egg-info/requires.txt +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/src/flyshell.egg-info/top_level.txt +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_auth.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_data.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_deps.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_directory.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_diskops_ext.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_diskops_lgc.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_diskops_old.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_env.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_fs.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_loader.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_pkg.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_security.py +0 -0
- {flyshell-1.3.13 → flyshell-1.4.1}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flyshell
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: A modular, zero-dependency command-line environment in Python.
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -23,11 +23,11 @@ Dynamic: license-file
|
|
|
23
23
|

|
|
24
24
|

|
|
25
25
|
|
|
26
|
-
> Documentation last updated: v1.
|
|
26
|
+
> Documentation last updated: v1.4.0
|
|
27
27
|
|
|
28
|
-
A modular, zero-dependency command-line environment and extensible runtime interface built in Python.
|
|
28
|
+
A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
|
|
29
29
|
|
|
30
|
-
Flyshell provides a modular, extensible shell environment featuring dynamic runtime plugin loading, session persistence, secure authentication, and cross-platform process isolation, using only
|
|
30
|
+
Flyshell provides a modular, extensible shell environment featuring dynamic runtime plugin loading, session persistence, secure authentication, and cross-platform process isolation, using only standard libraries.
|
|
31
31
|
|
|
32
32
|
No extra packages required, just install and enjoy!
|
|
33
33
|
|
|
@@ -38,6 +38,7 @@ No extra packages required, just install and enjoy!
|
|
|
38
38
|
3. **Secure Authentication**: Flyshell uses salted PBKDF2 HMAC (SHA-256, 600,000 iterations) with constant-time equality comparisons to prevent timing attacks on password information.
|
|
39
39
|
4. **Cross-Platform Support**: Flyshell is fully supported by Windows (NT), macOS (Darwin) and Linux installations with native OS management and POSIX-aware parsing. Note that Flyshell is **not** supported by any other systems.
|
|
40
40
|
5. **State and History Persistence**: Flyshell has a fully encapsulated SQL storage system using SQLite3 providing session metrics and ISO 8601 UTC audit logging.
|
|
41
|
+
6. **Automatic C-Extension Compilation**: If installed via `pip`, Flyshell is distributed with more than 20 wheels suitable for most builds of popular operating systems.
|
|
41
42
|
|
|
42
43
|
## System Requirements
|
|
43
44
|
|
|
@@ -54,6 +55,11 @@ src/
|
|
|
54
55
|
│ ├── base_cmd.py
|
|
55
56
|
│ ├── base_plugin.py
|
|
56
57
|
│ └── parent_cmd.py
|
|
58
|
+
├── accounts/
|
|
59
|
+
│ ├── __init__.py
|
|
60
|
+
│ └── auth.py
|
|
61
|
+
├── bin/
|
|
62
|
+
│ └── __init__.py
|
|
57
63
|
├── builtin/
|
|
58
64
|
│ ├── __init__.py
|
|
59
65
|
│ ├── diskops.py
|
|
@@ -63,11 +69,19 @@ src/
|
|
|
63
69
|
│ └── utils.py
|
|
64
70
|
├── core/
|
|
65
71
|
│ ├── __init__.py
|
|
66
|
-
│ ├── auth.py
|
|
67
72
|
│ ├── console.py
|
|
68
73
|
│ ├── data.py
|
|
74
|
+
│ └── directory.py
|
|
75
|
+
├── native/
|
|
76
|
+
│ ├── legacy/
|
|
77
|
+
│ │ ├── __init__.py
|
|
78
|
+
│ │ └── diskops.py
|
|
79
|
+
│ ├── __init__.py
|
|
80
|
+
│ ├── diskops_bridge.py
|
|
81
|
+
│ └── diskops_handler.py
|
|
82
|
+
├── startup/
|
|
83
|
+
│ ├── __init__.py
|
|
69
84
|
│ ├── deps.py
|
|
70
|
-
│ ├── directory.py
|
|
71
85
|
│ ├── env.py
|
|
72
86
|
│ └── loader.py
|
|
73
87
|
├── __init__.py
|
|
@@ -75,6 +89,8 @@ src/
|
|
|
75
89
|
└── main.py
|
|
76
90
|
```
|
|
77
91
|
|
|
92
|
+
For a full tree, please see `docs/project_structure.md`.
|
|
93
|
+
|
|
78
94
|
## Installing Flyshell
|
|
79
95
|
|
|
80
96
|
There are two methods to install Flyshell.
|
|
@@ -104,6 +120,11 @@ cd flyshell
|
|
|
104
120
|
pip install -e .
|
|
105
121
|
```
|
|
106
122
|
|
|
123
|
+
Flyshell now uses C-binaries, you must compile these:
|
|
124
|
+
```bash
|
|
125
|
+
python setup.py build_ext --inplace
|
|
126
|
+
```
|
|
127
|
+
|
|
107
128
|
After this, you can simply run Flyshell:
|
|
108
129
|
```bash
|
|
109
130
|
flyshell
|
|
@@ -165,6 +186,7 @@ class MyPlugin(BasePlugin):
|
|
|
165
186
|
description = "This is my plugin." # A short one-line explaining what your plugin does
|
|
166
187
|
version = "1.0.0" # Default is 1.0.0
|
|
167
188
|
author = "kianodev" # You can put your name, your GitHub handle, or leave blank to make it 'Unknown'
|
|
189
|
+
identifier = "" # (OPTIONAL) Alternative name for your plugin command (defaults to dir / file name)
|
|
168
190
|
usage = "" # (OPTIONAL) Explain how to use your plugin
|
|
169
191
|
extended_help = "" # (OPTIONAL) A more detailed, multi-line guide containing specific assistance
|
|
170
192
|
api_keys = [] # (OPTIONAL) Define any required key names here. Use get_api_key(key_name) to call the key. Please add all keys in CAPITALS.
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|

|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
> Documentation last updated: v1.
|
|
9
|
+
> Documentation last updated: v1.4.0
|
|
10
10
|
|
|
11
|
-
A modular, zero-dependency command-line environment and extensible runtime interface built in Python.
|
|
11
|
+
A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
|
|
12
12
|
|
|
13
|
-
Flyshell provides a modular, extensible shell environment featuring dynamic runtime plugin loading, session persistence, secure authentication, and cross-platform process isolation, using only
|
|
13
|
+
Flyshell provides a modular, extensible shell environment featuring dynamic runtime plugin loading, session persistence, secure authentication, and cross-platform process isolation, using only standard libraries.
|
|
14
14
|
|
|
15
15
|
No extra packages required, just install and enjoy!
|
|
16
16
|
|
|
@@ -21,6 +21,7 @@ No extra packages required, just install and enjoy!
|
|
|
21
21
|
3. **Secure Authentication**: Flyshell uses salted PBKDF2 HMAC (SHA-256, 600,000 iterations) with constant-time equality comparisons to prevent timing attacks on password information.
|
|
22
22
|
4. **Cross-Platform Support**: Flyshell is fully supported by Windows (NT), macOS (Darwin) and Linux installations with native OS management and POSIX-aware parsing. Note that Flyshell is **not** supported by any other systems.
|
|
23
23
|
5. **State and History Persistence**: Flyshell has a fully encapsulated SQL storage system using SQLite3 providing session metrics and ISO 8601 UTC audit logging.
|
|
24
|
+
6. **Automatic C-Extension Compilation**: If installed via `pip`, Flyshell is distributed with more than 20 wheels suitable for most builds of popular operating systems.
|
|
24
25
|
|
|
25
26
|
## System Requirements
|
|
26
27
|
|
|
@@ -37,6 +38,11 @@ src/
|
|
|
37
38
|
│ ├── base_cmd.py
|
|
38
39
|
│ ├── base_plugin.py
|
|
39
40
|
│ └── parent_cmd.py
|
|
41
|
+
├── accounts/
|
|
42
|
+
│ ├── __init__.py
|
|
43
|
+
│ └── auth.py
|
|
44
|
+
├── bin/
|
|
45
|
+
│ └── __init__.py
|
|
40
46
|
├── builtin/
|
|
41
47
|
│ ├── __init__.py
|
|
42
48
|
│ ├── diskops.py
|
|
@@ -46,11 +52,19 @@ src/
|
|
|
46
52
|
│ └── utils.py
|
|
47
53
|
├── core/
|
|
48
54
|
│ ├── __init__.py
|
|
49
|
-
│ ├── auth.py
|
|
50
55
|
│ ├── console.py
|
|
51
56
|
│ ├── data.py
|
|
57
|
+
│ └── directory.py
|
|
58
|
+
├── native/
|
|
59
|
+
│ ├── legacy/
|
|
60
|
+
│ │ ├── __init__.py
|
|
61
|
+
│ │ └── diskops.py
|
|
62
|
+
│ ├── __init__.py
|
|
63
|
+
│ ├── diskops_bridge.py
|
|
64
|
+
│ └── diskops_handler.py
|
|
65
|
+
├── startup/
|
|
66
|
+
│ ├── __init__.py
|
|
52
67
|
│ ├── deps.py
|
|
53
|
-
│ ├── directory.py
|
|
54
68
|
│ ├── env.py
|
|
55
69
|
│ └── loader.py
|
|
56
70
|
├── __init__.py
|
|
@@ -58,6 +72,8 @@ src/
|
|
|
58
72
|
└── main.py
|
|
59
73
|
```
|
|
60
74
|
|
|
75
|
+
For a full tree, please see `docs/project_structure.md`.
|
|
76
|
+
|
|
61
77
|
## Installing Flyshell
|
|
62
78
|
|
|
63
79
|
There are two methods to install Flyshell.
|
|
@@ -87,6 +103,11 @@ cd flyshell
|
|
|
87
103
|
pip install -e .
|
|
88
104
|
```
|
|
89
105
|
|
|
106
|
+
Flyshell now uses C-binaries, you must compile these:
|
|
107
|
+
```bash
|
|
108
|
+
python setup.py build_ext --inplace
|
|
109
|
+
```
|
|
110
|
+
|
|
90
111
|
After this, you can simply run Flyshell:
|
|
91
112
|
```bash
|
|
92
113
|
flyshell
|
|
@@ -148,6 +169,7 @@ class MyPlugin(BasePlugin):
|
|
|
148
169
|
description = "This is my plugin." # A short one-line explaining what your plugin does
|
|
149
170
|
version = "1.0.0" # Default is 1.0.0
|
|
150
171
|
author = "kianodev" # You can put your name, your GitHub handle, or leave blank to make it 'Unknown'
|
|
172
|
+
identifier = "" # (OPTIONAL) Alternative name for your plugin command (defaults to dir / file name)
|
|
151
173
|
usage = "" # (OPTIONAL) Explain how to use your plugin
|
|
152
174
|
extended_help = "" # (OPTIONAL) A more detailed, multi-line guide containing specific assistance
|
|
153
175
|
api_keys = [] # (OPTIONAL) Define any required key names here. Use get_api_key(key_name) to call the key. Please add all keys in CAPITALS.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
// c_src/diskops/diskops.c
|
|
2
2
|
|
|
3
3
|
#define PY_SSIZE_T_CLEAN
|
|
4
|
-
#include <Python.h>
|
|
5
|
-
#include "shared/native_errors.h"
|
|
6
4
|
#include "shared/dir_types.h"
|
|
5
|
+
#include "shared/native_errors.h"
|
|
6
|
+
#include <Python.h>
|
|
7
7
|
|
|
8
|
-
Result cat(const char*
|
|
8
|
+
Result cat(const char *path, char **out_buf, size_t *out_size);
|
|
9
9
|
|
|
10
|
-
Result touch(const char*
|
|
10
|
+
Result touch(const char *path);
|
|
11
11
|
|
|
12
|
-
Result list_dir(const char*
|
|
12
|
+
Result list_dir(const char *path, DirList *out_list);
|
|
13
13
|
|
|
14
|
-
static PyObject*
|
|
14
|
+
static PyObject *method_ping(PyObject *self, PyObject *args) {
|
|
15
15
|
return PyLong_FromLong(42);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
static PyObject*
|
|
19
|
-
const char*
|
|
18
|
+
static PyObject *method_cat(PyObject *self, PyObject *args) {
|
|
19
|
+
const char *path;
|
|
20
20
|
if (!PyArg_ParseTuple(args, "s", &path)) {
|
|
21
21
|
return NULL;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
char*
|
|
24
|
+
char *buf = NULL;
|
|
25
25
|
size_t size = 0;
|
|
26
26
|
Result res = cat(path, &buf, &size);
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ static PyObject* method_cat(PyObject* self, PyObject* args) {
|
|
|
29
29
|
return Py_BuildValue("(is)", (int)res, "");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
PyObject*
|
|
32
|
+
PyObject *content = PyUnicode_FromStringAndSize(buf, (Py_ssize_t)size);
|
|
33
33
|
free(buf);
|
|
34
34
|
|
|
35
35
|
if (!content) {
|
|
@@ -37,12 +37,12 @@ static PyObject* method_cat(PyObject* self, PyObject* args) {
|
|
|
37
37
|
return Py_BuildValue("(is)", (int)ERR_DECODE, "");
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
PyObject*
|
|
40
|
+
PyObject *ret = Py_BuildValue("(iN)", (int)SUCCESS, content);
|
|
41
41
|
return ret;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
static PyObject*
|
|
45
|
-
const char*
|
|
44
|
+
static PyObject *method_touch(PyObject *self, PyObject *args) {
|
|
45
|
+
const char *path;
|
|
46
46
|
if (!PyArg_ParseTuple(args, "s", &path)) {
|
|
47
47
|
return NULL;
|
|
48
48
|
}
|
|
@@ -51,8 +51,8 @@ static PyObject* method_touch(PyObject* self, PyObject* args) {
|
|
|
51
51
|
return Py_BuildValue("(is)", (int)res, "");
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
static PyObject*
|
|
55
|
-
const char*
|
|
54
|
+
static PyObject *method_dir(PyObject *self, PyObject *args) {
|
|
55
|
+
const char *path;
|
|
56
56
|
if (!PyArg_ParseTuple(args, "s", &path)) {
|
|
57
57
|
return NULL;
|
|
58
58
|
}
|
|
@@ -63,14 +63,14 @@ static PyObject* method_dir(PyObject* self, PyObject* args) {
|
|
|
63
63
|
return Py_BuildValue("(i[])", (int)res);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
PyObject*
|
|
66
|
+
PyObject *py_list = PyList_New((Py_ssize_t)dir_list.count);
|
|
67
67
|
if (!py_list) {
|
|
68
68
|
free_dir_list(&dir_list);
|
|
69
69
|
return Py_BuildValue("(i[])", (int)ERR_IO);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
for (size_t i = 0; i < dir_list.count; ++i) {
|
|
73
|
-
PyObject*
|
|
73
|
+
PyObject *item = Py_BuildValue("(sO)", dir_list.entries[i].name,
|
|
74
74
|
dir_list.entries[i].is_dir ? Py_True : Py_False);
|
|
75
75
|
PyList_SET_ITEM(py_list, i, item);
|
|
76
76
|
}
|
|
@@ -81,19 +81,14 @@ static PyObject* method_dir(PyObject* self, PyObject* args) {
|
|
|
81
81
|
|
|
82
82
|
static PyMethodDef DiskopsMethods[] = {
|
|
83
83
|
{"ping", method_ping, METH_NOARGS, "Health check ping."},
|
|
84
|
-
{"cat",
|
|
84
|
+
{"cat", method_cat, METH_VARARGS, "Read file content natively."},
|
|
85
85
|
{"touch", method_touch, METH_VARARGS, "Touch or create file natively."},
|
|
86
|
-
{"dir",
|
|
86
|
+
{"dir", method_dir, METH_VARARGS, "List directory contents natively."},
|
|
87
87
|
{NULL, NULL, 0, NULL},
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
static struct PyModuleDef diskopsmodule = {
|
|
91
|
-
|
|
92
|
-
"_native_diskops",
|
|
93
|
-
"Flyshell native disk operations.",
|
|
94
|
-
-1,
|
|
95
|
-
DiskopsMethods
|
|
96
|
-
};
|
|
90
|
+
static struct PyModuleDef diskopsmodule = {PyModuleDef_HEAD_INIT, "_native_diskops",
|
|
91
|
+
"Flyshell native disk operations.", -1, DiskopsMethods};
|
|
97
92
|
|
|
98
93
|
PyMODINIT_FUNC PyInit__native_diskops(void) {
|
|
99
94
|
return PyModule_Create(&diskopsmodule);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// c_src/diskops/posix/cat.c
|
|
2
2
|
|
|
3
|
+
#include "../shared/native_errors.h"
|
|
4
|
+
#include <errno.h>
|
|
3
5
|
#include <fcntl.h>
|
|
6
|
+
#include <stdlib.h>
|
|
4
7
|
#include <sys/stat.h>
|
|
5
8
|
#include <unistd.h>
|
|
6
|
-
#include <stdlib.h>
|
|
7
|
-
#include <errno.h>
|
|
8
|
-
#include "../shared/native_errors.h"
|
|
9
9
|
|
|
10
|
-
Result cat(const char*
|
|
10
|
+
Result cat(const char *path, char **out_buf, size_t *out_size) {
|
|
11
11
|
if (!path || !out_buf || !out_size) {
|
|
12
12
|
return ERR_INVALID_PATH;
|
|
13
13
|
}
|
|
@@ -36,7 +36,7 @@ Result cat(const char* path, char** out_buf, size_t* out_size) {
|
|
|
36
36
|
return ERR_EMPTY;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
char*
|
|
39
|
+
char *buf = (char *)malloc(st.st_size + 1);
|
|
40
40
|
if (!buf) {
|
|
41
41
|
close(fd);
|
|
42
42
|
return ERR_IO;
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
#define _POSIX_C_SOURCE 200809L
|
|
4
4
|
#define _GNU_SOURCE
|
|
5
5
|
|
|
6
|
+
#include "../shared/dir_types.h"
|
|
7
|
+
#include "../shared/native_errors.h"
|
|
6
8
|
#include <dirent.h>
|
|
7
|
-
#include <
|
|
9
|
+
#include <errno.h>
|
|
8
10
|
#include <stdlib.h>
|
|
9
11
|
#include <string.h>
|
|
10
|
-
#include <
|
|
11
|
-
#include "../shared/native_errors.h"
|
|
12
|
-
#include "../shared/dir_types.h"
|
|
12
|
+
#include <sys/stat.h>
|
|
13
13
|
|
|
14
|
-
Result list_dir(const char*
|
|
14
|
+
Result list_dir(const char *path, DirList *out_list) {
|
|
15
15
|
if (!path || path[0] == '\0' || !out_list) {
|
|
16
16
|
return ERR_INVALID_PATH;
|
|
17
17
|
}
|
|
@@ -19,19 +19,19 @@ Result list_dir(const char* path, DirList* out_list) {
|
|
|
19
19
|
out_list->entries = NULL;
|
|
20
20
|
out_list->count = 0;
|
|
21
21
|
|
|
22
|
-
DIR*
|
|
22
|
+
DIR *dir = opendir(path);
|
|
23
23
|
if (!dir) {
|
|
24
24
|
return map_posix_errno(errno);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
size_t capacity = 16;
|
|
28
|
-
out_list->entries = (DirEntry*)malloc(capacity * sizeof(DirEntry));
|
|
28
|
+
out_list->entries = (DirEntry *)malloc(capacity * sizeof(DirEntry));
|
|
29
29
|
if (!out_list->entries) {
|
|
30
30
|
closedir(dir);
|
|
31
31
|
return ERR_IO;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
struct dirent*
|
|
34
|
+
struct dirent *entry;
|
|
35
35
|
while ((entry = readdir(dir)) != NULL) {
|
|
36
36
|
if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) {
|
|
37
37
|
continue;
|
|
@@ -39,7 +39,7 @@ Result list_dir(const char* path, DirList* out_list) {
|
|
|
39
39
|
|
|
40
40
|
if (out_list->count >= capacity) {
|
|
41
41
|
capacity *= 2;
|
|
42
|
-
DirEntry*
|
|
42
|
+
DirEntry *resized = (DirEntry *)realloc(out_list->entries, capacity * sizeof(DirEntry));
|
|
43
43
|
if (!resized) {
|
|
44
44
|
closedir(dir);
|
|
45
45
|
free_dir_list(out_list);
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
#define _POSIX_C_SOURCE 200809L
|
|
4
4
|
#define _GNU_SOURCE
|
|
5
5
|
|
|
6
|
+
#include "../shared/native_errors.h"
|
|
7
|
+
#include <errno.h>
|
|
6
8
|
#include <fcntl.h>
|
|
7
9
|
#include <sys/stat.h>
|
|
8
10
|
#include <unistd.h>
|
|
9
|
-
#include <errno.h>
|
|
10
|
-
#include "../shared/native_errors.h"
|
|
11
11
|
|
|
12
|
-
Result touch(const char*
|
|
12
|
+
Result touch(const char *path) {
|
|
13
13
|
if (!path || path[0] == '\0') {
|
|
14
14
|
return ERR_INVALID_PATH;
|
|
15
15
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// c_src/diskops/shared/dir_types.c
|
|
2
2
|
|
|
3
|
-
#include <stdlib.h>
|
|
4
3
|
#include "dir_types.h"
|
|
4
|
+
#include <stdlib.h>
|
|
5
5
|
|
|
6
|
-
void free_dir_list(DirList*
|
|
7
|
-
if (!list)
|
|
6
|
+
void free_dir_list(DirList *list) {
|
|
7
|
+
if (!list)
|
|
8
|
+
return;
|
|
8
9
|
if (list->entries) {
|
|
9
|
-
for (size_t i = 0; i < list
|
|
10
|
+
for (size_t i = 0; i < list->count; ++i) {
|
|
10
11
|
free(list->entries[i].name);
|
|
11
12
|
}
|
|
12
13
|
free(list->entries);
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
#include <stddef.h>
|
|
8
8
|
|
|
9
9
|
typedef struct {
|
|
10
|
-
char*
|
|
10
|
+
char *name;
|
|
11
11
|
bool is_dir;
|
|
12
12
|
} DirEntry;
|
|
13
13
|
|
|
14
14
|
typedef struct {
|
|
15
|
-
DirEntry*
|
|
15
|
+
DirEntry *entries;
|
|
16
16
|
size_t count;
|
|
17
17
|
} DirList;
|
|
18
18
|
|
|
19
|
-
void free_dir_list(DirList*
|
|
19
|
+
void free_dir_list(DirList *list);
|
|
20
20
|
|
|
21
21
|
#endif /* DIR_TYPES_H */
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// c_src/diskops/shared/native_errors.h
|
|
2
|
+
|
|
3
|
+
#ifndef NATIVE_ERRORS_H
|
|
4
|
+
#define NATIVE_ERRORS_H
|
|
5
|
+
|
|
6
|
+
#include <errno.h>
|
|
7
|
+
|
|
8
|
+
#ifdef _WIN32
|
|
9
|
+
#include <windows.h>
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
typedef enum {
|
|
13
|
+
SUCCESS = 0,
|
|
14
|
+
ERR_NOT_FOUND = -1,
|
|
15
|
+
ERR_PERMISSION = -2,
|
|
16
|
+
ERR_IS_DIR = -3,
|
|
17
|
+
ERR_NOT_DIR = -4,
|
|
18
|
+
ERR_EXISTS = -5,
|
|
19
|
+
ERR_NOT_EMPTY = -6,
|
|
20
|
+
ERR_SAME_FILE = -7,
|
|
21
|
+
ERR_EMPTY = -8,
|
|
22
|
+
ERR_INVALID_PATH = -9,
|
|
23
|
+
ERR_XDEV = -10,
|
|
24
|
+
ERR_BUSY = -11,
|
|
25
|
+
ERR_NO_SPACE = -12,
|
|
26
|
+
ERR_IO = -13,
|
|
27
|
+
ERR_DECODE = -14,
|
|
28
|
+
ERR_LAUNCH_FAIL = -15,
|
|
29
|
+
ERR_UNKNOWN = -99
|
|
30
|
+
} Result;
|
|
31
|
+
|
|
32
|
+
static inline Result map_posix_errno(int err) {
|
|
33
|
+
switch (err) {
|
|
34
|
+
case 0:
|
|
35
|
+
return SUCCESS;
|
|
36
|
+
case ENOENT:
|
|
37
|
+
return ERR_NOT_FOUND;
|
|
38
|
+
case EACCES:
|
|
39
|
+
case EPERM:
|
|
40
|
+
return ERR_PERMISSION;
|
|
41
|
+
case EISDIR:
|
|
42
|
+
return ERR_IS_DIR;
|
|
43
|
+
case ENOTDIR:
|
|
44
|
+
return ERR_NOT_DIR;
|
|
45
|
+
case EEXIST:
|
|
46
|
+
return ERR_EXISTS;
|
|
47
|
+
case ENOTEMPTY:
|
|
48
|
+
return ERR_NOT_EMPTY;
|
|
49
|
+
case EXDEV:
|
|
50
|
+
return ERR_XDEV;
|
|
51
|
+
case EBUSY:
|
|
52
|
+
return ERR_BUSY;
|
|
53
|
+
case ENOSPC:
|
|
54
|
+
#ifdef EDQUOT
|
|
55
|
+
case EDQUOT:
|
|
56
|
+
#endif
|
|
57
|
+
return ERR_NO_SPACE;
|
|
58
|
+
case EINVAL:
|
|
59
|
+
case ENAMETOOLONG:
|
|
60
|
+
return ERR_INVALID_PATH;
|
|
61
|
+
case EIO:
|
|
62
|
+
return ERR_IO;
|
|
63
|
+
default:
|
|
64
|
+
return ERR_UNKNOWN;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#ifdef _WIN32
|
|
69
|
+
static inline Result map_win32_error(DWORD err) {
|
|
70
|
+
switch (err) {
|
|
71
|
+
case ERROR_SUCCESS:
|
|
72
|
+
return SUCCESS;
|
|
73
|
+
case ERROR_FILE_NOT_FOUND:
|
|
74
|
+
case ERROR_PATH_NOT_FOUND:
|
|
75
|
+
return ERR_NOT_FOUND;
|
|
76
|
+
case ERROR_ACCESS_DENIED:
|
|
77
|
+
return ERR_PERMISSION;
|
|
78
|
+
case ERROR_DIRECTORY:
|
|
79
|
+
return ERR_NOT_DIR;
|
|
80
|
+
case ERROR_ALREADY_EXISTS:
|
|
81
|
+
case ERROR_FILE_EXISTS:
|
|
82
|
+
return ERR_EXISTS;
|
|
83
|
+
case ERROR_DIR_NOT_EMPTY:
|
|
84
|
+
return ERR_NOT_EMPTY;
|
|
85
|
+
case ERROR_NOT_SAME_DEVICE:
|
|
86
|
+
return ERR_XDEV;
|
|
87
|
+
case ERROR_SHARING_VIOLATION:
|
|
88
|
+
case ERROR_LOCK_VIOLATION:
|
|
89
|
+
case ERROR_BUSY:
|
|
90
|
+
return ERR_BUSY;
|
|
91
|
+
case ERROR_DISK_FULL:
|
|
92
|
+
case ERROR_HANDLE_DISK_FULL:
|
|
93
|
+
return ERR_NO_SPACE;
|
|
94
|
+
case ERROR_INVALID_NAME:
|
|
95
|
+
case ERROR_FILENAME_EXCED_RANGE:
|
|
96
|
+
case ERROR_BAD_PATHNAME:
|
|
97
|
+
return ERR_INVALID_PATH;
|
|
98
|
+
case ERROR_READ_FAULT:
|
|
99
|
+
case ERROR_WRITE_FAULT:
|
|
100
|
+
case ERROR_IO_DEVICE:
|
|
101
|
+
return ERR_IO;
|
|
102
|
+
default:
|
|
103
|
+
return ERR_UNKNOWN;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
#endif
|
|
107
|
+
|
|
108
|
+
#endif /* NATIVE_ERRORS_H */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// c_src/diskops/win32/cat.c
|
|
2
2
|
|
|
3
|
-
#include <windows.h>
|
|
4
|
-
#include <stdlib.h>
|
|
5
3
|
#include "../shared/native_errors.h"
|
|
4
|
+
#include <stdlib.h>
|
|
5
|
+
#include <windows.h>
|
|
6
6
|
|
|
7
|
-
Result cat(const char*
|
|
7
|
+
Result cat(const char *path, char **out_buf, size_t *out_size) {
|
|
8
8
|
if (!path || !out_buf || !out_size) {
|
|
9
9
|
return ERR_INVALID_PATH;
|
|
10
10
|
}
|
|
@@ -16,21 +16,15 @@ Result cat(const char* path, char** out_buf, size_t* out_size) {
|
|
|
16
16
|
return ERR_INVALID_PATH;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
wchar_t*
|
|
19
|
+
wchar_t *wpath = (wchar_t *)malloc(wlen * sizeof(wchar_t));
|
|
20
20
|
if (!wpath) {
|
|
21
21
|
return ERR_IO;
|
|
22
22
|
}
|
|
23
23
|
MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, wlen);
|
|
24
24
|
|
|
25
|
-
HANDLE hFile =
|
|
26
|
-
wpath,
|
|
27
|
-
|
|
28
|
-
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
|
29
|
-
NULL,
|
|
30
|
-
OPEN_EXISTING,
|
|
31
|
-
FILE_ATTRIBUTE_NORMAL,
|
|
32
|
-
NULL
|
|
33
|
-
);
|
|
25
|
+
HANDLE hFile =
|
|
26
|
+
CreateFileW(wpath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
|
27
|
+
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
|
34
28
|
|
|
35
29
|
if (hFile == INVALID_HANDLE_VALUE) {
|
|
36
30
|
DWORD err = GetLastError();
|
|
@@ -58,7 +52,7 @@ Result cat(const char* path, char** out_buf, size_t* out_size) {
|
|
|
58
52
|
return ERR_EMPTY;
|
|
59
53
|
}
|
|
60
54
|
|
|
61
|
-
char*
|
|
55
|
+
char *buf = (char *)malloc(size.QuadPart + 1);
|
|
62
56
|
if (!buf) {
|
|
63
57
|
CloseHandle(hFile);
|
|
64
58
|
return ERR_IO;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// c_src/diskops/win32/dir.c
|
|
2
2
|
|
|
3
|
-
#include
|
|
3
|
+
#include "../shared/dir_types.h"
|
|
4
|
+
#include "../shared/native_errors.h"
|
|
4
5
|
#include <stdio.h>
|
|
5
6
|
#include <stdlib.h>
|
|
6
7
|
#include <string.h>
|
|
7
|
-
#include
|
|
8
|
-
#include "../shared/dir_types.h"
|
|
8
|
+
#include <windows.h>
|
|
9
9
|
|
|
10
|
-
Result list_dir(const char*
|
|
10
|
+
Result list_dir(const char *path, DirList *out_list) {
|
|
11
11
|
if (!path || path[0] == '\0' || !out_list) {
|
|
12
12
|
return ERR_INVALID_PATH;
|
|
13
13
|
}
|
|
@@ -25,7 +25,7 @@ Result list_dir(const char* path, DirList* out_list) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
size_t capacity = 16;
|
|
28
|
-
out_list->entries = (DirEntry*)malloc(capacity * sizeof(DirEntry));
|
|
28
|
+
out_list->entries = (DirEntry *)malloc(capacity * sizeof(DirEntry));
|
|
29
29
|
if (!out_list->entries) {
|
|
30
30
|
FindClose(h_find);
|
|
31
31
|
return ERR_IO;
|
|
@@ -38,7 +38,7 @@ Result list_dir(const char* path, DirList* out_list) {
|
|
|
38
38
|
|
|
39
39
|
if (out_list->count >= capacity) {
|
|
40
40
|
capacity *= 2;
|
|
41
|
-
DirEntry*
|
|
41
|
+
DirEntry *resized = (DirEntry *)realloc(out_list->entries, capacity * sizeof(DirEntry));
|
|
42
42
|
if (!resized) {
|
|
43
43
|
FindClose(h_find);
|
|
44
44
|
free_dir_list(out_list);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// c_src/diskops/win32/touch.c
|
|
2
2
|
|
|
3
|
-
#include <windows.h>
|
|
4
|
-
#include <stdlib.h>
|
|
5
3
|
#include "../shared/native_errors.h"
|
|
4
|
+
#include <stdlib.h>
|
|
5
|
+
#include <windows.h>
|
|
6
6
|
|
|
7
|
-
Result touch(const char*
|
|
7
|
+
Result touch(const char *path) {
|
|
8
8
|
if (!path || path[0] == '\0') {
|
|
9
9
|
return ERR_INVALID_PATH;
|
|
10
10
|
}
|
|
@@ -14,7 +14,7 @@ Result touch(const char* path) {
|
|
|
14
14
|
return ERR_INVALID_PATH;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
wchar_t*
|
|
17
|
+
wchar_t *wpath = (wchar_t *)malloc(wlen * sizeof(wchar_t));
|
|
18
18
|
if (!wpath) {
|
|
19
19
|
return ERR_IO;
|
|
20
20
|
}
|
|
@@ -26,15 +26,9 @@ Result touch(const char* path) {
|
|
|
26
26
|
return ERR_IS_DIR;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
HANDLE hFile = CreateFileW(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
|
33
|
-
NULL,
|
|
34
|
-
OPEN_ALWAYS,
|
|
35
|
-
FILE_ATTRIBUTE_NORMAL,
|
|
36
|
-
NULL
|
|
37
|
-
);
|
|
29
|
+
HANDLE hFile = CreateFileW(wpath, FILE_WRITE_ATTRIBUTES,
|
|
30
|
+
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
|
|
31
|
+
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
|
38
32
|
|
|
39
33
|
if (hFile == INVALID_HANDLE_VALUE) {
|
|
40
34
|
DWORD err = GetLastError();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flyshell
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.1
|
|
4
4
|
Summary: A modular, zero-dependency command-line environment in Python.
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -23,11 +23,11 @@ Dynamic: license-file
|
|
|
23
23
|

|
|
24
24
|

|
|
25
25
|
|
|
26
|
-
> Documentation last updated: v1.
|
|
26
|
+
> Documentation last updated: v1.4.0
|
|
27
27
|
|
|
28
|
-
A modular, zero-dependency command-line environment and extensible runtime interface built in Python.
|
|
28
|
+
A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
|
|
29
29
|
|
|
30
|
-
Flyshell provides a modular, extensible shell environment featuring dynamic runtime plugin loading, session persistence, secure authentication, and cross-platform process isolation, using only
|
|
30
|
+
Flyshell provides a modular, extensible shell environment featuring dynamic runtime plugin loading, session persistence, secure authentication, and cross-platform process isolation, using only standard libraries.
|
|
31
31
|
|
|
32
32
|
No extra packages required, just install and enjoy!
|
|
33
33
|
|
|
@@ -38,6 +38,7 @@ No extra packages required, just install and enjoy!
|
|
|
38
38
|
3. **Secure Authentication**: Flyshell uses salted PBKDF2 HMAC (SHA-256, 600,000 iterations) with constant-time equality comparisons to prevent timing attacks on password information.
|
|
39
39
|
4. **Cross-Platform Support**: Flyshell is fully supported by Windows (NT), macOS (Darwin) and Linux installations with native OS management and POSIX-aware parsing. Note that Flyshell is **not** supported by any other systems.
|
|
40
40
|
5. **State and History Persistence**: Flyshell has a fully encapsulated SQL storage system using SQLite3 providing session metrics and ISO 8601 UTC audit logging.
|
|
41
|
+
6. **Automatic C-Extension Compilation**: If installed via `pip`, Flyshell is distributed with more than 20 wheels suitable for most builds of popular operating systems.
|
|
41
42
|
|
|
42
43
|
## System Requirements
|
|
43
44
|
|
|
@@ -54,6 +55,11 @@ src/
|
|
|
54
55
|
│ ├── base_cmd.py
|
|
55
56
|
│ ├── base_plugin.py
|
|
56
57
|
│ └── parent_cmd.py
|
|
58
|
+
├── accounts/
|
|
59
|
+
│ ├── __init__.py
|
|
60
|
+
│ └── auth.py
|
|
61
|
+
├── bin/
|
|
62
|
+
│ └── __init__.py
|
|
57
63
|
├── builtin/
|
|
58
64
|
│ ├── __init__.py
|
|
59
65
|
│ ├── diskops.py
|
|
@@ -63,11 +69,19 @@ src/
|
|
|
63
69
|
│ └── utils.py
|
|
64
70
|
├── core/
|
|
65
71
|
│ ├── __init__.py
|
|
66
|
-
│ ├── auth.py
|
|
67
72
|
│ ├── console.py
|
|
68
73
|
│ ├── data.py
|
|
74
|
+
│ └── directory.py
|
|
75
|
+
├── native/
|
|
76
|
+
│ ├── legacy/
|
|
77
|
+
│ │ ├── __init__.py
|
|
78
|
+
│ │ └── diskops.py
|
|
79
|
+
│ ├── __init__.py
|
|
80
|
+
│ ├── diskops_bridge.py
|
|
81
|
+
│ └── diskops_handler.py
|
|
82
|
+
├── startup/
|
|
83
|
+
│ ├── __init__.py
|
|
69
84
|
│ ├── deps.py
|
|
70
|
-
│ ├── directory.py
|
|
71
85
|
│ ├── env.py
|
|
72
86
|
│ └── loader.py
|
|
73
87
|
├── __init__.py
|
|
@@ -75,6 +89,8 @@ src/
|
|
|
75
89
|
└── main.py
|
|
76
90
|
```
|
|
77
91
|
|
|
92
|
+
For a full tree, please see `docs/project_structure.md`.
|
|
93
|
+
|
|
78
94
|
## Installing Flyshell
|
|
79
95
|
|
|
80
96
|
There are two methods to install Flyshell.
|
|
@@ -104,6 +120,11 @@ cd flyshell
|
|
|
104
120
|
pip install -e .
|
|
105
121
|
```
|
|
106
122
|
|
|
123
|
+
Flyshell now uses C-binaries, you must compile these:
|
|
124
|
+
```bash
|
|
125
|
+
python setup.py build_ext --inplace
|
|
126
|
+
```
|
|
127
|
+
|
|
107
128
|
After this, you can simply run Flyshell:
|
|
108
129
|
```bash
|
|
109
130
|
flyshell
|
|
@@ -165,6 +186,7 @@ class MyPlugin(BasePlugin):
|
|
|
165
186
|
description = "This is my plugin." # A short one-line explaining what your plugin does
|
|
166
187
|
version = "1.0.0" # Default is 1.0.0
|
|
167
188
|
author = "kianodev" # You can put your name, your GitHub handle, or leave blank to make it 'Unknown'
|
|
189
|
+
identifier = "" # (OPTIONAL) Alternative name for your plugin command (defaults to dir / file name)
|
|
168
190
|
usage = "" # (OPTIONAL) Explain how to use your plugin
|
|
169
191
|
extended_help = "" # (OPTIONAL) A more detailed, multi-line guide containing specific assistance
|
|
170
192
|
api_keys = [] # (OPTIONAL) Define any required key names here. Use get_api_key(key_name) to call the key. Please add all keys in CAPITALS.
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// c_src/diskops/shared/native_errors.h
|
|
2
|
-
|
|
3
|
-
#ifndef NATIVE_ERRORS_H
|
|
4
|
-
#define NATIVE_ERRORS_H
|
|
5
|
-
|
|
6
|
-
#include <errno.h>
|
|
7
|
-
|
|
8
|
-
#ifdef _WIN32
|
|
9
|
-
#include <windows.h>
|
|
10
|
-
#endif
|
|
11
|
-
|
|
12
|
-
typedef enum {
|
|
13
|
-
SUCCESS = 0,
|
|
14
|
-
ERR_NOT_FOUND = -1,
|
|
15
|
-
ERR_PERMISSION = -2,
|
|
16
|
-
ERR_IS_DIR = -3,
|
|
17
|
-
ERR_NOT_DIR = -4,
|
|
18
|
-
ERR_EXISTS = -5,
|
|
19
|
-
ERR_NOT_EMPTY = -6,
|
|
20
|
-
ERR_SAME_FILE = -7,
|
|
21
|
-
ERR_EMPTY = -8,
|
|
22
|
-
ERR_INVALID_PATH = -9,
|
|
23
|
-
ERR_XDEV = -10,
|
|
24
|
-
ERR_BUSY = -11,
|
|
25
|
-
ERR_NO_SPACE = -12,
|
|
26
|
-
ERR_IO = -13,
|
|
27
|
-
ERR_DECODE = -14,
|
|
28
|
-
ERR_LAUNCH_FAIL = -15,
|
|
29
|
-
ERR_UNKNOWN = -99
|
|
30
|
-
} Result;
|
|
31
|
-
|
|
32
|
-
static inline Result map_posix_errno(int err) {
|
|
33
|
-
switch (err) {
|
|
34
|
-
case 0: return SUCCESS;
|
|
35
|
-
case ENOENT: return ERR_NOT_FOUND;
|
|
36
|
-
case EACCES:
|
|
37
|
-
case EPERM: return ERR_PERMISSION;
|
|
38
|
-
case EISDIR: return ERR_IS_DIR;
|
|
39
|
-
case ENOTDIR: return ERR_NOT_DIR;
|
|
40
|
-
case EEXIST: return ERR_EXISTS;
|
|
41
|
-
case ENOTEMPTY: return ERR_NOT_EMPTY;
|
|
42
|
-
case EXDEV: return ERR_XDEV;
|
|
43
|
-
case EBUSY: return ERR_BUSY;
|
|
44
|
-
case ENOSPC:
|
|
45
|
-
#ifdef EDQUOT
|
|
46
|
-
case EDQUOT:
|
|
47
|
-
#endif
|
|
48
|
-
return ERR_NO_SPACE;
|
|
49
|
-
case EINVAL:
|
|
50
|
-
case ENAMETOOLONG: return ERR_INVALID_PATH;
|
|
51
|
-
case EIO: return ERR_IO;
|
|
52
|
-
default: return ERR_UNKNOWN;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
#ifdef _WIN32
|
|
57
|
-
static inline Result map_win32_error(DWORD err) {
|
|
58
|
-
switch (err) {
|
|
59
|
-
case ERROR_SUCCESS: return SUCCESS;
|
|
60
|
-
case ERROR_FILE_NOT_FOUND:
|
|
61
|
-
case ERROR_PATH_NOT_FOUND: return ERR_NOT_FOUND;
|
|
62
|
-
case ERROR_ACCESS_DENIED: return ERR_PERMISSION;
|
|
63
|
-
case ERROR_DIRECTORY: return ERR_NOT_DIR;
|
|
64
|
-
case ERROR_ALREADY_EXISTS:
|
|
65
|
-
case ERROR_FILE_EXISTS: return ERR_EXISTS;
|
|
66
|
-
case ERROR_DIR_NOT_EMPTY: return ERR_NOT_EMPTY;
|
|
67
|
-
case ERROR_NOT_SAME_DEVICE: return ERR_XDEV;
|
|
68
|
-
case ERROR_SHARING_VIOLATION:
|
|
69
|
-
case ERROR_LOCK_VIOLATION:
|
|
70
|
-
case ERROR_BUSY: return ERR_BUSY;
|
|
71
|
-
case ERROR_DISK_FULL:
|
|
72
|
-
case ERROR_HANDLE_DISK_FULL: return ERR_NO_SPACE;
|
|
73
|
-
case ERROR_INVALID_NAME:
|
|
74
|
-
case ERROR_FILENAME_EXCED_RANGE:
|
|
75
|
-
case ERROR_BAD_PATHNAME: return ERR_INVALID_PATH;
|
|
76
|
-
case ERROR_READ_FAULT:
|
|
77
|
-
case ERROR_WRITE_FAULT:
|
|
78
|
-
case ERROR_IO_DEVICE: return ERR_IO;
|
|
79
|
-
default: return ERR_UNKNOWN;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
#endif
|
|
83
|
-
|
|
84
|
-
#endif /* NATIVE_ERRORS_H */
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|