flyshell 1.5.7__tar.gz → 1.5.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 (77) hide show
  1. {flyshell-1.5.7/src/flyshell.egg-info → flyshell-1.5.8}/PKG-INFO +4 -3
  2. {flyshell-1.5.7 → flyshell-1.5.8}/README.md +3 -2
  3. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/builtin/fs.py +17 -0
  4. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/constants.py +3 -4
  5. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/core/console.py +8 -3
  6. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/core/data.py +9 -4
  7. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/main.py +1 -0
  8. flyshell-1.5.8/src/flyshell/startup/seasonal.py +57 -0
  9. {flyshell-1.5.7 → flyshell-1.5.8/src/flyshell.egg-info}/PKG-INFO +4 -3
  10. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell.egg-info/SOURCES.txt +1 -0
  11. {flyshell-1.5.7 → flyshell-1.5.8}/LICENSE +0 -0
  12. {flyshell-1.5.7 → flyshell-1.5.8}/MANIFEST.in +0 -0
  13. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/diskops.c +0 -0
  14. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/cat.c +0 -0
  15. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/cp.c +0 -0
  16. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/dir.c +0 -0
  17. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/mkdir.c +0 -0
  18. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/mv.c +0 -0
  19. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/rename.c +0 -0
  20. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/rm.c +0 -0
  21. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/rmdir.c +0 -0
  22. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/posix/touch.c +0 -0
  23. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/shared/dir_types.c +0 -0
  24. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/shared/dir_types.h +0 -0
  25. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/shared/native_errors.h +0 -0
  26. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/shared/win32_utf.h +0 -0
  27. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/cat.c +0 -0
  28. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/cp.c +0 -0
  29. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/dir.c +0 -0
  30. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/mkdir.c +0 -0
  31. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/mv.c +0 -0
  32. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/rename.c +0 -0
  33. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/rm.c +0 -0
  34. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/rmdir.c +0 -0
  35. {flyshell-1.5.7 → flyshell-1.5.8}/c_src/diskops/win32/touch.c +0 -0
  36. {flyshell-1.5.7 → flyshell-1.5.8}/pyproject.toml +0 -0
  37. {flyshell-1.5.7 → flyshell-1.5.8}/setup.cfg +0 -0
  38. {flyshell-1.5.7 → flyshell-1.5.8}/setup.py +0 -0
  39. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/__init__.py +0 -0
  40. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/abstract/__init__.py +0 -0
  41. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/abstract/base_cmd.py +0 -0
  42. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/abstract/base_plugin.py +0 -0
  43. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/abstract/parent_cmd.py +0 -0
  44. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/accounts/__init__.py +0 -0
  45. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/accounts/auth.py +0 -0
  46. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/bin/__init__.py +0 -0
  47. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/builtin/__init__.py +0 -0
  48. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/builtin/pkg.py +0 -0
  49. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/builtin/system.py +0 -0
  50. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/builtin/utils.py +0 -0
  51. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/core/__init__.py +0 -0
  52. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/core/directory.py +0 -0
  53. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/native/__init__.py +0 -0
  54. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/native/diskops_bridge.py +0 -0
  55. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/native/diskops_handler.py +0 -0
  56. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/native/legacy/__init__.py +0 -0
  57. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/native/legacy/diskops.py +0 -0
  58. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/startup/__init__.py +0 -0
  59. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/startup/deps.py +0 -0
  60. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/startup/env.py +0 -0
  61. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell/startup/loader.py +0 -0
  62. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell.egg-info/dependency_links.txt +0 -0
  63. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell.egg-info/entry_points.txt +0 -0
  64. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell.egg-info/requires.txt +0 -0
  65. {flyshell-1.5.7 → flyshell-1.5.8}/src/flyshell.egg-info/top_level.txt +0 -0
  66. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_auth.py +0 -0
  67. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_data.py +0 -0
  68. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_deps.py +0 -0
  69. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_directory.py +0 -0
  70. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_diskops_ext.py +0 -0
  71. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_diskops_lgc.py +0 -0
  72. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_env.py +0 -0
  73. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_fs.py +0 -0
  74. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_loader.py +0 -0
  75. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_pkg.py +0 -0
  76. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_security.py +0 -0
  77. {flyshell-1.5.7 → flyshell-1.5.8}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.5.7
3
+ Version: 1.5.8
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.3
26
+ > Documentation last updated: v1.5.8
27
27
 
28
28
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
29
29
 
@@ -82,7 +82,8 @@ src/
82
82
  │ ├── __init__.py
83
83
  │ ├── deps.py
84
84
  │ ├── env.py
85
- │ └── loader.py
85
+ │ ├── loader.py
86
+ │ └── seasonal.py
86
87
  ├── __init__.py
87
88
  ├── constants.py
88
89
  └── main.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/ci.yml/badge.svg)
8
8
 
9
- > Documentation last updated: v1.5.3
9
+ > Documentation last updated: v1.5.8
10
10
 
11
11
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
12
12
 
@@ -65,7 +65,8 @@ src/
65
65
  │ ├── __init__.py
66
66
  │ ├── deps.py
67
67
  │ ├── env.py
68
- │ └── loader.py
68
+ │ ├── loader.py
69
+ │ └── seasonal.py
69
70
  ├── __init__.py
70
71
  ├── constants.py
71
72
  └── main.py
@@ -4,6 +4,7 @@ from flyshell import constants as c
4
4
  from flyshell.abstract.base_cmd import BaseCmd
5
5
  from flyshell.abstract.parent_cmd import ParentCmd
6
6
  from flyshell.core import data
7
+ from flyshell.startup import seasonal
7
8
 
8
9
  import os
9
10
  import sys
@@ -149,6 +150,21 @@ class FsPlugins(BaseCmd):
149
150
  return (0, "\n".join(lines))
150
151
 
151
152
 
153
+ class FsSeason(BaseCmd):
154
+ name = "season"
155
+ description = "Check if Flyshell is in a seasonal mode"
156
+ min_args = 0
157
+ options = None
158
+ aliases = []
159
+
160
+ def execute(self, args):
161
+ season = seasonal.get_season(return_icons=False)
162
+ if not season:
163
+ return (0, "\nNo seasonal modes are active at present.\n")
164
+ icon = seasonal.get_season(return_icons=True)
165
+ return (0, f"\nCurrent seasonal mode: {season} {icon}\n")
166
+
167
+
152
168
  class FsStatus(BaseCmd):
153
169
  name = "status"
154
170
  description = "Return Flyshell status and runtime details"
@@ -212,6 +228,7 @@ class Fs(ParentCmd):
212
228
  FsInfo(),
213
229
  FsLicence(),
214
230
  FsPlugins(),
231
+ FsSeason(),
215
232
  FsStatus(),
216
233
  FsVersion(),
217
234
  ]
@@ -5,9 +5,9 @@ import os
5
5
  import platform
6
6
  import time
7
7
 
8
- BUILD = 193
9
- VERFULL = "1.5.7c"
10
- VERSION = "1.5.7"
8
+ BUILD = 197
9
+ VERFULL = "1.5.8d"
10
+ VERSION = "1.5.8"
11
11
 
12
12
 
13
13
  def _resolve_app_dir() -> Path:
@@ -19,7 +19,6 @@ def _resolve_app_dir() -> Path:
19
19
  else:
20
20
  base = Path(os.environ.get("XDG_DATA_HOME", home / ".local" / "share"))
21
21
  target = base / "Flyshell"
22
- target.mkdir(parents=True, exist_ok=True)
23
22
  return target
24
23
 
25
24
 
@@ -3,7 +3,7 @@
3
3
  from flyshell import constants as c
4
4
  from flyshell.core import data
5
5
  from flyshell.core.directory import execute_line
6
- from flyshell.startup import env
6
+ from flyshell.startup import env, seasonal
7
7
 
8
8
  import os
9
9
  import random
@@ -41,7 +41,9 @@ def boot():
41
41
  load_history()
42
42
  env.create_env()
43
43
  print(c.CLEAR_SCREEN, end="")
44
- print(f"\nBoot successful, welcome to Flyshell! (Version {c.VERSION})")
44
+ icon = seasonal.get_season(return_icons=True)
45
+ badge = f" {icon}" if icon else ""
46
+ print(f"\nBoot successful, welcome to Flyshell! (Version {c.VERSION}){badge}")
45
47
  user_info = data.get_auth() or {}
46
48
  username = user_info.get("username")
47
49
  greeting = random.choice(c.GREETINGS).format(username=username)
@@ -49,7 +51,10 @@ def boot():
49
51
  while True:
50
52
  try:
51
53
  folder = os.path.basename(os.getcwd())
52
- raw_cmd = input(f"Flyshell [v{c.VERSION}] ({folder})>>")
54
+ icon = seasonal.get_season(return_icons=True)
55
+ badge = f" {icon}" if icon else ""
56
+ print(f"Flyshell [v{c.VERSION}]{badge} ({folder})>>", end="", flush=True)
57
+ raw_cmd = input()
53
58
  if not raw_cmd.strip():
54
59
  continue
55
60
  execute_line(raw_cmd)
@@ -2,6 +2,7 @@
2
2
 
3
3
  from flyshell import constants as c
4
4
 
5
+ from pathlib import Path
5
6
  import json
6
7
  import sqlite3
7
8
  import time
@@ -20,16 +21,20 @@ def get_storage_size() -> str:
20
21
  return f"{num_bytes:.2f} TB"
21
22
 
22
23
 
23
- def _get_connection(filename=c.FILE_PATH):
24
- conn = sqlite3.connect(filename)
24
+ def _get_connection(filename=None):
25
+ target = Path(filename) if filename is not None else c.FILE_PATH
26
+ if str(target) != ":memory:":
27
+ target.parent.mkdir(parents=True, exist_ok=True)
28
+ conn = sqlite3.connect(target)
25
29
  conn.execute("PRAGMA foreign_keys = ON;")
26
30
  return conn
27
31
 
28
32
 
29
- def initialise(filename=c.FILE_PATH, initialised=None):
33
+ def initialise(filename=None, initialised=None):
34
+ target = filename if filename is not None else c.FILE_PATH
30
35
  if initialised is None:
31
36
  initialised = c.INITIALISED
32
- target = str(filename)
37
+ target = str(target)
33
38
  if target in initialised:
34
39
  return
35
40
  with _get_connection(filename) as conn:
@@ -93,6 +93,7 @@ def main():
93
93
  "\n⚠️ C Extensions Unavailable - Flyshell will revert to legacy Python objects where applicable.\n"
94
94
  )
95
95
  print("Flyshell will now boot.")
96
+ c.APP_DIR.mkdir(parents=True, exist_ok=True)
96
97
  loader.scan_plugins()
97
98
  loader.check_plugin_api_keys()
98
99
  loader.check_all_plugin_dependencies()
@@ -0,0 +1,57 @@
1
+ # src/flyshell/startup/seasonal.py
2
+
3
+ from datetime import date, timedelta
4
+ import random
5
+
6
+
7
+ def _get_easter(year: int) -> date:
8
+ a = year % 19
9
+ b = year // 100
10
+ c = year % 100
11
+ d = b // 4
12
+ e = b % 4
13
+ f = (b + 8) // 25
14
+ g = (b - f + 1) // 3
15
+ h = (19 * a + b - d - g + 15) % 30
16
+ i = c // 4
17
+ k = c % 4
18
+ l = (32 + 2 * e + 2 * i - h - k) % 7
19
+ m = (a + 11 * h + 22 * l) // 451
20
+ month = (h + l - 7 * m + 114) // 31
21
+ day = ((h + l - 7 * m + 114) % 31) + 1
22
+ return date(year, month, day)
23
+
24
+
25
+ def get_season(return_icons: bool) -> str:
26
+ today = date.today()
27
+ year = today.year
28
+ # Halloween: 25 > 31 October
29
+ halloween_start = date(year, 10, 25)
30
+ halloween_end = date(year, 10, 31)
31
+ # Winter / Christmas: 1 November > 31 December
32
+ winter_start = date(year, 11, 1)
33
+ winter_end = date(year, 12, 31)
34
+ # Easter: Mon before Good Fri -> Easter Mon
35
+ easter_sunday = _get_easter(year)
36
+ easter_start = easter_sunday - timedelta(days=6)
37
+ easter_end = easter_sunday + timedelta(days=1)
38
+ if return_icons:
39
+ halloween_icons = ["🎃", "👻", "🦇", "🕷️", "🧙"]
40
+ winter_icons = ["🎄", "❄️", "⛄", "🎁", "🦌"]
41
+ easter_icons = ["🐣", "🐰", "🥚", "🌷", "🍫"]
42
+ if halloween_start <= today <= halloween_end:
43
+ selected = random.sample(halloween_icons, 2)
44
+ elif winter_start <= today <= winter_end:
45
+ selected = random.sample(winter_icons, 2)
46
+ elif easter_start <= today <= easter_end:
47
+ selected = random.sample(easter_icons, 2)
48
+ else:
49
+ return ""
50
+ return "".join(selected)
51
+ if halloween_start <= today <= halloween_end:
52
+ return "Halloween"
53
+ elif winter_start <= today <= winter_end:
54
+ return "Christmas"
55
+ elif easter_start <= today <= easter_end:
56
+ return "Easter"
57
+ return ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flyshell
3
- Version: 1.5.7
3
+ Version: 1.5.8
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.3
26
+ > Documentation last updated: v1.5.8
27
27
 
28
28
  A modular, zero-dependency command-line environment and extensible runtime interface built in Python with compiled C-extensions.
29
29
 
@@ -82,7 +82,8 @@ src/
82
82
  │ ├── __init__.py
83
83
  │ ├── deps.py
84
84
  │ ├── env.py
85
- │ └── loader.py
85
+ │ ├── loader.py
86
+ │ └── seasonal.py
86
87
  ├── __init__.py
87
88
  ├── constants.py
88
89
  └── main.py
@@ -60,6 +60,7 @@ src/flyshell/startup/__init__.py
60
60
  src/flyshell/startup/deps.py
61
61
  src/flyshell/startup/env.py
62
62
  src/flyshell/startup/loader.py
63
+ src/flyshell/startup/seasonal.py
63
64
  tests/test_auth.py
64
65
  tests/test_data.py
65
66
  tests/test_deps.py
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