Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit 9e2b641

Browse files
ndonkoHenriCopilot
andauthored
v1: Remove _async suffix from all methods, remove fire-n-forget counterparts, code improvements (#18)
* configs * remove fire-and-forget methods | remove _async in methods name * updates * Add JavaScriptMode enum and update WebView to support JavaScript execution modes * Update src/flet_webview/webview.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent fbb41fd commit 9e2b641

File tree

16 files changed

+151
-249
lines changed

16 files changed

+151
-249
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_webview
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

.github/workflows/docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
- dev
87
paths:
98
- 'LICENSE'
109
- 'CHANGELOG.md'

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ This package supports the following platforms:
2626
| Android ||
2727
| Web ||
2828

29-
## Installation
29+
## Usage
30+
31+
### Installation
3032

3133
To install the `flet-webview` package and add it to your project dependencies:
3234

@@ -46,6 +48,6 @@ To install the `flet-webview` package and add it to your project dependencies:
4648
poetry add flet-webview
4749
```
4850

49-
## Examples
51+
### Examples
5052

51-
For examples, see [this](./examples)
53+
For examples, see [these](./examples).

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

docs/index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ To install the `flet-webview` package and add it to your project dependencies:
4545
poetry add flet-webview
4646
```
4747

48+
### Examples
4849

49-
## Example
50-
51-
```python title="main.py"
52-
--8<-- "examples/webview_example/src/main.py"
53-
```
50+
See [these](webview.md#examples).

docs/webview.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
::: flet_webview.webview.WebView
1+
## Examples
2+
3+
### Example 1
4+
5+
```python title="example_1.py"
6+
--8<-- "examples/webview_example/src/example_1.py"
7+
```
8+
9+
::: flet_webview.webview.WebView

mkdocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ plugins:
113113
alias_type: symlink
114114
- glightbox
115115
- section-index
116+
- external-images:
117+
mappings:
118+
- source_dir: examples
119+
target_url_path: examples
120+
include_exts: [ ".png", ".gif", ".svg" ]
116121
- mkdocstrings:
117122
default_handler: python_xref
118123
handlers:
@@ -138,7 +143,6 @@ plugins:
138143
preload_modules: [ flet ]
139144
filters:
140145
- "!^_" # Exclude private members starting with only one underscore
141-
- "!get_event_field_type"
142146
extensions:
143147
- griffe_modernized_annotations
144148
- griffe_warnings_deprecated
@@ -189,3 +193,4 @@ markdown_extensions:
189193
- pymdownx.tasklist:
190194
custom_checkbox: true
191195
- pymdownx.tilde
196+
- pymdownx.blocks.caption

0 commit comments

Comments
 (0)