Skip to content

Commit 3249342

Browse files
committed
remove fire-and-forget methods | remove _async in methods name
1 parent d707056 commit 3249342

File tree

8 files changed

+41
-24
lines changed

8 files changed

+41
-24
lines changed

.ci/patch_pubspec_version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["pyyaml"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -17,7 +21,7 @@
1721
"flet",
1822
]
1923

20-
with open(pubspec_path, "r") as f:
24+
with open(pubspec_path) as f:
2125
data = yaml.safe_load(f)
2226

2327
# patch version

.ci/patch_toml_version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# /// script
2+
# dependencies = ["tomlkit"]
3+
# ///
4+
15
import os
26
import pathlib
37
import sys
@@ -14,7 +18,7 @@
1418
print(f"Patching TOML file {toml_path} to {ver}")
1519

1620
# read
17-
with open(toml_path, "r") as f:
21+
with open(toml_path) as f:
1822
t = tomlkit.parse(f.read())
1923

2024
# patch version

.docstr.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
paths: src/flet_datatable2
2+
badge: ./docs/assets/badges/docs-coverage.svg
3+
skip_file_doc: True
4+
skip_private: False
5+
ignore_patterns: # Dict with key/value pairs of file-pattern/node-pattern
6+
.*: __post_init__ # Ignore __post_init__ in all files
7+
fail_under: 50

appveyor.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@ image: ubuntu
33
version: '0.1.{build}'
44

55
environment:
6+
PYTHON_VERSION: 3.12
67
UV_PUBLISH_TOKEN:
78
secure: 174ncAbF5IjSIkmioPt62jeSnzmTlRNchUkE4QdjDWH8xK1olYtySXLJpo2q95HcP7lWJky1hv4APESiRRHnBWoY0XRFafzM/mbCDMzG1tZXiXZmpP1qzHAtRP2QSCIg18xh1TMktraUdTi7sbJnjjRhqzgbW1k0kLBxKw79MPFBhYQ/TiGcmaYWZbWVZNY3HCUCb6Dt7bG1OE2Ul9rD1gvs55xwO9Oq9FOVA1VnMYw=
89

9-
stack:
10-
- python 3.12
11-
1210
install:
1311
- source .ci/update_build_version.sh
14-
- python --version
15-
- python -m ensurepip --upgrade
16-
- pip3 install --upgrade tomlkit pyyaml
1712
- curl -LsSf https://astral.sh/uv/install.sh | sh
18-
- export PATH=$HOME/.local/bin:$PATH
13+
- export PATH="$HOME/.local/bin:$PATH"
14+
- uv python install $PYTHON_VERSION
15+
- uv python pin $PYTHON_VERSION
1916

2017
build_script:
21-
- python .ci/patch_toml_version.py pyproject.toml $PYPI_VER
22-
- python .ci/patch_pubspec_version.py src/flutter/flet_*/pubspec.yaml $PKG_VER
18+
- uv run .ci/patch_toml_version.py pyproject.toml $PYPI_VER
19+
- uv run .ci/patch_pubspec_version.py src/flutter/flet_*/pubspec.yaml $PKG_VER
2320
- (cd src/flutter/* && dart pub get && dart analyze && cd -)
2421
- uv build
2522

@@ -32,4 +29,4 @@ deploy_script:
3229
artifacts:
3330
- path: dist/*.whl
3431

35-
test: off
32+
test: off

examples/datatable2_example/src/example-2.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@ def main(page: ft.Page):
88
page.vertical_alignment = ft.MainAxisAlignment.CENTER
99
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
1010

11-
def select_row(e: ft.ControlEvent):
12-
print("on_select_row")
11+
def handle_row_selection_change(e: ft.Event[ftd.DataRow2]):
1312
e.control.selected = not e.control.selected
1413
e.control.update()
1514

1615
def sort_column(e: ft.DataColumnSortEvent):
1716
print(f"Sorting column {e.column_index}, ascending={e.ascending}")
1817

19-
def all_selected(e: ft.ControlEvent):
20-
print("All selected")
21-
2218
def get_data_columns():
2319
data_columns = [
2420
ftd.DataColumn2(
@@ -72,7 +68,7 @@ def get_data_rows(desserts):
7268
data_rows.append(
7369
ftd.DataRow2(
7470
specific_row_height=50,
75-
on_select_change=select_row,
71+
on_select_change=handle_row_selection_change,
7672
cells=[
7773
ft.DataCell(content=ft.Text(dessert.name)),
7874
ft.DataCell(content=ft.Text(dessert.calories)),
@@ -88,7 +84,7 @@ def get_data_rows(desserts):
8884
return data_rows
8985

9086
page.add(
91-
dt := ftd.DataTable2(
87+
ftd.DataTable2(
9288
show_checkbox_column=True,
9389
expand=True,
9490
column_spacing=0,
@@ -97,7 +93,7 @@ def get_data_rows(desserts):
9793
sort_ascending=True,
9894
bottom_margin=10,
9995
min_width=600,
100-
on_select_all=all_selected,
96+
on_select_all=lambda e: print("All selected"),
10197
columns=get_data_columns(),
10298
rows=get_data_rows(desserts),
10399
),

mkdocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ plugins:
110110
alias_type: symlink
111111
- glightbox
112112
- section-index
113+
- external-images:
114+
mappings:
115+
- source_dir: examples
116+
target_url_path: examples
117+
include_exts: [ ".png", ".gif", ".svg" ]
113118
- mkdocstrings:
114119
default_handler: python_xref
115120
handlers:
@@ -135,7 +140,6 @@ plugins:
135140
preload_modules: [ flet ]
136141
filters:
137142
- "!^_" # Exclude private members starting with only one underscore
138-
- "!get_event_field_type"
139143
extensions:
140144
- griffe_modernized_annotations
141145
- griffe_warnings_deprecated
@@ -186,3 +190,4 @@ markdown_extensions:
186190
- pymdownx.tasklist:
187191
custom_checkbox: true
188192
- pymdownx.tilde
193+
- pymdownx.blocks.caption

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,17 @@ docs = [
5252
"markdown-exec[ansi] >=1.11.0",
5353
"pydocstyle >=6.3.0",
5454
"linkcheckmd >=1.4.0",
55+
"mkdocs-external-images",
5556
{ include-group = 'docs-coverage' },
5657
]
5758
all = [
5859
{ include-group = 'dev' },
5960
{ include-group = 'docs' },
6061
]
6162

63+
[tool.uv.sources]
64+
mkdocs-external-images = { git = "https://github.com/flet-dev/mkdocs-external-images", tag = "v0.2.0" }
65+
6266
[build-system]
6367
requires = ["setuptools"]
6468
build-backend = "setuptools.build_meta"

src/flet_datatable2/datatable2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class DataTable2(ft.DataTable):
2020
2121
Note:
2222
`DataTable2` doesn't support
23-
[`flet.DataTable.data_row_min_height`][flet.DataTable.data_row_min_height]
24-
and [`flet.DataTable.data_row_max_height`][flet.DataTable.data_row_max_height]
25-
properties present in the parent [`flet.DataTable`][flet.DataTable].
23+
[`DataTable.data_row_min_height`][flet.DataTable.data_row_min_height]
24+
and [`DataTable.data_row_max_height`][flet.DataTable.data_row_max_height]
25+
properties present in the parent [`DataTable`][flet.DataTable].
2626
Use [`data_row_height`][(c).] instead.
2727
"""
2828

0 commit comments

Comments
 (0)