flyshell 1.0.12__tar.gz → 1.1.0__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.
Files changed (34) hide show
  1. {flyshell-1.0.12/src/flyshell.egg-info → flyshell-1.1.0}/PKG-INFO +4 -2
  2. {flyshell-1.0.12 → flyshell-1.1.0}/README.md +3 -1
  3. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/builtin/diskops.py +45 -0
  4. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/builtin/utils.py +16 -0
  5. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/constants.py +2 -2
  6. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/core/directory.py +2 -0
  7. {flyshell-1.0.12 → flyshell-1.1.0/src/flyshell.egg-info}/PKG-INFO +4 -2
  8. {flyshell-1.0.12 → flyshell-1.1.0}/LICENSE +0 -0
  9. {flyshell-1.0.12 → flyshell-1.1.0}/pyproject.toml +0 -0
  10. {flyshell-1.0.12 → flyshell-1.1.0}/setup.cfg +0 -0
  11. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/__init__.py +0 -0
  12. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/abstract/__init__.py +0 -0
  13. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/abstract/base_cmd.py +0 -0
  14. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/abstract/base_plugin.py +0 -0
  15. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/abstract/parent_cmd.py +0 -0
  16. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/builtin/__init__.py +0 -0
  17. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/builtin/fs.py +0 -0
  18. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/builtin/system.py +0 -0
  19. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/core/__init__.py +0 -0
  20. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/core/auth.py +0 -0
  21. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/core/console.py +0 -0
  22. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/core/data.py +0 -0
  23. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/core/loader.py +0 -0
  24. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell/main.py +0 -0
  25. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell.egg-info/SOURCES.txt +0 -0
  26. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell.egg-info/dependency_links.txt +0 -0
  27. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell.egg-info/entry_points.txt +0 -0
  28. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell.egg-info/requires.txt +0 -0
  29. {flyshell-1.0.12 → flyshell-1.1.0}/src/flyshell.egg-info/top_level.txt +0 -0
  30. {flyshell-1.0.12 → flyshell-1.1.0}/tests/test_auth.py +0 -0
  31. {flyshell-1.0.12 → flyshell-1.1.0}/tests/test_data.py +0 -0
  32. {flyshell-1.0.12 → flyshell-1.1.0}/tests/test_directory.py +0 -0
  33. {flyshell-1.0.12 → flyshell-1.1.0}/tests/test_loader.py +0 -0
  34. {flyshell-1.0.12 → flyshell-1.1.0}/tests/test_security.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.0.12
3
+ Version: 1.1.0
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License: MIT
6
6
  Requires-Python: >=3.10
@@ -23,7 +23,7 @@ Dynamic: license-file
23
23
  ![Dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg)
24
24
  ![Tests](https://github.com/kianodev/flyshell/actions/workflows/pytest.yml/badge.svg)
25
25
 
26
- > Documentation last updated: v1.0.0
26
+ > Documentation last updated: v1.1.0
27
27
 
28
28
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python.
29
29
 
@@ -60,6 +60,7 @@ flyshell/
60
60
  │ │ └── parent_cmd.py
61
61
  │ ├── builtin/
62
62
  │ │ ├── __init__.py
63
+ │ │ ├── diskops.py
63
64
  │ │ ├── fs.py
64
65
  │ │ ├── system.py
65
66
  │ │ └── utils.py
@@ -71,6 +72,7 @@ flyshell/
71
72
  │ │ ├── directory.py
72
73
  │ │ └── loader.py
73
74
  │ ├── __init__.py
75
+ │ ├── constants.py
74
76
  │ └── main.py
75
77
  ├── tests/
76
78
  │ ├── test_auth.py
@@ -6,7 +6,7 @@
6
6
  ![Dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg)
7
7
  ![Tests](https://github.com/kianodev/flyshell/actions/workflows/pytest.yml/badge.svg)
8
8
 
9
- > Documentation last updated: v1.0.0
9
+ > Documentation last updated: v1.1.0
10
10
 
11
11
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python.
12
12
 
@@ -43,6 +43,7 @@ flyshell/
43
43
  │ │ └── parent_cmd.py
44
44
  │ ├── builtin/
45
45
  │ │ ├── __init__.py
46
+ │ │ ├── diskops.py
46
47
  │ │ ├── fs.py
47
48
  │ │ ├── system.py
48
49
  │ │ └── utils.py
@@ -54,6 +55,7 @@ flyshell/
54
55
  │ │ ├── directory.py
55
56
  │ │ └── loader.py
56
57
  │ ├── __init__.py
58
+ │ ├── constants.py
57
59
  │ └── main.py
58
60
  ├── tests/
59
61
  │ ├── test_auth.py
@@ -259,6 +259,51 @@ class Move(BaseCmd):
259
259
  return (1, f"\nSystem Error: Failed to move '{raw_src}' ({e})\n")
260
260
 
261
261
 
262
+ class Rename(BaseCmd):
263
+ name = "rename"
264
+ description = "Rename a file or directory"
265
+ min_args = 2
266
+ options = "Old name, then new name"
267
+ aliases = []
268
+
269
+ def execute(self, args):
270
+ raw_src = args[0].strip("\"'")
271
+ raw_new_name = args[1].strip("\"'")
272
+ if raw_new_name in (".", "..") or "/" in raw_new_name or "\\" in raw_new_name:
273
+ return (1, "\nCommand Error: Invalid file name.\n")
274
+ src_path = Path(raw_src).expanduser().resolve()
275
+ if not src_path.exists():
276
+ return (1, f"\nSystem Error: Target '{raw_src}' not found.\n")
277
+ flyshell_dirs = [
278
+ c.APP_DIR.resolve(),
279
+ c.PACKAGE_ROOT.resolve(),
280
+ c.PROJECT_ROOT.resolve(),
281
+ ]
282
+ for protected in flyshell_dirs:
283
+ if src_path == protected or src_path.is_relative_to(protected):
284
+ return (
285
+ 1,
286
+ "\nSecurity Error: Flyshell has blocked this action.\n"
287
+ f"Target '{raw_src}' contains or belongs to Flyshell system files.\n",
288
+ )
289
+ new_path = src_path.parent / raw_new_name
290
+ if new_path.exists():
291
+ return (
292
+ 1,
293
+ f"\nSystem Error: An item named '{raw_new_name}' already exists in this folder.\n",
294
+ )
295
+ try:
296
+ src_path.rename(new_path)
297
+ return (0, f"\nSUCCESS! Renamed '{src_path.name}' -> '{new_path.name}'\n")
298
+ except PermissionError:
299
+ return (
300
+ 1,
301
+ f"\nSystem Error: Permission denied. Cannot rename '{raw_src}'\n",
302
+ )
303
+ except Exception as e:
304
+ return (1, f"\nSystem Error: Failed to rename '{raw_src}' ({e})\n")
305
+
306
+
262
307
  class Rm(BaseCmd):
263
308
  name = "rm"
264
309
  description = "Remove files from the filesystem"
@@ -22,6 +22,22 @@ class Clear(BaseCmd):
22
22
  return (0, c.CLEAR_SCREEN)
23
23
 
24
24
 
25
+ class Echo(BaseCmd):
26
+ name = "echo"
27
+ description = "Print arguments to terminal"
28
+ min_args = 1
29
+ options = "Message"
30
+ aliases = []
31
+
32
+ def execute(self, args):
33
+ text = " ".join(args)
34
+ try:
35
+ text = text.encode("utf-8").decode("unicode_escape")
36
+ except Exception:
37
+ pass
38
+ return (0, f"\n{text}\n")
39
+
40
+
25
41
  class History(BaseCmd):
26
42
  name = "history"
27
43
  description = "View command history"
@@ -7,8 +7,8 @@ import os
7
7
  import platform
8
8
  import time
9
9
 
10
- BUILD = 111
11
- VERSION = "1.0.12"
10
+ BUILD = 113
11
+ VERSION = "1.1.0"
12
12
 
13
13
 
14
14
  def _resolve_app_dir() -> Path:
@@ -55,6 +55,7 @@ INSTALLED_COMMANDS: list[BaseCmd] = [
55
55
  utils.Clear(),
56
56
  diskops.Copy(),
57
57
  diskops.Dir(),
58
+ utils.Echo(),
58
59
  fs.Fs(),
59
60
  utils.History(),
60
61
  utils.Kill(),
@@ -63,6 +64,7 @@ INSTALLED_COMMANDS: list[BaseCmd] = [
63
64
  diskops.Move(),
64
65
  system.OpenFile(),
65
66
  utils.Reboot(),
67
+ diskops.Rename(),
66
68
  diskops.Rm(),
67
69
  diskops.RmDir(),
68
70
  utils.Sleep(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.0.12
3
+ Version: 1.1.0
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License: MIT
6
6
  Requires-Python: >=3.10
@@ -23,7 +23,7 @@ Dynamic: license-file
23
23
  ![Dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg)
24
24
  ![Tests](https://github.com/kianodev/flyshell/actions/workflows/pytest.yml/badge.svg)
25
25
 
26
- > Documentation last updated: v1.0.0
26
+ > Documentation last updated: v1.1.0
27
27
 
28
28
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python.
29
29
 
@@ -60,6 +60,7 @@ flyshell/
60
60
  │ │ └── parent_cmd.py
61
61
  │ ├── builtin/
62
62
  │ │ ├── __init__.py
63
+ │ │ ├── diskops.py
63
64
  │ │ ├── fs.py
64
65
  │ │ ├── system.py
65
66
  │ │ └── utils.py
@@ -71,6 +72,7 @@ flyshell/
71
72
  │ │ ├── directory.py
72
73
  │ │ └── loader.py
73
74
  │ ├── __init__.py
75
+ │ ├── constants.py
74
76
  │ └── main.py
75
77
  ├── tests/
76
78
  │ ├── test_auth.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes