flet-desktop 0.85.3.dev0__tar.gz → 0.86.0.dev0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-desktop
3
- Version: 0.85.3.dev0
3
+ Version: 0.86.0.dev0
4
4
  Summary: Flet Desktop client in Flutter
5
5
  Author-email: "Appveyor Systems Inc." <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -9,7 +9,8 @@ Project-URL: Repository, https://github.com/flet-dev/flet
9
9
  Project-URL: Documentation, https://flet.dev/docs
10
10
  Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: flet==0.85.3.dev0
12
+ Requires-Dist: flet==0.86.0.dev0
13
+ Requires-Dist: rich>=13.0.0
13
14
 
14
15
  # Flet Desktop client in Flutter
15
16
 
@@ -1,13 +1,14 @@
1
1
  [project]
2
2
  name = "flet-desktop"
3
- version = "0.85.3.dev0"
3
+ version = "0.86.0.dev0"
4
4
  description = "Flet Desktop client in Flutter"
5
5
  authors = [{ name = "Appveyor Systems Inc.", email = "hello@flet.dev" }]
6
6
  license = "Apache-2.0"
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
- "flet==0.85.3.dev0"
10
+ "flet==0.86.0.dev0",
11
+ "rich >=13.0.0"
11
12
  ]
12
13
 
13
14
  [project.urls]
@@ -14,6 +14,8 @@ import urllib.request
14
14
  import zipfile
15
15
  from pathlib import Path
16
16
 
17
+ from rich.progress import Progress
18
+
17
19
  import flet_desktop
18
20
  import flet_desktop.version
19
21
  from flet.utils import (
@@ -174,6 +176,19 @@ def __get_client_storage_dir():
174
176
  )
175
177
 
176
178
 
179
+ def __download_with_progress(url, dest_path, description):
180
+ """Download a file to dest_path, showing a rich progress bar."""
181
+ with urllib.request.urlopen(url) as response, Progress(transient=True) as progress:
182
+ content_length = response.headers.get("Content-Length")
183
+ task = progress.add_task(
184
+ description, total=int(content_length) if content_length else None
185
+ )
186
+ with open(dest_path, "wb") as f:
187
+ while chunk := response.read(8192):
188
+ f.write(chunk)
189
+ progress.update(task, advance=len(chunk))
190
+
191
+
177
192
  def __download_flet_client(file_name):
178
193
  """
179
194
  Download a Flet client archive from GitHub Releases.
@@ -195,7 +210,7 @@ def __download_flet_client(file_name):
195
210
  logger.info(f"Downloading Flet v{ver} from {flet_url}")
196
211
  print(f"Preparing Flet v{ver} for the first use. This is a one-time operation...")
197
212
  temp_arch = Path(tempfile.gettempdir()).joinpath(f"{file_name}.{random_string(10)}")
198
- urllib.request.urlretrieve(flet_url, str(temp_arch))
213
+ __download_with_progress(flet_url, str(temp_arch), f"Downloading Flet v{ver}...")
199
214
  return str(temp_arch)
200
215
 
201
216
 
@@ -0,0 +1 @@
1
+ version = "0.86.0.dev0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-desktop
3
- Version: 0.85.3.dev0
3
+ Version: 0.86.0.dev0
4
4
  Summary: Flet Desktop client in Flutter
5
5
  Author-email: "Appveyor Systems Inc." <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -9,7 +9,8 @@ Project-URL: Repository, https://github.com/flet-dev/flet
9
9
  Project-URL: Documentation, https://flet.dev/docs
10
10
  Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
- Requires-Dist: flet==0.85.3.dev0
12
+ Requires-Dist: flet==0.86.0.dev0
13
+ Requires-Dist: rich>=13.0.0
13
14
 
14
15
  # Flet Desktop client in Flutter
15
16
 
@@ -0,0 +1,2 @@
1
+ flet==0.86.0.dev0
2
+ rich>=13.0.0
@@ -1 +0,0 @@
1
- version = "0.85.3.dev0"
@@ -1 +0,0 @@
1
- flet==0.85.3.dev0