flyshell 1.5.10__tar.gz → 1.6.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 (76) hide show
  1. {flyshell-1.5.10/src/flyshell.egg-info → flyshell-1.6.0}/PKG-INFO +3 -3
  2. {flyshell-1.5.10 → flyshell-1.6.0}/README.md +2 -2
  3. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/abstract/base_cmd.py +2 -2
  4. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/abstract/base_plugin.py +10 -10
  5. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/abstract/parent_cmd.py +4 -4
  6. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/accounts/auth.py +3 -3
  7. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/builtin/fs.py +9 -9
  8. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/builtin/system.py +4 -4
  9. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/builtin/utils.py +6 -6
  10. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/constants.py +3 -3
  11. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/core/console.py +2 -2
  12. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/core/data.py +36 -19
  13. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/core/directory.py +3 -3
  14. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/main.py +1 -1
  15. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/native/diskops_handler.py +9 -9
  16. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/startup/deps.py +2 -2
  17. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/startup/env.py +3 -3
  18. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/startup/loader.py +6 -4
  19. {flyshell-1.5.10 → flyshell-1.6.0/src/flyshell.egg-info}/PKG-INFO +3 -3
  20. {flyshell-1.5.10 → flyshell-1.6.0}/LICENSE +0 -0
  21. {flyshell-1.5.10 → flyshell-1.6.0}/MANIFEST.in +0 -0
  22. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/diskops.c +0 -0
  23. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/cat.c +0 -0
  24. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/cp.c +0 -0
  25. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/dir.c +0 -0
  26. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/mkdir.c +0 -0
  27. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/mv.c +0 -0
  28. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/rename.c +0 -0
  29. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/rm.c +0 -0
  30. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/rmdir.c +0 -0
  31. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/posix/touch.c +0 -0
  32. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/shared/dir_types.c +0 -0
  33. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/shared/dir_types.h +0 -0
  34. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/shared/native_errors.h +0 -0
  35. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/shared/win32_utf.h +0 -0
  36. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/cat.c +0 -0
  37. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/cp.c +0 -0
  38. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/dir.c +0 -0
  39. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/mkdir.c +0 -0
  40. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/mv.c +0 -0
  41. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/rename.c +0 -0
  42. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/rm.c +0 -0
  43. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/rmdir.c +0 -0
  44. {flyshell-1.5.10 → flyshell-1.6.0}/c_src/diskops/win32/touch.c +0 -0
  45. {flyshell-1.5.10 → flyshell-1.6.0}/pyproject.toml +0 -0
  46. {flyshell-1.5.10 → flyshell-1.6.0}/setup.cfg +0 -0
  47. {flyshell-1.5.10 → flyshell-1.6.0}/setup.py +0 -0
  48. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/__init__.py +0 -0
  49. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/abstract/__init__.py +0 -0
  50. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/accounts/__init__.py +0 -0
  51. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/bin/__init__.py +0 -0
  52. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/builtin/__init__.py +0 -0
  53. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/builtin/pkg.py +0 -0
  54. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/core/__init__.py +0 -0
  55. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/native/__init__.py +0 -0
  56. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/native/diskops_bridge.py +0 -0
  57. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/native/legacy/__init__.py +0 -0
  58. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/native/legacy/diskops.py +0 -0
  59. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/startup/__init__.py +0 -0
  60. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell/startup/seasonal.py +0 -0
  61. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell.egg-info/SOURCES.txt +0 -0
  62. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell.egg-info/dependency_links.txt +0 -0
  63. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell.egg-info/entry_points.txt +0 -0
  64. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell.egg-info/requires.txt +0 -0
  65. {flyshell-1.5.10 → flyshell-1.6.0}/src/flyshell.egg-info/top_level.txt +0 -0
  66. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_auth.py +0 -0
  67. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_data.py +0 -0
  68. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_deps.py +0 -0
  69. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_directory.py +0 -0
  70. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_diskops_ext.py +0 -0
  71. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_diskops_lgc.py +0 -0
  72. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_env.py +0 -0
  73. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_fs.py +0 -0
  74. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_loader.py +0 -0
  75. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_pkg.py +0 -0
  76. {flyshell-1.5.10 → flyshell-1.6.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.5.10
3
+ Version: 1.6.0
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License-Expression: 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/ci.yml/badge.svg)
25
25
 
26
- > Documentation last updated: v1.5.8
26
+ > Documentation last updated: v1.6.0
27
27
 
28
28
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
29
29
 
@@ -38,7 +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` on Windows or Linux, Flyshell is shipped with pre-compiled wheels. For macOS users, Xcode CLI tools is required as macOS builds install from source.
41
+ 6. **Automatic C-Extension Compilation**: If installed via `pip` on Windows or Linux, Flyshell is shipped with pre-compiled wheels. For macOS users, Xcode CLI Tools is required as macOS builds install from source.
42
42
 
43
43
  ## System Requirements
44
44
 
@@ -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/ci.yml/badge.svg)
8
8
 
9
- > Documentation last updated: v1.5.8
9
+ > Documentation last updated: v1.6.0
10
10
 
11
11
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
12
12
 
@@ -21,7 +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` on Windows or Linux, Flyshell is shipped with pre-compiled wheels. For macOS users, Xcode CLI tools is required as macOS builds install from source.
24
+ 6. **Automatic C-Extension Compilation**: If installed via `pip` on Windows or Linux, Flyshell is shipped with pre-compiled wheels. For macOS users, Xcode CLI Tools is required as macOS builds install from source.
25
25
 
26
26
  ## System Requirements
27
27
 
@@ -10,7 +10,7 @@ class BaseCmd:
10
10
  options: Optional[str] = None
11
11
  aliases: Optional[List[str]] = None
12
12
 
13
- def __init__(self):
13
+ def __init__(self) -> None:
14
14
  if self.aliases is None:
15
15
  self.aliases = []
16
16
  else:
@@ -21,7 +21,7 @@ class BaseCmd:
21
21
  f"Command '{self.__class__.__name__}' has not implemented the execute method"
22
22
  )
23
23
 
24
- def help(self, prefix: str = ""):
24
+ def help(self, prefix: str = "") -> None:
25
25
  full_name = f"{prefix} {self.name}".strip() if prefix else self.name
26
26
  print(f"\nCommand: {full_name}")
27
27
  if prefix:
@@ -3,7 +3,7 @@
3
3
  from flyshell.core import data
4
4
 
5
5
  from pathlib import Path
6
- from typing import Optional
6
+ from typing import Any, Optional
7
7
 
8
8
 
9
9
  class BasePlugin:
@@ -17,7 +17,7 @@ class BasePlugin:
17
17
  api_keys: Optional[list] = None
18
18
  third_pty_libs: Optional[list] = None
19
19
 
20
- def __init__(self, context: dict):
20
+ def __init__(self, context: dict) -> None:
21
21
  self.api_keys = list(self.api_keys) if self.api_keys else []
22
22
  self.third_pty_libs = list(self.third_pty_libs) if self.third_pty_libs else []
23
23
  self.context = context
@@ -27,7 +27,7 @@ class BasePlugin:
27
27
  self.env_file_path = context.get("env_path", None)
28
28
  self.on_load()
29
29
 
30
- def get_api_key(self, key_name: str, default=None):
30
+ def get_api_key(self, key_name: str, default: Any = None) -> Any:
31
31
  if key_name in self.api_keys_data:
32
32
  return self.api_keys_data[key_name]
33
33
  target = key_name.lower()
@@ -36,16 +36,16 @@ class BasePlugin:
36
36
  return v
37
37
  return default
38
38
 
39
- def on_load(self):
39
+ def on_load(self) -> None:
40
40
  pass
41
41
 
42
- def on_unload(self):
42
+ def on_unload(self) -> None:
43
43
  pass
44
44
 
45
- def execute(self, args: list):
45
+ def execute(self, args: list) -> Any:
46
46
  raise NotImplementedError("Plugins must implement the execute method")
47
47
 
48
- def help(self):
48
+ def help(self) -> None:
49
49
  lines = [
50
50
  f"\nPlugin: {self.name} (v{self.version})",
51
51
  f"Description: {self.description}",
@@ -79,10 +79,10 @@ class BasePlugin:
79
79
  return True
80
80
  return False
81
81
 
82
- def get_data(self, key: str, default=None):
82
+ def get_data(self, key: str, default: Any = None) -> Any:
83
83
  return self.storage.get(key, default)
84
84
 
85
- def set_data(self, key: str, value):
85
+ def set_data(self, key: str, value: Any) -> None:
86
86
  self.storage[key] = value
87
87
  self.save_storage()
88
88
 
@@ -99,7 +99,7 @@ class BasePlugin:
99
99
  self.context["storage"] = fresh_data
100
100
  return self.storage
101
101
 
102
- def save_storage(self):
102
+ def save_storage(self) -> None:
103
103
  existing_keys = set(data.get_all_plugin_data(self.plugin_name).keys())
104
104
  for stale_key in existing_keys - set(self.storage.keys()):
105
105
  data.delete_plugin_data(self.plugin_name, stale_key)
@@ -8,12 +8,12 @@ from typing import Dict, List, Tuple
8
8
  class ParentCmd(BaseCmd):
9
9
  min_args: int = 1
10
10
 
11
- def __init__(self):
11
+ def __init__(self) -> None:
12
12
  super().__init__()
13
13
  self._sub_registry: Dict[str, BaseCmd] = {}
14
14
  self._build_registry()
15
15
 
16
- def _build_registry(self):
16
+ def _build_registry(self) -> None:
17
17
  for cmd_obj in self.get_subcommands():
18
18
  self._sub_registry[cmd_obj.name] = cmd_obj
19
19
  for alias in getattr(cmd_obj, "aliases", []):
@@ -22,7 +22,7 @@ class ParentCmd(BaseCmd):
22
22
  def get_subcommands(self) -> List[BaseCmd]:
23
23
  return []
24
24
 
25
- def help(self):
25
+ def help(self) -> None:
26
26
  print(f"\nCommand Family: {self.name}")
27
27
  print(f"Description: {self.description}")
28
28
  print(f"\nSubcommands of '{self.name}':")
@@ -50,7 +50,7 @@ class ParentCmd(BaseCmd):
50
50
  sub_args = args[1:]
51
51
  if sub_name not in self._sub_registry:
52
52
  err = (
53
- f"\nCommand Error: Unknown subcommand '{sub_name}' for '{self.name}'.\n"
53
+ f"\nCommand Error: Unknown subcommand '{sub_name}' for '{self.name}'\n"
54
54
  f"Use '{self.name} -h' or '--help' to see all valid subcommands.\n"
55
55
  )
56
56
  return (1, err)
@@ -9,7 +9,7 @@ import re
9
9
  import secrets
10
10
 
11
11
 
12
- def hash_password(password, salt=None):
12
+ def hash_password(password: str, salt: bytes | str | None = None) -> tuple[str, str]:
13
13
  if salt is None:
14
14
  salt = secrets.token_bytes(16)
15
15
  elif isinstance(salt, str):
@@ -77,7 +77,7 @@ def setup_acc() -> bool:
77
77
  return True
78
78
 
79
79
 
80
- def login_flow(is_lock=False) -> bool:
80
+ def login_flow(is_lock: bool = False) -> bool:
81
81
  auth_info = data.get_auth()
82
82
  if not auth_info or "hash" not in auth_info:
83
83
  if not setup_acc():
@@ -113,7 +113,7 @@ class Lock(BaseCmd):
113
113
  options = None
114
114
  aliases = []
115
115
 
116
- def execute(self, args):
116
+ def execute(self, args: list[str]) -> tuple[int, str]:
117
117
  if login_flow(is_lock=True):
118
118
  return (0, "")
119
119
  else:
@@ -18,7 +18,7 @@ class FsDel(BaseCmd):
18
18
  options = "'history', 'all', 'plugin <file>'"
19
19
  aliases = ["purge"]
20
20
 
21
- def execute(self, args):
21
+ def execute(self, args: list[str]) -> tuple[int, str]:
22
22
  if len(args) < 1:
23
23
  return (1, "\nCommand Error: 'fs del' requires a target.\n")
24
24
  target = args[0].lower()
@@ -57,7 +57,7 @@ class FsDel(BaseCmd):
57
57
  )
58
58
  return (
59
59
  1,
60
- f"\nPlugin Error: No data found for plugin '{plugin_name}'.\n",
60
+ f"\nPlugin Error: No data found for plugin '{plugin_name}'\n",
61
61
  )
62
62
  return (1, "\nAction cancelled.\n")
63
63
  case "all":
@@ -84,7 +84,7 @@ class FsInfo(BaseCmd):
84
84
  options = None
85
85
  aliases = []
86
86
 
87
- def execute(self, args):
87
+ def execute(self, args: list[str]) -> tuple[int, str]:
88
88
  return (
89
89
  0,
90
90
  (
@@ -106,7 +106,7 @@ class FsLicence(BaseCmd):
106
106
  options = None
107
107
  aliases = ["license"]
108
108
 
109
- def execute(self, args):
109
+ def execute(self, args: list[str]) -> tuple[int, str]:
110
110
  return (
111
111
  0,
112
112
  (
@@ -127,7 +127,7 @@ class FsPlugins(BaseCmd):
127
127
  options = None
128
128
  aliases = ["plugin"]
129
129
 
130
- def execute(self, args):
130
+ def execute(self, args: list[str]) -> tuple[int, str]:
131
131
  lines = ["\nInstalled Plugins:"]
132
132
  if c.PLUGINS:
133
133
  for name, plugin in c.PLUGINS.items():
@@ -147,7 +147,7 @@ class FsSeason(BaseCmd):
147
147
  options = None
148
148
  aliases = []
149
149
 
150
- def execute(self, args):
150
+ def execute(self, args: list[str]) -> tuple[int, str]:
151
151
  season = seasonal.get_season(return_icons=False)
152
152
  if not season:
153
153
  return (0, "\nNo seasonal modes are active at present.\n")
@@ -162,7 +162,7 @@ class FsStatus(BaseCmd):
162
162
  options = None
163
163
  aliases = []
164
164
 
165
- def execute(self, args):
165
+ def execute(self, args: list[str]) -> tuple[int, str]:
166
166
  uptime = int(time.time() - c.SESSION_START_TIME)
167
167
  mins, secs = divmod(uptime, 60)
168
168
  hours, mins = divmod(mins, 60)
@@ -195,7 +195,7 @@ class FsVersion(BaseCmd):
195
195
  options = None
196
196
  aliases = []
197
197
 
198
- def execute(self, args):
198
+ def execute(self, args: list[str]) -> tuple[int, str]:
199
199
  return (
200
200
  0,
201
201
  (
@@ -212,7 +212,7 @@ class Fs(ParentCmd):
212
212
  description = "Execute core Flyshell control and utility functions"
213
213
  aliases = []
214
214
 
215
- def get_subcommands(self):
215
+ def get_subcommands(self) -> list[BaseCmd]:
216
216
  return [
217
217
  FsDel(),
218
218
  FsInfo(),
@@ -15,7 +15,7 @@ class Cd(BaseCmd):
15
15
  options = "Directory name (default is Home)"
16
16
  aliases = []
17
17
 
18
- def execute(self, args):
18
+ def execute(self, args: list[str]) -> tuple[int, str]:
19
19
  target = os.path.expanduser(" ".join(args)) if args else os.path.expanduser("~")
20
20
  try:
21
21
  os.chdir(target)
@@ -27,7 +27,7 @@ class Cd(BaseCmd):
27
27
  except OSError as e:
28
28
  return (
29
29
  1,
30
- f"\nCommand Error: Invalid path syntax '{target}'. ({e.strerror})\n",
30
+ f"\nCommand Error: Invalid path syntax '{target}' ({e.strerror})\n",
31
31
  )
32
32
 
33
33
 
@@ -38,7 +38,7 @@ class OpenFile(BaseCmd):
38
38
  options = "File path"
39
39
  aliases = []
40
40
 
41
- def execute(self, args):
41
+ def execute(self, args: list[str]) -> tuple[int, str]:
42
42
  target = " ".join(args).strip().strip('"')
43
43
  if not target:
44
44
  return (0, "")
@@ -69,7 +69,7 @@ class SysExe(BaseCmd):
69
69
  options = "Any host command"
70
70
  aliases = []
71
71
 
72
- def execute(self, args):
72
+ def execute(self, args: list[str]) -> tuple[int, str]:
73
73
  if not args:
74
74
  return (1, "\nCommand Error: 'sys' requires at least 1 parameter(s).\n")
75
75
  try:
@@ -20,7 +20,7 @@ class Clear(BaseCmd):
20
20
  options = None
21
21
  aliases = ["cls"]
22
22
 
23
- def execute(self, args):
23
+ def execute(self, args: list[str]) -> tuple[int, str]:
24
24
  return (0, c.CLEAR_SCREEN)
25
25
 
26
26
 
@@ -36,7 +36,7 @@ class Echo(BaseCmd):
36
36
  options = "Message"
37
37
  aliases = []
38
38
 
39
- def execute(self, args):
39
+ def execute(self, args: list[str]) -> tuple[int, str]:
40
40
  text = " ".join(args)
41
41
  try:
42
42
  text = _ESCAPE_SEQ_RE.sub(
@@ -55,7 +55,7 @@ class History(BaseCmd):
55
55
  options = "Entry count (default is 10)"
56
56
  aliases = []
57
57
 
58
- def execute(self, args):
58
+ def execute(self, args: list[str]) -> tuple[int, str]:
59
59
  limit = 10
60
60
  if args:
61
61
  sub_arg = args[0].lower()
@@ -90,7 +90,7 @@ class Kill(BaseCmd):
90
90
  options = None
91
91
  aliases = []
92
92
 
93
- def execute(self, args):
93
+ def execute(self, args: list[str]) -> tuple[int, str]:
94
94
  choice = input("\nAre you sure [y/n]?: ").strip().lower()
95
95
  if choice == "y":
96
96
  return (-1, "\nShutting down...\n")
@@ -104,7 +104,7 @@ class Reboot(BaseCmd):
104
104
  options = None
105
105
  aliases = ["restart"]
106
106
 
107
- def execute(self, args):
107
+ def execute(self, args: list[str]) -> tuple[int, str]:
108
108
  print("\nRestarting Flyshell...\n")
109
109
  is_direct_script = (
110
110
  sys.argv[0].lower().endswith(".exe")
@@ -133,7 +133,7 @@ class Sleep(BaseCmd):
133
133
  options = "Duration (secs)"
134
134
  aliases = []
135
135
 
136
- def execute(self, args):
136
+ def execute(self, args: list[str]) -> tuple[int, str]:
137
137
  if not args or not args[0].replace(".", "", 1).isdigit():
138
138
  return (
139
139
  1,
@@ -5,9 +5,9 @@ import os
5
5
  import platform
6
6
  import time
7
7
 
8
- BUILD = 203
9
- VERFULL = "1.5.10c"
10
- VERSION = "1.5.10"
8
+ BUILD = 206
9
+ VERFULL = "1.6.0c"
10
+ VERSION = "1.6.0"
11
11
 
12
12
 
13
13
  def _resolve_app_dir() -> Path:
@@ -28,7 +28,7 @@ def check_readline() -> bool:
28
28
  return False
29
29
 
30
30
 
31
- def load_history():
31
+ def load_history() -> None:
32
32
  if not readline:
33
33
  return
34
34
  history_entries = data.get_history(limit=100)
@@ -37,7 +37,7 @@ def load_history():
37
37
  readline.add_history(entry["command"])
38
38
 
39
39
 
40
- def boot():
40
+ def boot() -> None:
41
41
  load_history()
42
42
  env.create_env()
43
43
  print(c.CLEAR_SCREEN, end="")
@@ -3,12 +3,13 @@
3
3
  from flyshell import constants as c
4
4
 
5
5
  from pathlib import Path
6
+ from typing import Any
6
7
  import json
7
8
  import sqlite3
8
9
  import time
9
10
 
10
11
 
11
- def get_storage_size(filename=None) -> str:
12
+ def get_storage_size(filename: str | Path | None = None) -> str:
12
13
  target = Path(filename) if filename is not None else c.FILE_PATH
13
14
  if not target.exists():
14
15
  return "File not found"
@@ -22,7 +23,7 @@ def get_storage_size(filename=None) -> str:
22
23
  return f"{num_bytes:.2f} TB"
23
24
 
24
25
 
25
- def _get_connection(filename=None):
26
+ def _get_connection(filename: str | Path | None = None) -> sqlite3.Connection:
26
27
  target = Path(filename) if filename is not None else c.FILE_PATH
27
28
  if str(target) != ":memory:":
28
29
  target.parent.mkdir(parents=True, exist_ok=True)
@@ -31,7 +32,9 @@ def _get_connection(filename=None):
31
32
  return conn
32
33
 
33
34
 
34
- def initialise(filename=None, initialised=None):
35
+ def initialise(
36
+ filename: str | Path | None = None, initialised: set[str] | None = None
37
+ ) -> None:
35
38
  target = filename if filename is not None else c.FILE_PATH
36
39
  if initialised is None:
37
40
  initialised = c.INITIALISED
@@ -85,7 +88,7 @@ def initialise(filename=None, initialised=None):
85
88
  initialised.add(target)
86
89
 
87
90
 
88
- def get_auth(filename=None) -> dict | None:
91
+ def get_auth(filename: str | Path | None = None) -> dict | None:
89
92
  initialise(filename)
90
93
  with _get_connection(filename) as conn:
91
94
  row = conn.execute(
@@ -101,7 +104,9 @@ def get_auth(filename=None) -> dict | None:
101
104
  }
102
105
 
103
106
 
104
- def set_auth(username: str, pwd_hash: str, salt: str, filename=None) -> None:
107
+ def set_auth(
108
+ username: str, pwd_hash: str, salt: str, filename: str | Path | None = None
109
+ ) -> None:
105
110
  initialise(filename)
106
111
  now_utc = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
107
112
  with _get_connection(filename) as conn:
@@ -115,7 +120,7 @@ def set_auth(username: str, pwd_hash: str, salt: str, filename=None) -> None:
115
120
  )
116
121
 
117
122
 
118
- def clear_auth(filename=None) -> bool:
123
+ def clear_auth(filename: str | Path | None = None) -> bool:
119
124
  initialise(filename)
120
125
  with _get_connection(filename) as conn:
121
126
  with conn:
@@ -123,7 +128,9 @@ def clear_auth(filename=None) -> bool:
123
128
  return cursor.rowcount > 0
124
129
 
125
130
 
126
- def append_history(cmd: str, timestamp: str, filename=None) -> None:
131
+ def append_history(
132
+ cmd: str, timestamp: str, filename: str | Path | None = None
133
+ ) -> None:
127
134
  initialise(filename)
128
135
  with _get_connection(filename) as conn:
129
136
  with conn:
@@ -133,7 +140,9 @@ def append_history(cmd: str, timestamp: str, filename=None) -> None:
133
140
  )
134
141
 
135
142
 
136
- def get_history(limit: int | None = None, filename=None) -> list[dict]:
143
+ def get_history(
144
+ limit: int | None = None, filename: str | Path | None = None
145
+ ) -> list[dict]:
137
146
  initialise(filename)
138
147
  with _get_connection(filename) as conn:
139
148
  if limit is not None and limit > 0:
@@ -148,7 +157,7 @@ def get_history(limit: int | None = None, filename=None) -> list[dict]:
148
157
  return [{"command": r[0], "timestamp": r[1]} for r in rows]
149
158
 
150
159
 
151
- def clear_history(filename=None) -> bool:
160
+ def clear_history(filename: str | Path | None = None) -> bool:
152
161
  initialise(filename)
153
162
  with _get_connection(filename) as conn:
154
163
  with conn:
@@ -156,7 +165,9 @@ def clear_history(filename=None) -> bool:
156
165
  return True
157
166
 
158
167
 
159
- def get_config(key: str, default=None, filename=None):
168
+ def get_config(
169
+ key: str, default: Any = None, filename: str | Path | None = None
170
+ ) -> Any:
160
171
  initialise(filename)
161
172
  with _get_connection(filename) as conn:
162
173
  row = conn.execute(
@@ -170,7 +181,7 @@ def get_config(key: str, default=None, filename=None):
170
181
  return row[0]
171
182
 
172
183
 
173
- def set_config(key: str, value, filename=None) -> None:
184
+ def set_config(key: str, value: Any, filename: str | Path | None = None) -> None:
174
185
  initialise(filename)
175
186
  serialized = json.dumps(value)
176
187
  with _get_connection(filename) as conn:
@@ -184,7 +195,7 @@ def set_config(key: str, value, filename=None) -> None:
184
195
  )
185
196
 
186
197
 
187
- def delete_config(key: str, filename=None) -> bool:
198
+ def delete_config(key: str, filename: str | Path | None = None) -> bool:
188
199
  initialise(filename)
189
200
  with _get_connection(filename) as conn:
190
201
  with conn:
@@ -192,7 +203,7 @@ def delete_config(key: str, filename=None) -> bool:
192
203
  return cursor.rowcount > 0
193
204
 
194
205
 
195
- def register_plugin(plugin_name: str, filename=None) -> None:
206
+ def register_plugin(plugin_name: str, filename: str | Path | None = None) -> None:
196
207
  initialise(filename)
197
208
  now_utc = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
198
209
  with _get_connection(filename) as conn:
@@ -206,7 +217,9 @@ def register_plugin(plugin_name: str, filename=None) -> None:
206
217
  )
207
218
 
208
219
 
209
- def get_plugin_data(plugin_name: str, key: str, default=None, filename=None):
220
+ def get_plugin_data(
221
+ plugin_name: str, key: str, default: Any = None, filename: str | Path | None = None
222
+ ) -> Any:
210
223
  initialise(filename)
211
224
  with _get_connection(filename) as conn:
212
225
  row = conn.execute(
@@ -223,7 +236,9 @@ def get_plugin_data(plugin_name: str, key: str, default=None, filename=None):
223
236
  return row[0]
224
237
 
225
238
 
226
- def set_plugin_data(plugin_name: str, key: str, value, filename=None) -> None:
239
+ def set_plugin_data(
240
+ plugin_name: str, key: str, value: Any, filename: str | Path | None = None
241
+ ) -> None:
227
242
  initialise(filename)
228
243
  register_plugin(plugin_name, filename=filename)
229
244
  serialized = json.dumps(value)
@@ -238,7 +253,7 @@ def set_plugin_data(plugin_name: str, key: str, value, filename=None) -> None:
238
253
  )
239
254
 
240
255
 
241
- def get_all_plugin_data(plugin_name: str, filename=None) -> dict:
256
+ def get_all_plugin_data(plugin_name: str, filename: str | Path | None = None) -> dict:
242
257
  initialise(filename)
243
258
  with _get_connection(filename) as conn:
244
259
  rows = conn.execute(
@@ -253,7 +268,7 @@ def get_all_plugin_data(plugin_name: str, filename=None) -> dict:
253
268
  return result
254
269
 
255
270
 
256
- def purge_plugin(plugin_name: str, filename=None) -> bool:
271
+ def purge_plugin(plugin_name: str, filename: str | Path | None = None) -> bool:
257
272
  initialise(filename)
258
273
  with _get_connection(filename) as conn:
259
274
  with conn:
@@ -263,7 +278,7 @@ def purge_plugin(plugin_name: str, filename=None) -> bool:
263
278
  return cursor.rowcount > 0
264
279
 
265
280
 
266
- def purge_all_plugin_data(filename=None) -> bool:
281
+ def purge_all_plugin_data(filename: str | Path | None = None) -> bool:
267
282
  initialise(filename)
268
283
  with _get_connection(filename) as conn:
269
284
  with conn:
@@ -272,7 +287,9 @@ def purge_all_plugin_data(filename=None) -> bool:
272
287
  return True
273
288
 
274
289
 
275
- def delete_plugin_data(plugin_name: str, key: str, filename=None) -> bool:
290
+ def delete_plugin_data(
291
+ plugin_name: str, key: str, filename: str | Path | None = None
292
+ ) -> bool:
276
293
  initialise(filename)
277
294
  with _get_connection(filename) as conn:
278
295
  with conn:
@@ -22,7 +22,7 @@ class Cmds(BaseCmd):
22
22
  options = None
23
23
  aliases = ["help"]
24
24
 
25
- def execute(self, args):
25
+ def execute(self, args: list[str]) -> tuple[int, str]:
26
26
  lines = ["\nAvailable Commands:"]
27
27
  seen_cmds = set()
28
28
  for cmd in COMMAND_REGISTRY.values():
@@ -87,7 +87,7 @@ for cmd_obj in INSTALLED_COMMANDS:
87
87
  RESERVED_NAMES = set(COMMAND_REGISTRY.keys())
88
88
 
89
89
 
90
- def log(cmd):
90
+ def log(cmd: str) -> None:
91
91
  utc_now = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
92
92
  data.append_history(cmd, utc_now)
93
93
 
@@ -284,7 +284,7 @@ def _parse_commands(raw_cmd: str) -> list:
284
284
  return chain
285
285
 
286
286
 
287
- def execute_line(raw_cmd: str):
287
+ def execute_line(raw_cmd: str) -> None:
288
288
  chain = _parse_commands(raw_cmd)
289
289
  if not chain:
290
290
  return
@@ -61,7 +61,7 @@ def boot_check() -> bool:
61
61
  return True
62
62
 
63
63
 
64
- def main():
64
+ def main() -> None:
65
65
  os.system("")
66
66
  print("\033[H\033[2J", end="")
67
67
  print("\nLaunch process initiated. Flyshell is checking it is able to launch...")
@@ -75,7 +75,7 @@ class Cat(BaseCmd):
75
75
  options = "Target file"
76
76
  aliases = ["read"]
77
77
 
78
- def execute(self, args):
78
+ def execute(self, args: list[str]) -> tuple[int, str]:
79
79
  show_numbers = ("-n" in args) or ("--number" in args)
80
80
  limit = None
81
81
  filtered_args = []
@@ -131,7 +131,7 @@ class Copy(BaseCmd):
131
131
  options = "Source, then destination"
132
132
  aliases = ["copy"]
133
133
 
134
- def execute(self, args):
134
+ def execute(self, args: list[str]) -> tuple[int, str]:
135
135
  force = ("-f" in args) or ("--force" in args)
136
136
  flags = {"-f", "--force"}
137
137
  path_tokens = [arg for arg in args if arg not in flags]
@@ -185,7 +185,7 @@ class Dir(BaseCmd):
185
185
  options = None
186
186
  aliases = ["ls"]
187
187
 
188
- def execute(self, args):
188
+ def execute(self, args: list[str]) -> tuple[int, str]:
189
189
  target_str = args[0].strip("\"'") if args else os.getcwd()
190
190
  target_path = Path(target_str).expanduser().resolve()
191
191
  if bridge.has_native_support() and hasattr(bridge._native, "dir"):
@@ -211,7 +211,7 @@ class Move(BaseCmd):
211
211
  options = "Source, then destination"
212
212
  aliases = ["move"]
213
213
 
214
- def execute(self, args):
214
+ def execute(self, args: list[str]) -> tuple[int, str]:
215
215
  force = ("-f" in args) or ("--force" in args)
216
216
  flags = {"-f", "--force"}
217
217
  path_tokens = [arg for arg in args if arg not in flags]
@@ -276,7 +276,7 @@ class MkDir(BaseCmd):
276
276
  options = "Directory name"
277
277
  aliases = ["md"]
278
278
 
279
- def execute(self, args):
279
+ def execute(self, args: list[str]) -> tuple[int, str]:
280
280
  use_parents = ("-p" in args) or ("--parents" in args)
281
281
  path_tokens = [arg for arg in args if arg not in ("-p", "--parents")]
282
282
  if not path_tokens:
@@ -304,7 +304,7 @@ class Rename(BaseCmd):
304
304
  options = "Old name, then new name"
305
305
  aliases = []
306
306
 
307
- def execute(self, args):
307
+ def execute(self, args: list[str]) -> tuple[int, str]:
308
308
  raw_src = args[0].strip("\"'")
309
309
  raw_new_name = args[1].strip("\"'")
310
310
  if raw_new_name in (".", "..") or "/" in raw_new_name or "\\" in raw_new_name:
@@ -346,7 +346,7 @@ class Rm(BaseCmd):
346
346
  options = "Target file"
347
347
  aliases = ["del"]
348
348
 
349
- def execute(self, args):
349
+ def execute(self, args: list[str]) -> tuple[int, str]:
350
350
  force = ("-f" in args) or ("--force" in args)
351
351
  recursive = ("-r" in args) or ("--recursive" in args)
352
352
  flags = {"-f", "--force", "-r", "--recursive"}
@@ -397,7 +397,7 @@ class RmDir(BaseCmd):
397
397
  options = "Target directory"
398
398
  aliases = []
399
399
 
400
- def execute(self, args):
400
+ def execute(self, args: list[str]) -> tuple[int, str]:
401
401
  force = ("-f" in args) or ("--force" in args)
402
402
  path_tokens = [arg for arg in args if arg not in ("-f", "--force")]
403
403
  if not path_tokens:
@@ -430,7 +430,7 @@ class Touch(BaseCmd):
430
430
  min_args = 1
431
431
  options = "Target file"
432
432
 
433
- def execute(self, args):
433
+ def execute(self, args: list[str]) -> tuple[int, str]:
434
434
  if not args:
435
435
  return (1, "\nCommand Error: Target file not specified.\n")
436
436
  raw_target = " ".join(args).strip("\"'")
@@ -1,6 +1,6 @@
1
1
  # src/flyshell/startup/deps.py
2
2
 
3
- from typing import List, Tuple
3
+ from typing import Any, List, Tuple
4
4
  import importlib.util
5
5
 
6
6
 
@@ -12,7 +12,7 @@ def check_module_installed(module_name: str) -> bool:
12
12
  return False
13
13
 
14
14
 
15
- def verify_plugin_dependencies(plugin) -> Tuple[List[str], List[str]]:
15
+ def verify_plugin_dependencies(plugin: Any) -> Tuple[List[str], List[str]]:
16
16
  declared = getattr(plugin, "third_pty_libs", None) or []
17
17
  installed = []
18
18
  missing = []
@@ -14,7 +14,7 @@ def get_env_path() -> Path:
14
14
  return primary
15
15
 
16
16
 
17
- def create_env():
17
+ def create_env() -> None:
18
18
  env_path = get_env_path()
19
19
  if not env_path.exists():
20
20
  env_path.touch()
@@ -98,7 +98,7 @@ def get_plugin_api_keys(plugin_name_or_dir: str) -> dict[str, str]:
98
98
  def get_all_keys() -> tuple[int, str]:
99
99
  env_path = get_env_path()
100
100
  if not env_path.exists():
101
- return (1, f"File Config Error: Environment file not found at '{env_path}'.")
101
+ return (1, f"File Config Error: Environment file not found at '{env_path}'")
102
102
  try:
103
103
  all_env = read_env_file()
104
104
  if not all_env:
@@ -116,7 +116,7 @@ def get_plugin_keys_formatted(target_name: str) -> tuple[int, str]:
116
116
  return (1, "Command Error: A valid plugin name must be provided.")
117
117
  env_path = get_env_path()
118
118
  if not env_path.exists():
119
- return (1, f"File Config Error: Environment file not found at '{env_path}'.")
119
+ return (1, f"File Config Error: Environment file not found at '{env_path}'")
120
120
  dir_name, plugin = _resolve_plugin_dir_name(target_name)
121
121
  configured_keys = get_plugin_api_keys(target_name)
122
122
  required_keys = (getattr(plugin, "api_keys", None) or []) if plugin else []
@@ -13,7 +13,7 @@ import inspect
13
13
  import sys
14
14
 
15
15
 
16
- def scan_plugins(plugin_folder=None):
16
+ def scan_plugins(plugin_folder: str | Path | None = None) -> None:
17
17
  folder = Path(plugin_folder) if plugin_folder else c.USER_PLUGIN_DIR
18
18
  c.PLUGINS.clear()
19
19
  if not folder.exists():
@@ -100,7 +100,9 @@ def scan_plugins(plugin_folder=None):
100
100
  print("\nNo plugins loaded.")
101
101
 
102
102
 
103
- def build_context(plugin_name, default_name, file_path=None) -> dict:
103
+ def build_context(
104
+ plugin_name: str, default_name: str, file_path: str | Path | None = None
105
+ ) -> dict:
104
106
  plugin_storage = data.get_all_plugin_data(plugin_name)
105
107
  api_keys = env.get_plugin_api_keys(str(default_name))
106
108
  context = {
@@ -115,7 +117,7 @@ def build_context(plugin_name, default_name, file_path=None) -> dict:
115
117
  return context
116
118
 
117
119
 
118
- def check_plugin_api_keys():
120
+ def check_plugin_api_keys() -> None:
119
121
  if not c.PLUGINS:
120
122
  return
121
123
  print("\nFlyshell will now check plugin API keys.")
@@ -171,7 +173,7 @@ def check_all_plugin_dependencies() -> Dict[str, List[str]]:
171
173
  return all_missing
172
174
 
173
175
 
174
- def unload_plugins():
176
+ def unload_plugins() -> None:
175
177
  for identifier, plugin in list(c.PLUGINS.items()):
176
178
  try:
177
179
  if hasattr(plugin, "on_unload"):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.5.10
3
+ Version: 1.6.0
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License-Expression: 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/ci.yml/badge.svg)
25
25
 
26
- > Documentation last updated: v1.5.8
26
+ > Documentation last updated: v1.6.0
27
27
 
28
28
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
29
29
 
@@ -38,7 +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` on Windows or Linux, Flyshell is shipped with pre-compiled wheels. For macOS users, Xcode CLI tools is required as macOS builds install from source.
41
+ 6. **Automatic C-Extension Compilation**: If installed via `pip` on Windows or Linux, Flyshell is shipped with pre-compiled wheels. For macOS users, Xcode CLI Tools is required as macOS builds install from source.
42
42
 
43
43
  ## System Requirements
44
44
 
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