flyshell 1.2.7__tar.gz → 1.2.8__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 (41) hide show
  1. {flyshell-1.2.7/src/flyshell.egg-info → flyshell-1.2.8}/PKG-INFO +1 -1
  2. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/builtin/fs.py +1 -1
  3. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/builtin/pkg.py +13 -3
  4. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/constants.py +2 -2
  5. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/core/env.py +36 -2
  6. {flyshell-1.2.7 → flyshell-1.2.8/src/flyshell.egg-info}/PKG-INFO +1 -1
  7. {flyshell-1.2.7 → flyshell-1.2.8}/LICENSE +0 -0
  8. {flyshell-1.2.7 → flyshell-1.2.8}/README.md +0 -0
  9. {flyshell-1.2.7 → flyshell-1.2.8}/pyproject.toml +0 -0
  10. {flyshell-1.2.7 → flyshell-1.2.8}/setup.cfg +0 -0
  11. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/__init__.py +0 -0
  12. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/abstract/__init__.py +0 -0
  13. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/abstract/base_cmd.py +0 -0
  14. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/abstract/base_plugin.py +0 -0
  15. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/abstract/parent_cmd.py +0 -0
  16. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/builtin/__init__.py +0 -0
  17. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/builtin/diskops.py +0 -0
  18. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/builtin/system.py +0 -0
  19. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/builtin/utils.py +0 -0
  20. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/core/__init__.py +0 -0
  21. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/core/auth.py +0 -0
  22. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/core/console.py +0 -0
  23. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/core/data.py +0 -0
  24. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/core/directory.py +0 -0
  25. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/core/loader.py +0 -0
  26. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell/main.py +0 -0
  27. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell.egg-info/SOURCES.txt +0 -0
  28. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell.egg-info/dependency_links.txt +0 -0
  29. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell.egg-info/entry_points.txt +0 -0
  30. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell.egg-info/requires.txt +0 -0
  31. {flyshell-1.2.7 → flyshell-1.2.8}/src/flyshell.egg-info/top_level.txt +0 -0
  32. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_auth.py +0 -0
  33. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_data.py +0 -0
  34. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_directory.py +0 -0
  35. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_diskops.py +0 -0
  36. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_env_keys.py +0 -0
  37. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_fs.py +0 -0
  38. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_loader.py +0 -0
  39. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_pkg.py +0 -0
  40. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_security.py +0 -0
  41. {flyshell-1.2.7 → flyshell-1.2.8}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License: MIT
6
6
  Requires-Python: >=3.10
@@ -83,7 +83,7 @@ class FsDel(BaseCmd):
83
83
  return (0, "\nAll non-auth system data purged successfully.\n")
84
84
  return (1, "\nAction cancelled.\n")
85
85
  case _:
86
- return (1, f"\nCommand Error: Unknown target '{target}'.\n")
86
+ return (1, f"\nCommand Error: Unknown target '{target}'\n")
87
87
 
88
88
 
89
89
  class FsInfo(BaseCmd):
@@ -10,14 +10,14 @@ class PkgApi(BaseCmd):
10
10
  name: str = "api"
11
11
  description: str = "View configured package/plugin API keys"
12
12
  min_args: int = 1
13
- options: str = "'add'/'view', then package/key details"
13
+ options: str = "'add'/'del'/'edit'/'view', then package name and key name details"
14
14
  aliases: List[str] = ["keys"]
15
15
 
16
16
  def execute(self, args: List[str]) -> Tuple[int, str]:
17
17
  arg = args[0]
18
18
  remaining_args = args[1:]
19
19
  match arg:
20
- case "add":
20
+ case "add" | "edit":
21
21
  if len(remaining_args) < 3:
22
22
  return (
23
23
  1,
@@ -28,6 +28,16 @@ class PkgApi(BaseCmd):
28
28
  val = " ".join(remaining_args[2:])
29
29
  code, output = env.set_plugin_api_key(plugin_name, key_name, val)
30
30
  return (code, f"\n{output}\n")
31
+ case "del" | "rm":
32
+ if len(remaining_args) < 2:
33
+ return (
34
+ 1,
35
+ "\nCommand Error: define a package name and a key name for deletion.\n",
36
+ )
37
+ plugin_name = remaining_args[0]
38
+ key_name = remaining_args[1]
39
+ code, output = env.remove_plugin_api_key(plugin_name, key_name)
40
+ return (code, f"\n{output}\n")
31
41
  case "view":
32
42
  if not remaining_args:
33
43
  code, output = env.get_all_keys()
@@ -36,7 +46,7 @@ class PkgApi(BaseCmd):
36
46
  code, output = env.get_plugin_keys_formatted(package_name)
37
47
  return (code, f"\n{output}\n")
38
48
  case _:
39
- return (1, f"\nCommand Error: Unknown target '{arg}'.\n")
49
+ return (1, f"\nCommand Error: Unknown target '{arg}'\n")
40
50
 
41
51
 
42
52
  class Pkg(ParentCmd):
@@ -5,8 +5,8 @@ import os
5
5
  import platform
6
6
  import time
7
7
 
8
- BUILD = 132
9
- VERSION = "1.2.7"
8
+ BUILD = 133
9
+ VERSION = "1.2.8"
10
10
 
11
11
 
12
12
  def _resolve_app_dir() -> Path:
@@ -1,4 +1,4 @@
1
- # src/flyshell/core/env.py
1
+ # src\flyshell\core\env.py
2
2
 
3
3
  from pathlib import Path
4
4
  from flyshell import constants as c
@@ -156,7 +156,41 @@ def set_plugin_api_key(plugin_name: str, key_name: str, value: str) -> tuple[int
156
156
  new_lines.append(f"{target_key}={clean_val}")
157
157
  env_path.write_text("\n".join(new_lines) + "\n", encoding="utf-8")
158
158
  action = "Updated" if updated else "Added"
159
- return (0, f"SUCCESS! {action.lower()} key '{target_key}'.")
159
+ return (0, f"SUCCESS! {action} key '{target_key}'")
160
160
 
161
161
  except Exception as e:
162
162
  return (1, f"File Error: Failed to write to '{env_path}': {e}")
163
+
164
+
165
+ def remove_plugin_api_key(plugin_name: str, key_name: str) -> tuple[int, str]:
166
+ if not plugin_name or not key_name:
167
+ return (1, "Command Error: Both plugin name and key name are required.")
168
+ target_key = f"{plugin_name.strip().lower()}_{key_name.strip().lower()}"
169
+ env_path = get_env_path()
170
+ if not env_path.exists():
171
+ return (
172
+ 1,
173
+ f"File Config Error: Environment file not found at '{env_path}'",
174
+ )
175
+ try:
176
+ lines = env_path.read_text(encoding="utf-8").splitlines()
177
+ new_lines = []
178
+ found = False
179
+ for line in lines:
180
+ stripped = line.strip()
181
+ if stripped and not stripped.startswith("#") and "=" in stripped:
182
+ k, _ = stripped.split("=", 1)
183
+ clean_k = k.strip().replace("[", "").replace("]", "").lower()
184
+ if clean_k == target_key:
185
+ found = True
186
+ continue
187
+ new_lines.append(line)
188
+ if not found:
189
+ return (
190
+ 1,
191
+ f"Command Error: Key '{target_key}' not found in '{env_path.name}'",
192
+ )
193
+ env_path.write_text("\n".join(new_lines) + "\n", encoding="utf-8")
194
+ return (0, f"SUCCESS! Removed key '{target_key}' from Flyshell environment.")
195
+ except Exception as e:
196
+ return (1, f"File Error: Failed to update '{env_path}': {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License: MIT
6
6
  Requires-Python: >=3.10
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