flyshell 1.2.0__tar.gz → 1.2.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.
Files changed (37) hide show
  1. {flyshell-1.2.0/src/flyshell.egg-info → flyshell-1.2.1}/PKG-INFO +1 -1
  2. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/abstract/base_plugin.py +1 -0
  3. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/constants.py +2 -2
  4. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/core/loader.py +23 -11
  5. {flyshell-1.2.0 → flyshell-1.2.1/src/flyshell.egg-info}/PKG-INFO +1 -1
  6. {flyshell-1.2.0 → flyshell-1.2.1}/LICENSE +0 -0
  7. {flyshell-1.2.0 → flyshell-1.2.1}/README.md +0 -0
  8. {flyshell-1.2.0 → flyshell-1.2.1}/pyproject.toml +0 -0
  9. {flyshell-1.2.0 → flyshell-1.2.1}/setup.cfg +0 -0
  10. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/__init__.py +0 -0
  11. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/abstract/__init__.py +0 -0
  12. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/abstract/base_cmd.py +0 -0
  13. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/abstract/parent_cmd.py +0 -0
  14. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/builtin/__init__.py +0 -0
  15. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/builtin/diskops.py +0 -0
  16. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/builtin/fs.py +0 -0
  17. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/builtin/system.py +0 -0
  18. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/builtin/utils.py +0 -0
  19. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/core/__init__.py +0 -0
  20. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/core/auth.py +0 -0
  21. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/core/console.py +0 -0
  22. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/core/data.py +0 -0
  23. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/core/directory.py +0 -0
  24. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell/main.py +0 -0
  25. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell.egg-info/SOURCES.txt +0 -0
  26. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell.egg-info/dependency_links.txt +0 -0
  27. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell.egg-info/entry_points.txt +0 -0
  28. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell.egg-info/requires.txt +0 -0
  29. {flyshell-1.2.0 → flyshell-1.2.1}/src/flyshell.egg-info/top_level.txt +0 -0
  30. {flyshell-1.2.0 → flyshell-1.2.1}/tests/test_auth.py +0 -0
  31. {flyshell-1.2.0 → flyshell-1.2.1}/tests/test_data.py +0 -0
  32. {flyshell-1.2.0 → flyshell-1.2.1}/tests/test_directory.py +0 -0
  33. {flyshell-1.2.0 → flyshell-1.2.1}/tests/test_diskops.py +0 -0
  34. {flyshell-1.2.0 → flyshell-1.2.1}/tests/test_fs.py +0 -0
  35. {flyshell-1.2.0 → flyshell-1.2.1}/tests/test_loader.py +0 -0
  36. {flyshell-1.2.0 → flyshell-1.2.1}/tests/test_security.py +0 -0
  37. {flyshell-1.2.0 → flyshell-1.2.1}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: A modular, zero-dependency command-line environment in Python.
5
5
  License: MIT
6
6
  Requires-Python: >=3.10
@@ -9,6 +9,7 @@ class BasePlugin:
9
9
  description: str = "No description provided."
10
10
  version: str = "1.0.0"
11
11
  author: str = "Unknown"
12
+ identifier: str = ""
12
13
  usage: str = ""
13
14
  extended_help: str = ""
14
15
 
@@ -5,8 +5,8 @@ import os
5
5
  import platform
6
6
  import time
7
7
 
8
- BUILD = 125
9
- VERSION = "1.2.0"
8
+ BUILD = 126
9
+ VERSION = "1.2.1"
10
10
 
11
11
 
12
12
  def _resolve_app_dir() -> Path:
@@ -24,36 +24,48 @@ def scan_plugins(plugin_folder=None):
24
24
  candidates = {}
25
25
  for item in folder.iterdir():
26
26
  file_path = None
27
- plugin_name = None
27
+ default_name = None
28
28
  if item.is_file() and item.suffix == ".py" and not item.name.startswith("_"):
29
29
  file_path = item
30
- plugin_name = item.stem
30
+ default_name = item.stem
31
31
  elif item.is_dir() and not item.name.startswith((".", "_")):
32
32
  entry = item / "plugin.py"
33
33
  if entry.exists():
34
34
  file_path = entry
35
- plugin_name = item.name
36
- if not file_path or not plugin_name:
35
+ default_name = item.name
36
+ if not file_path or not default_name:
37
37
  continue
38
- if plugin_name in RESERVED_NAMES:
38
+ if default_name in RESERVED_NAMES:
39
39
  print(
40
- f"\n⚠️ Collision Error - Plugin '{plugin_name}' conflicts with a built-in Flyshell command and will not be loaded."
40
+ f"\n⚠️ Collision Error - Plugin '{default_name}' conflicts with a built-in Flyshell command and will not be loaded."
41
41
  )
42
42
  continue
43
43
  try:
44
- spec = importlib.util.spec_from_file_location(plugin_name, file_path)
44
+ module_name = f"plugin_{default_name}"
45
+ spec = importlib.util.spec_from_file_location(module_name, file_path)
45
46
  if spec is None or spec.loader is None:
46
47
  continue
47
48
  module = importlib.util.module_from_spec(spec)
48
49
  spec.loader.exec_module(module)
49
50
  for _, obj in inspect.getmembers(module, inspect.isclass):
50
51
  if issubclass(obj, BasePlugin) and obj is not BasePlugin:
51
- ctx = build_context(plugin_name, file_path)
52
+ resolved_name = getattr(obj, "identifier", None) or default_name
53
+
54
+ # Also verify the resolved identifier doesn't conflict with a reserved name
55
+ if resolved_name in RESERVED_NAMES:
56
+ print(
57
+ f"\n⚠️ Collision Error - Plugin '{resolved_name}' conflicts with a built-in Flyshell command and will not be loaded."
58
+ )
59
+ break
60
+
61
+ ctx = build_context(resolved_name, file_path)
52
62
  instance = obj(ctx)
53
- candidates.setdefault(plugin_name, []).append((instance, file_path))
63
+ candidates.setdefault(resolved_name, []).append(
64
+ (instance, file_path)
65
+ )
54
66
  break
55
67
  except Exception as e:
56
- print(f"\n⚠️ Plugin Failure - Failed to inspect '{plugin_name}'")
68
+ print(f"\n⚠️ Plugin Failure - Failed to inspect '{default_name}'")
57
69
  print(f"Exception code: {e}, Flyshell will still launch.")
58
70
  loaded_count = 0
59
71
  first_print = True
@@ -72,7 +84,7 @@ def scan_plugins(plugin_folder=None):
72
84
  if first_print:
73
85
  print("\nInstalled Plugins:")
74
86
  first_print = False
75
- print(f"✅ - {name}")
87
+ print(f"✅ - {instance.name} ({name})")
76
88
  loaded_count += 1
77
89
  if loaded_count > 0:
78
90
  print(f"\nTotal of {loaded_count} plugin(s) found.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.2.0
3
+ Version: 1.2.1
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