flyshell 1.5.7__tar.gz → 1.5.9__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.
- {flyshell-1.5.7/src/flyshell.egg-info → flyshell-1.5.9}/PKG-INFO +4 -3
- {flyshell-1.5.7 → flyshell-1.5.9}/README.md +3 -2
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/builtin/fs.py +17 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/builtin/system.py +1 -1
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/constants.py +3 -4
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/core/console.py +8 -3
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/core/data.py +29 -23
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/main.py +2 -1
- flyshell-1.5.9/src/flyshell/startup/seasonal.py +57 -0
- {flyshell-1.5.7 → flyshell-1.5.9/src/flyshell.egg-info}/PKG-INFO +4 -3
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell.egg-info/SOURCES.txt +1 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/LICENSE +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/MANIFEST.in +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/diskops.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/cat.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/cp.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/dir.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/mkdir.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/mv.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/rename.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/rm.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/rmdir.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/posix/touch.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/shared/dir_types.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/shared/dir_types.h +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/shared/native_errors.h +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/shared/win32_utf.h +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/cat.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/cp.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/dir.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/mkdir.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/mv.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/rename.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/rm.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/rmdir.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/c_src/diskops/win32/touch.c +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/pyproject.toml +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/setup.cfg +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/setup.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/abstract/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/abstract/base_cmd.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/abstract/base_plugin.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/abstract/parent_cmd.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/accounts/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/accounts/auth.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/bin/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/builtin/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/builtin/pkg.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/builtin/utils.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/core/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/core/directory.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/native/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/native/diskops_bridge.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/native/diskops_handler.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/native/legacy/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/native/legacy/diskops.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/startup/__init__.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/startup/deps.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/startup/env.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell/startup/loader.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell.egg-info/dependency_links.txt +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell.egg-info/entry_points.txt +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell.egg-info/requires.txt +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/src/flyshell.egg-info/top_level.txt +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_auth.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_data.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_deps.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_directory.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_diskops_ext.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_diskops_lgc.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_env.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_fs.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_loader.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_pkg.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_security.py +0 -0
- {flyshell-1.5.7 → flyshell-1.5.9}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flyshell
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.9
|
|
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
|

|
|
24
24
|

|
|
25
25
|
|
|
26
|
-
> Documentation last updated: v1.5.
|
|
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
|
-
│
|
|
85
|
+
│ ├── loader.py
|
|
86
|
+
│ └── seasonal.py
|
|
86
87
|
├── __init__.py
|
|
87
88
|
├── constants.py
|
|
88
89
|
└── main.py
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|

|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
> Documentation last updated: v1.5.
|
|
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
|
-
│
|
|
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 =
|
|
9
|
-
VERFULL = "1.5.
|
|
10
|
-
VERSION = "1.5.
|
|
8
|
+
BUILD = 200
|
|
9
|
+
VERFULL = "1.5.9c"
|
|
10
|
+
VERSION = "1.5.9"
|
|
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
|
-
|
|
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
|
-
|
|
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,15 +2,17 @@
|
|
|
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
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
def get_storage_size() -> str:
|
|
11
|
-
if not c.FILE_PATH
|
|
11
|
+
def get_storage_size(filename=None) -> str:
|
|
12
|
+
target = Path(filename) if filename is not None else c.FILE_PATH
|
|
13
|
+
if not target.exists():
|
|
12
14
|
return "File not found"
|
|
13
|
-
num_bytes = float(
|
|
15
|
+
num_bytes = float(target.stat().st_size)
|
|
14
16
|
for unit in ["B", "KB", "MB", "GB"]:
|
|
15
17
|
if num_bytes < 1024.0:
|
|
16
18
|
return (
|
|
@@ -20,16 +22,20 @@ def get_storage_size() -> str:
|
|
|
20
22
|
return f"{num_bytes:.2f} TB"
|
|
21
23
|
|
|
22
24
|
|
|
23
|
-
def _get_connection(filename=
|
|
24
|
-
|
|
25
|
+
def _get_connection(filename=None):
|
|
26
|
+
target = Path(filename) if filename is not None else c.FILE_PATH
|
|
27
|
+
if str(target) != ":memory:":
|
|
28
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
29
|
+
conn = sqlite3.connect(target)
|
|
25
30
|
conn.execute("PRAGMA foreign_keys = ON;")
|
|
26
31
|
return conn
|
|
27
32
|
|
|
28
33
|
|
|
29
|
-
def initialise(filename=
|
|
34
|
+
def initialise(filename=None, initialised=None):
|
|
35
|
+
target = filename if filename is not None else c.FILE_PATH
|
|
30
36
|
if initialised is None:
|
|
31
37
|
initialised = c.INITIALISED
|
|
32
|
-
target = str(
|
|
38
|
+
target = str(target)
|
|
33
39
|
if target in initialised:
|
|
34
40
|
return
|
|
35
41
|
with _get_connection(filename) as conn:
|
|
@@ -79,7 +85,7 @@ def initialise(filename=c.FILE_PATH, initialised=None):
|
|
|
79
85
|
initialised.add(target)
|
|
80
86
|
|
|
81
87
|
|
|
82
|
-
def get_auth(filename=
|
|
88
|
+
def get_auth(filename=None) -> dict | None:
|
|
83
89
|
initialise(filename)
|
|
84
90
|
with _get_connection(filename) as conn:
|
|
85
91
|
row = conn.execute(
|
|
@@ -95,7 +101,7 @@ def get_auth(filename=c.FILE_PATH) -> dict | None:
|
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
|
|
98
|
-
def set_auth(username: str, pwd_hash: str, salt: str, filename=
|
|
104
|
+
def set_auth(username: str, pwd_hash: str, salt: str, filename=None) -> None:
|
|
99
105
|
initialise(filename)
|
|
100
106
|
now_utc = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
|
|
101
107
|
with _get_connection(filename) as conn:
|
|
@@ -109,7 +115,7 @@ def set_auth(username: str, pwd_hash: str, salt: str, filename=c.FILE_PATH) -> N
|
|
|
109
115
|
)
|
|
110
116
|
|
|
111
117
|
|
|
112
|
-
def clear_auth(filename=
|
|
118
|
+
def clear_auth(filename=None) -> bool:
|
|
113
119
|
initialise(filename)
|
|
114
120
|
with _get_connection(filename) as conn:
|
|
115
121
|
with conn:
|
|
@@ -117,7 +123,7 @@ def clear_auth(filename=c.FILE_PATH) -> bool:
|
|
|
117
123
|
return cursor.rowcount > 0
|
|
118
124
|
|
|
119
125
|
|
|
120
|
-
def append_history(cmd: str, timestamp: str, filename=
|
|
126
|
+
def append_history(cmd: str, timestamp: str, filename=None) -> None:
|
|
121
127
|
initialise(filename)
|
|
122
128
|
with _get_connection(filename) as conn:
|
|
123
129
|
with conn:
|
|
@@ -127,7 +133,7 @@ def append_history(cmd: str, timestamp: str, filename=c.FILE_PATH) -> None:
|
|
|
127
133
|
)
|
|
128
134
|
|
|
129
135
|
|
|
130
|
-
def get_history(limit: int | None = None, filename=
|
|
136
|
+
def get_history(limit: int | None = None, filename=None) -> list[dict]:
|
|
131
137
|
initialise(filename)
|
|
132
138
|
with _get_connection(filename) as conn:
|
|
133
139
|
if limit is not None and limit > 0:
|
|
@@ -142,7 +148,7 @@ def get_history(limit: int | None = None, filename=c.FILE_PATH) -> list[dict]:
|
|
|
142
148
|
return [{"command": r[0], "timestamp": r[1]} for r in rows]
|
|
143
149
|
|
|
144
150
|
|
|
145
|
-
def clear_history(filename=
|
|
151
|
+
def clear_history(filename=None) -> bool:
|
|
146
152
|
initialise(filename)
|
|
147
153
|
with _get_connection(filename) as conn:
|
|
148
154
|
with conn:
|
|
@@ -150,7 +156,7 @@ def clear_history(filename=c.FILE_PATH) -> bool:
|
|
|
150
156
|
return True
|
|
151
157
|
|
|
152
158
|
|
|
153
|
-
def get_config(key: str, default=None, filename=
|
|
159
|
+
def get_config(key: str, default=None, filename=None):
|
|
154
160
|
initialise(filename)
|
|
155
161
|
with _get_connection(filename) as conn:
|
|
156
162
|
row = conn.execute(
|
|
@@ -164,7 +170,7 @@ def get_config(key: str, default=None, filename=c.FILE_PATH):
|
|
|
164
170
|
return row[0]
|
|
165
171
|
|
|
166
172
|
|
|
167
|
-
def set_config(key: str, value, filename=
|
|
173
|
+
def set_config(key: str, value, filename=None) -> None:
|
|
168
174
|
initialise(filename)
|
|
169
175
|
serialized = json.dumps(value)
|
|
170
176
|
with _get_connection(filename) as conn:
|
|
@@ -178,7 +184,7 @@ def set_config(key: str, value, filename=c.FILE_PATH) -> None:
|
|
|
178
184
|
)
|
|
179
185
|
|
|
180
186
|
|
|
181
|
-
def delete_config(key: str, filename=
|
|
187
|
+
def delete_config(key: str, filename=None) -> bool:
|
|
182
188
|
initialise(filename)
|
|
183
189
|
with _get_connection(filename) as conn:
|
|
184
190
|
with conn:
|
|
@@ -186,7 +192,7 @@ def delete_config(key: str, filename=c.FILE_PATH) -> bool:
|
|
|
186
192
|
return cursor.rowcount > 0
|
|
187
193
|
|
|
188
194
|
|
|
189
|
-
def register_plugin(plugin_name: str, filename=
|
|
195
|
+
def register_plugin(plugin_name: str, filename=None) -> None:
|
|
190
196
|
initialise(filename)
|
|
191
197
|
now_utc = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
|
|
192
198
|
with _get_connection(filename) as conn:
|
|
@@ -200,7 +206,7 @@ def register_plugin(plugin_name: str, filename=c.FILE_PATH) -> None:
|
|
|
200
206
|
)
|
|
201
207
|
|
|
202
208
|
|
|
203
|
-
def get_plugin_data(plugin_name: str, key: str, default=None, filename=
|
|
209
|
+
def get_plugin_data(plugin_name: str, key: str, default=None, filename=None):
|
|
204
210
|
initialise(filename)
|
|
205
211
|
with _get_connection(filename) as conn:
|
|
206
212
|
row = conn.execute(
|
|
@@ -217,7 +223,7 @@ def get_plugin_data(plugin_name: str, key: str, default=None, filename=c.FILE_PA
|
|
|
217
223
|
return row[0]
|
|
218
224
|
|
|
219
225
|
|
|
220
|
-
def set_plugin_data(plugin_name: str, key: str, value, filename=
|
|
226
|
+
def set_plugin_data(plugin_name: str, key: str, value, filename=None) -> None:
|
|
221
227
|
initialise(filename)
|
|
222
228
|
register_plugin(plugin_name, filename=filename)
|
|
223
229
|
serialized = json.dumps(value)
|
|
@@ -232,7 +238,7 @@ def set_plugin_data(plugin_name: str, key: str, value, filename=c.FILE_PATH) ->
|
|
|
232
238
|
)
|
|
233
239
|
|
|
234
240
|
|
|
235
|
-
def get_all_plugin_data(plugin_name: str, filename=
|
|
241
|
+
def get_all_plugin_data(plugin_name: str, filename=None) -> dict:
|
|
236
242
|
initialise(filename)
|
|
237
243
|
with _get_connection(filename) as conn:
|
|
238
244
|
rows = conn.execute(
|
|
@@ -247,7 +253,7 @@ def get_all_plugin_data(plugin_name: str, filename=c.FILE_PATH) -> dict:
|
|
|
247
253
|
return result
|
|
248
254
|
|
|
249
255
|
|
|
250
|
-
def purge_plugin(plugin_name: str, filename=
|
|
256
|
+
def purge_plugin(plugin_name: str, filename=None) -> bool:
|
|
251
257
|
initialise(filename)
|
|
252
258
|
with _get_connection(filename) as conn:
|
|
253
259
|
with conn:
|
|
@@ -257,7 +263,7 @@ def purge_plugin(plugin_name: str, filename=c.FILE_PATH) -> bool:
|
|
|
257
263
|
return cursor.rowcount > 0
|
|
258
264
|
|
|
259
265
|
|
|
260
|
-
def purge_all_plugin_data(filename=
|
|
266
|
+
def purge_all_plugin_data(filename=None) -> bool:
|
|
261
267
|
initialise(filename)
|
|
262
268
|
with _get_connection(filename) as conn:
|
|
263
269
|
with conn:
|
|
@@ -266,7 +272,7 @@ def purge_all_plugin_data(filename=c.FILE_PATH) -> bool:
|
|
|
266
272
|
return True
|
|
267
273
|
|
|
268
274
|
|
|
269
|
-
def delete_plugin_data(plugin_name: str, key: str, filename=
|
|
275
|
+
def delete_plugin_data(plugin_name: str, key: str, filename=None) -> bool:
|
|
270
276
|
initialise(filename)
|
|
271
277
|
with _get_connection(filename) as conn:
|
|
272
278
|
with conn:
|
|
@@ -72,7 +72,7 @@ def main():
|
|
|
72
72
|
from flyshell.core import console
|
|
73
73
|
from flyshell.startup import loader
|
|
74
74
|
|
|
75
|
-
if c.HOST_OS in
|
|
75
|
+
if c.HOST_OS in c.SUPPORTED_OS:
|
|
76
76
|
if sys.version_info < c.SUPPORTED_PYTHON:
|
|
77
77
|
print(
|
|
78
78
|
"\nCRITICAL ERROR: Your Python version is too old to be supported by Flyshell."
|
|
@@ -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.
|
|
3
|
+
Version: 1.5.9
|
|
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
|

|
|
24
24
|

|
|
25
25
|
|
|
26
|
-
> Documentation last updated: v1.5.
|
|
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
|
-
│
|
|
85
|
+
│ ├── loader.py
|
|
86
|
+
│ └── seasonal.py
|
|
86
87
|
├── __init__.py
|
|
87
88
|
├── constants.py
|
|
88
89
|
└── main.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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|