flet-desktop-light 0.25.1__py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl → 0.26.0__py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
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.
- flet_desktop/__init__.py +122 -83
- flet_desktop/app/flet-linux-arm64.tar.gz +0 -0
- flet_desktop/version.py +1 -1
- {flet_desktop_light-0.25.1.dist-info → flet_desktop_light-0.26.0.dist-info}/METADATA +7 -8
- flet_desktop_light-0.26.0.dist-info/RECORD +6 -0
- {flet_desktop_light-0.25.1.dist-info → flet_desktop_light-0.26.0.dist-info}/WHEEL +1 -1
- flet_desktop_light-0.25.1.dist-info/RECORD +0 -6
flet_desktop/__init__.py
CHANGED
@@ -2,6 +2,7 @@ import asyncio
|
|
2
2
|
import logging
|
3
3
|
import os
|
4
4
|
import signal
|
5
|
+
import stat
|
5
6
|
import subprocess
|
6
7
|
import tarfile
|
7
8
|
import tempfile
|
@@ -9,6 +10,8 @@ import urllib.request
|
|
9
10
|
import zipfile
|
10
11
|
from pathlib import Path
|
11
12
|
|
13
|
+
import flet_desktop
|
14
|
+
import flet_desktop.version
|
12
15
|
from flet.utils import (
|
13
16
|
get_arch,
|
14
17
|
is_linux,
|
@@ -18,9 +21,6 @@ from flet.utils import (
|
|
18
21
|
safe_tar_extractall,
|
19
22
|
)
|
20
23
|
|
21
|
-
import flet_desktop
|
22
|
-
import flet_desktop.version
|
23
|
-
|
24
24
|
logger = logging.getLogger(flet_desktop.__name__)
|
25
25
|
|
26
26
|
|
@@ -67,95 +67,129 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
|
|
67
67
|
pid_file = str(Path(tempfile.gettempdir()).joinpath(random_string(20)))
|
68
68
|
|
69
69
|
if is_windows():
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
)
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
70
|
+
flet_path = None
|
71
|
+
# try loading Flet client built with the latest run of `flet build`
|
72
|
+
build_windows = os.path.join(os.getcwd(), "build", "windows")
|
73
|
+
if os.path.exists(build_windows):
|
74
|
+
for f in os.listdir(build_windows):
|
75
|
+
if f.endswith(".exe"):
|
76
|
+
flet_path = os.path.join(build_windows, f)
|
77
|
+
|
78
|
+
if not flet_path:
|
79
|
+
flet_exe = "flet.exe"
|
80
|
+
temp_flet_dir = Path.home().joinpath(
|
81
|
+
".flet", "bin", f"flet-{flet_desktop.version.version}"
|
82
|
+
)
|
83
|
+
|
84
|
+
# check if flet_view.exe exists in "bin" directory (user mode)
|
85
|
+
flet_path = os.path.join(get_package_bin_dir(), "flet", flet_exe)
|
86
|
+
logger.info(f"Looking for Flet executable at: {flet_path}")
|
87
|
+
if os.path.exists(flet_path):
|
88
|
+
logger.info(f"Flet View found in: {flet_path}")
|
89
|
+
else:
|
90
|
+
# check if flet.exe is in FLET_VIEW_PATH (flet developer mode)
|
91
|
+
flet_path = os.environ.get("FLET_VIEW_PATH")
|
92
|
+
if flet_path and os.path.exists(flet_path):
|
93
|
+
logger.info(f"Flet View found in PATH: {flet_path}")
|
94
|
+
flet_path = os.path.join(flet_path, flet_exe)
|
95
|
+
else:
|
96
|
+
if not temp_flet_dir.exists():
|
97
|
+
zip_file = __download_flet_client("flet-windows.zip")
|
98
|
+
|
99
|
+
logger.info(
|
100
|
+
f"Extracting flet.exe from archive to {temp_flet_dir}"
|
101
|
+
)
|
102
|
+
temp_flet_dir.mkdir(parents=True, exist_ok=True)
|
103
|
+
with zipfile.ZipFile(zip_file, "r") as zip_arch:
|
104
|
+
zip_arch.extractall(str(temp_flet_dir))
|
105
|
+
flet_path = str(temp_flet_dir.joinpath("flet", flet_exe))
|
106
|
+
args = [flet_path, page_url, pid_file]
|
107
|
+
elif is_macos():
|
108
|
+
app_path = None
|
109
|
+
# try loading Flet client built with the latest run of `flet build`
|
110
|
+
build_macos = os.path.join(os.getcwd(), "build", "macos")
|
111
|
+
if os.path.exists(build_macos):
|
112
|
+
for f in os.listdir(build_macos):
|
113
|
+
if f.endswith(".app"):
|
114
|
+
app_path = os.path.join(build_macos, f)
|
115
|
+
|
116
|
+
if not app_path:
|
117
|
+
# build version-specific path to Flet.app
|
118
|
+
temp_flet_dir = Path.home().joinpath(
|
119
|
+
".flet", "bin", f"flet-{flet_desktop.version.version}"
|
120
|
+
)
|
121
|
+
|
80
122
|
# check if flet.exe is in FLET_VIEW_PATH (flet developer mode)
|
81
123
|
flet_path = os.environ.get("FLET_VIEW_PATH")
|
82
|
-
if flet_path
|
83
|
-
logger.info(f"Flet
|
84
|
-
|
124
|
+
if flet_path:
|
125
|
+
logger.info(f"Flet.app is set via FLET_VIEW_PATH: {flet_path}")
|
126
|
+
temp_flet_dir = Path(flet_path)
|
85
127
|
else:
|
128
|
+
# check if flet_view.app exists in a temp directory
|
86
129
|
if not temp_flet_dir.exists():
|
87
|
-
|
88
|
-
|
89
|
-
|
130
|
+
# check if flet.tar.gz exists
|
131
|
+
gz_filename = "flet-macos.tar.gz"
|
132
|
+
tar_file = os.path.join(get_package_bin_dir(), gz_filename)
|
133
|
+
logger.info(f"Looking for Flet.app archive at: {tar_file}")
|
134
|
+
if not os.path.exists(tar_file):
|
135
|
+
tar_file = __download_flet_client(gz_filename)
|
136
|
+
|
137
|
+
logger.info(f"Extracting Flet.app from archive to {temp_flet_dir}")
|
90
138
|
temp_flet_dir.mkdir(parents=True, exist_ok=True)
|
91
|
-
with
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
logger.info(f"Flet.app is set via FLET_VIEW_PATH: {flet_path}")
|
105
|
-
temp_flet_dir = Path(flet_path)
|
106
|
-
else:
|
107
|
-
# check if flet_view.app exists in a temp directory
|
108
|
-
if not temp_flet_dir.exists():
|
109
|
-
# check if flet.tar.gz exists
|
110
|
-
gz_filename = "flet-macos.tar.gz"
|
111
|
-
tar_file = os.path.join(get_package_bin_dir(), gz_filename)
|
112
|
-
if not os.path.exists(tar_file):
|
113
|
-
tar_file = __download_flet_client(gz_filename)
|
114
|
-
|
115
|
-
logger.info(f"Extracting Flet.app from archive to {temp_flet_dir}")
|
116
|
-
temp_flet_dir.mkdir(parents=True, exist_ok=True)
|
117
|
-
with tarfile.open(str(tar_file), "r:gz") as tar_arch:
|
118
|
-
safe_tar_extractall(tar_arch, str(temp_flet_dir))
|
119
|
-
else:
|
120
|
-
logger.info(f"Flet View found in: {temp_flet_dir}")
|
121
|
-
|
122
|
-
app_name = None
|
123
|
-
for f in os.listdir(temp_flet_dir):
|
124
|
-
if f.endswith(".app"):
|
125
|
-
app_name = f
|
126
|
-
assert app_name is not None, f"Application bundle not found in {temp_flet_dir}"
|
127
|
-
app_path = temp_flet_dir.joinpath(app_name)
|
139
|
+
with tarfile.open(str(tar_file), "r:gz") as tar_arch:
|
140
|
+
safe_tar_extractall(tar_arch, str(temp_flet_dir))
|
141
|
+
else:
|
142
|
+
logger.info(f"Flet View found in: {temp_flet_dir}")
|
143
|
+
|
144
|
+
app_name = None
|
145
|
+
for f in os.listdir(temp_flet_dir):
|
146
|
+
if f.endswith(".app"):
|
147
|
+
app_name = f
|
148
|
+
assert (
|
149
|
+
app_name is not None
|
150
|
+
), f"Application bundle not found in {temp_flet_dir}"
|
151
|
+
app_path = temp_flet_dir.joinpath(app_name)
|
128
152
|
args = ["open", str(app_path), "-n", "-W", "--args", page_url, pid_file]
|
129
153
|
elif is_linux():
|
130
|
-
# build version-specific path to flet folder
|
131
|
-
temp_flet_dir = Path.home().joinpath(
|
132
|
-
".flet", "bin", f"flet-{flet_desktop.version.version}"
|
133
|
-
)
|
134
|
-
|
135
154
|
app_path = None
|
136
|
-
#
|
137
|
-
|
138
|
-
if
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
+
# try loading Flet client built with the latest run of `flet build`
|
156
|
+
build_linux = os.path.join(os.getcwd(), "build", "linux")
|
157
|
+
if os.path.exists(build_linux):
|
158
|
+
for f in os.listdir(build_linux):
|
159
|
+
ef = os.path.join(build_linux, f)
|
160
|
+
if os.path.isfile(ef) and stat.S_IXUSR & os.stat(ef)[stat.ST_MODE]:
|
161
|
+
app_path = ef
|
162
|
+
|
163
|
+
if not app_path:
|
164
|
+
# build version-specific path to flet folder
|
165
|
+
temp_flet_dir = Path.home().joinpath(
|
166
|
+
".flet", "bin", f"flet-{flet_desktop.version.version}"
|
167
|
+
)
|
168
|
+
|
169
|
+
# check if flet.exe is in FLET_VIEW_PATH (flet developer mode)
|
170
|
+
flet_path = os.environ.get("FLET_VIEW_PATH")
|
171
|
+
if flet_path:
|
172
|
+
logger.info(f"Flet View is set via FLET_VIEW_PATH: {flet_path}")
|
173
|
+
temp_flet_dir = Path(flet_path)
|
174
|
+
app_path = temp_flet_dir.joinpath("flet")
|
155
175
|
else:
|
156
|
-
|
176
|
+
# check if flet_view.app exists in a temp directory
|
177
|
+
if not temp_flet_dir.exists():
|
178
|
+
# check if flet.tar.gz exists
|
179
|
+
gz_filename = f"flet-linux-{get_arch()}.tar.gz"
|
180
|
+
tar_file = os.path.join(get_package_bin_dir(), gz_filename)
|
181
|
+
logger.info(f"Looking for Flet bundle archive at: {tar_file}")
|
182
|
+
if not os.path.exists(tar_file):
|
183
|
+
tar_file = __download_flet_client(gz_filename)
|
184
|
+
|
185
|
+
logger.info(f"Extracting Flet from archive to {temp_flet_dir}")
|
186
|
+
temp_flet_dir.mkdir(parents=True, exist_ok=True)
|
187
|
+
with tarfile.open(str(tar_file), "r:gz") as tar_arch:
|
188
|
+
safe_tar_extractall(tar_arch, str(temp_flet_dir))
|
189
|
+
else:
|
190
|
+
logger.info(f"Flet View found in: {temp_flet_dir}")
|
157
191
|
|
158
|
-
|
192
|
+
app_path = temp_flet_dir.joinpath("flet", "flet")
|
159
193
|
args = [str(app_path), page_url, pid_file]
|
160
194
|
|
161
195
|
flet_env = {**os.environ}
|
@@ -171,8 +205,13 @@ def __locate_and_unpack_flet_view(page_url, assets_dir, hidden):
|
|
171
205
|
|
172
206
|
def __download_flet_client(file_name):
|
173
207
|
ver = flet_desktop.version.version
|
208
|
+
if not ver:
|
209
|
+
import flet.version
|
210
|
+
from flet.version import update_version
|
211
|
+
|
212
|
+
ver = flet.version.version or update_version()
|
174
213
|
temp_arch = Path(tempfile.gettempdir()).joinpath(file_name)
|
175
|
-
logger.info(f"Downloading Flet v{ver} to {temp_arch}")
|
176
214
|
flet_url = f"https://github.com/flet-dev/flet/releases/download/v{ver}/{file_name}"
|
215
|
+
logger.info(f"Downloading Flet v{ver} from {flet_url} to {temp_arch}")
|
177
216
|
urllib.request.urlretrieve(flet_url, temp_arch)
|
178
217
|
return str(temp_arch)
|
Binary file
|
flet_desktop/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
version = "0.
|
1
|
+
version = "0.26.0"
|
@@ -1,23 +1,22 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.3
|
2
2
|
Name: flet-desktop-light
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.26.0
|
4
4
|
Summary: Flet Desktop client in Flutter
|
5
5
|
License: Apache-2.0
|
6
6
|
Author: Appveyor Systems Inc.
|
7
7
|
Author-email: hello@flet.dev
|
8
|
-
Requires-Python: >=3.
|
8
|
+
Requires-Python: >=3.9
|
9
9
|
Classifier: License :: OSI Approved :: Apache Software License
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
16
15
|
Classifier: Programming Language :: Python :: 3.13
|
17
|
-
Requires-Dist: flet (==0.
|
18
|
-
Project-URL:
|
19
|
-
Project-URL:
|
20
|
-
Project-URL:
|
16
|
+
Requires-Dist: flet (==0.26.0)
|
17
|
+
Project-URL: Documentation, https://flet.dev/docs
|
18
|
+
Project-URL: Homepage, https://flet.dev
|
19
|
+
Project-URL: Repository, https://github.com/flet-dev/flet
|
21
20
|
Description-Content-Type: text/markdown
|
22
21
|
|
23
22
|
# Flet Desktop client in Flutter
|
@@ -0,0 +1,6 @@
|
|
1
|
+
flet_desktop/__init__.py,sha256=GU-Yzy2hPK_b7ZGzZYpHLh75C1tU-zqDAIXeNI2wdxE,8527
|
2
|
+
flet_desktop/version.py,sha256=UnfM5XWCBfCj8s_jXZBuXu8MGePC4lTKjbMTTKrtOTE,19
|
3
|
+
flet_desktop/app/flet-linux-arm64.tar.gz,sha256=3ZhC94hbvuZGmeXolIAuPcCpUBXFwVs39ptIwgiHpSw,14799888
|
4
|
+
flet_desktop_light-0.26.0.dist-info/METADATA,sha256=oKcYO5iEZGdFxRGxCZ1bFobGSz7dOoGH1H_AM8PHreI,886
|
5
|
+
flet_desktop_light-0.26.0.dist-info/WHEEL,sha256=KH1WTkRRon2AuM86--Lc9bLpQoRMyX1K_58agfppVkg,143
|
6
|
+
flet_desktop_light-0.26.0.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
flet_desktop/__init__.py,sha256=CtqPLA0DvZuFidnu_UEE_-F197SviQtjekV7fS82LOw,6538
|
2
|
-
flet_desktop/version.py,sha256=joCehuyy75nZ4ojk4u9VohsUvt5-trIsBZcSsypQgqQ,19
|
3
|
-
flet_desktop/app/flet-linux-arm64.tar.gz,sha256=aBcj1OzfOV9-sDxN-Ekqrll1dKo6LNvXY8gIPlHvm8E,14755453
|
4
|
-
flet_desktop_light-0.25.1.dist-info/METADATA,sha256=i4jXrtcWi8bdr38M1bOfh-dv0uaDE6kXt6RjGDNR6Bs,941
|
5
|
-
flet_desktop_light-0.25.1.dist-info/WHEEL,sha256=IYMc7Nq_NQdSWIq7A_P3GQ5gs5MXvRmJZFtEM9bxp5I,143
|
6
|
-
flet_desktop_light-0.25.1.dist-info/RECORD,,
|