flet-ads 0.2.0.dev38__tar.gz → 0.2.0.dev505__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.

Potentially problematic release.


This version of flet-ads might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-ads
3
- Version: 0.2.0.dev38
3
+ Version: 0.2.0.dev505
4
4
  Summary: Display Google Ads in Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -41,7 +41,9 @@ This package supports the following platforms:
41
41
  | Android | ✅ |
42
42
  | Web | ❌ |
43
43
 
44
- ## Installation
44
+ ## Usage
45
+
46
+ ### Installation
45
47
 
46
48
  To install the `flet-ads` package and add it to your project dependencies:
47
49
 
@@ -61,6 +63,6 @@ To install the `flet-ads` package and add it to your project dependencies:
61
63
  poetry add flet-ads
62
64
  ```
63
65
 
64
- ## Examples
66
+ ### Examples
65
67
 
66
- For examples, see [this](./examples)
68
+ For examples, see [these](./examples).
@@ -25,7 +25,9 @@ This package supports the following platforms:
25
25
  | Android | ✅ |
26
26
  | Web | ❌ |
27
27
 
28
- ## Installation
28
+ ## Usage
29
+
30
+ ### Installation
29
31
 
30
32
  To install the `flet-ads` package and add it to your project dependencies:
31
33
 
@@ -45,6 +47,6 @@ To install the `flet-ads` package and add it to your project dependencies:
45
47
  poetry add flet-ads
46
48
  ```
47
49
 
48
- ## Examples
50
+ ### Examples
49
51
 
50
- For examples, see [this](./examples)
52
+ For examples, see [these](./examples).
@@ -0,0 +1,94 @@
1
+ [project]
2
+ name = "flet-ads"
3
+ version = "0.2.0.dev505"
4
+ description = "Display Google Ads in Flet apps."
5
+ readme = "README.md"
6
+ authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
7
+ license = "Apache-2.0"
8
+ requires-python = ">=3.10"
9
+ dependencies = [
10
+ "flet >=0.70.0.dev0",
11
+ ]
12
+
13
+ [project.urls]
14
+ Homepage = "https://flet.dev"
15
+ Documentation = "https://flet-dev.github.io/flet-ads"
16
+ Repository = "https://github.com/flet-dev/flet-ads"
17
+ Issues = "https://github.com/flet-dev/flet-ads/issues"
18
+
19
+ [dependency-groups]
20
+ test = [
21
+ "pytest >=7.2.0",
22
+ ]
23
+ lint = [
24
+ "ruff >=0.11.7",
25
+ ]
26
+ dev = [
27
+ "pre-commit >=4.2.0",
28
+ { include-group = 'lint' },
29
+ { include-group = 'test' },
30
+ ]
31
+ docs-coverage = [
32
+ "docstr-coverage >=2.3.2",
33
+ ]
34
+ docs = [
35
+ "mkdocs >=1.6.1",
36
+ "mkdocs-material >=9.6.15",
37
+ "mkdocstrings-python >=1.16.12",
38
+ "mkdocstrings-python-xref >=1.16.3",
39
+ "mike >=2.1.3",
40
+ "markdown >=3.6",
41
+ "pymdown-extensions >=10.16",
42
+ "mkdocs-exclude >=1.0.2",
43
+ "mkdocs-glightbox >=0.4.0",
44
+ "mkdocs-open-in-new-tab >=1.0.8",
45
+ "mkdocs-section-index >=0.3.10",
46
+ "griffe-modernized-annotations >=1.0.8",
47
+ "griffe-warnings-deprecated >=1.1.0",
48
+ "pygments >=2.16",
49
+ "markdown-exec[ansi] >=1.11.0",
50
+ "pydocstyle >=6.3.0",
51
+ "linkcheckmd >=1.4.0",
52
+ "mkdocs-external-images",
53
+ { include-group = 'docs-coverage' },
54
+ ]
55
+ all = [
56
+ { include-group = 'dev' },
57
+ { include-group = 'docs' },
58
+ ]
59
+
60
+ [tool.uv.sources]
61
+ mkdocs-external-images = { git = "https://github.com/flet-dev/mkdocs-external-images", tag = "v0.2.0" }
62
+
63
+ [build-system]
64
+ requires = ["setuptools"]
65
+ build-backend = "setuptools.build_meta"
66
+
67
+ [tool.ruff]
68
+ line-length = 88
69
+ target-version = "py39"
70
+ fix = true
71
+ show-fixes = true
72
+
73
+ [tool.ruff.lint]
74
+ select = [
75
+ # pycodestyle
76
+ "E",
77
+ # Pyflakes
78
+ "F",
79
+ # pyupgrade
80
+ "UP",
81
+ # flake8-bugbear
82
+ "B",
83
+ # flake8-simplify
84
+ "SIM",
85
+ # isort
86
+ "I"
87
+ ]
88
+ preview = true
89
+ pydocstyle = { convention = 'google' }
90
+
91
+ [tool.ruff.format]
92
+ quote-style = "double"
93
+ indent-style = "space"
94
+ line-ending = "auto"
@@ -0,0 +1,17 @@
1
+ from flet_ads.banner_ad import BannerAd
2
+ from flet_ads.base_ad import BaseAd
3
+ from flet_ads.interstitial_ad import InterstitialAd
4
+ from flet_ads.types import (
5
+ AdRequest,
6
+ PaidAdEvent,
7
+ PrecisionType,
8
+ )
9
+
10
+ __all__ = [
11
+ "AdRequest",
12
+ "BannerAd",
13
+ "BaseAd",
14
+ "InterstitialAd",
15
+ "PaidAdEvent",
16
+ "PrecisionType",
17
+ ]
@@ -1,7 +1,9 @@
1
+ from typing import Optional
2
+
1
3
  import flet as ft
2
4
 
3
- from .base_ad import BaseAd
4
- from .types import PaidAdEvent
5
+ from flet_ads.base_ad import BaseAd
6
+ from flet_ads.types import PaidAdEvent
5
7
 
6
8
 
7
9
  @ft.control("BannerAd")
@@ -10,10 +12,10 @@ class BannerAd(BaseAd):
10
12
  Displays a banner ad.
11
13
 
12
14
  Raises:
13
- AssertionError: When using this control on a web and/or non-mobile platform.
15
+ AssertionError: When this control is used on a web and/or non-mobile platform.
14
16
  """
15
17
 
16
- on_will_dismiss: ft.OptionalControlEventHandler["BannerAd"] = None
18
+ on_will_dismiss: Optional[ft.ControlEventHandler["BannerAd"]] = None
17
19
  """
18
20
  Called before dismissing a full screen view.
19
21
 
@@ -21,7 +23,7 @@ class BannerAd(BaseAd):
21
23
  Only available on iOS.
22
24
  """
23
25
 
24
- on_paid: ft.OptionalControlEventHandler[PaidAdEvent["BannerAd"]] = None
26
+ on_paid: Optional[ft.ControlEventHandler[PaidAdEvent["BannerAd"]]] = None
25
27
  """
26
28
  Called when this ad is estimated to have earned money.
27
29
 
@@ -1,4 +1,5 @@
1
1
  from dataclasses import field
2
+ from typing import Optional
2
3
 
3
4
  import flet as ft
4
5
 
@@ -24,44 +25,45 @@ class BaseAd(ft.Control):
24
25
  Targeting information used to fetch an Ad.
25
26
  """
26
27
 
27
- on_load: ft.OptionalControlEventHandler["BaseAd"] = None
28
+ on_load: Optional[ft.ControlEventHandler["BaseAd"]] = None
28
29
  """
29
30
  Called when this ad is loaded successfully.
30
31
  """
31
32
 
32
- on_error: ft.OptionalControlEventHandler["BaseAd"] = None
33
+ on_error: Optional[ft.ControlEventHandler["BaseAd"]] = None
33
34
  """
34
35
  Called when an ad request failed.
35
-
36
- Event handler argument `data` property contains information about the error.
36
+
37
+ Event handler argument [`data`][flet.Event.data] property
38
+ contains information about the error.
37
39
  """
38
40
 
39
- on_open: ft.OptionalControlEventHandler["BaseAd"] = None
41
+ on_open: Optional[ft.ControlEventHandler["BaseAd"]] = None
40
42
  """
41
43
  Called when this ad opens up.
42
-
44
+
43
45
  A full screen view/overlay is presented in response to the user clicking
44
46
  on an ad. You may want to pause animations and time sensitive
45
47
  interactions.
46
48
  """
47
49
 
48
- on_close: ft.OptionalControlEventHandler["BaseAd"] = None
50
+ on_close: Optional[ft.ControlEventHandler["BaseAd"]] = None
49
51
  """
50
52
  Called when the full screen view has been closed. You should restart
51
- anything paused while handling [`on_open`][..].
53
+ anything paused while handling [`on_open`][flet_ads.BaseAd.on_open].
52
54
  """
53
55
 
54
- on_impression: ft.OptionalControlEventHandler["BaseAd"] = None
56
+ on_impression: Optional[ft.ControlEventHandler["BaseAd"]] = None
55
57
  """
56
58
  Called when an impression occurs on this ad.
57
59
  """
58
60
 
59
- on_click: ft.OptionalControlEventHandler["BaseAd"] = None
61
+ on_click: Optional[ft.ControlEventHandler["BaseAd"]] = None
60
62
  """
61
63
  Called when this ad is clicked.
62
64
  """
63
65
 
64
66
  def before_update(self):
65
- assert (
66
- not self.page.web and self.page.platform.is_mobile()
67
- ), f"{self.__class__.__name__} is only supported on Mobile (Android and iOS)"
67
+ assert not self.page.web and self.page.platform.is_mobile(), (
68
+ f"{self.__class__.__name__} is only supported on Mobile (Android and iOS)"
69
+ )
@@ -1,8 +1,6 @@
1
- import asyncio
2
-
3
1
  import flet as ft
4
2
 
5
- from .base_ad import BaseAd
3
+ from flet_ads.base_ad import BaseAd
6
4
 
7
5
 
8
6
  @ft.control("InterstitialAd")
@@ -14,8 +12,5 @@ class InterstitialAd(BaseAd):
14
12
  AssertionError: When using this control on a web and/or non-mobile platform.
15
13
  """
16
14
 
17
- def show(self):
18
- asyncio.create_task(self.show_async())
19
-
20
- async def show_async(self):
21
- await self._invoke_method_async("show")
15
+ async def show(self):
16
+ await self._invoke_method("show")
@@ -1,7 +1,7 @@
1
1
  import flet as ft
2
2
 
3
- from .banner_ad import BannerAd
4
- from .types import NativeAdTemplateStyle
3
+ from flet_ads.banner_ad import BannerAd
4
+ from flet_ads.types import NativeAdTemplateStyle
5
5
 
6
6
  __all__ = ["NativeAd"]
7
7
 
@@ -12,7 +12,8 @@ class NativeAd(BannerAd):
12
12
  Renders a native ad.
13
13
 
14
14
  Raises:
15
- AssertionError: When neither [`factory_id`][..] nor [`template_style`][..] is set.
15
+ AssertionError: When neither [`factory_id`][(c).] nor
16
+ [`template_style`][(c).] is set.
16
17
  """
17
18
 
18
19
  factory_id: str = None
@@ -27,6 +28,6 @@ class NativeAd(BannerAd):
27
28
 
28
29
  def before_update(self):
29
30
  super().before_update()
30
- assert (
31
- self.factory_id is not None or self.template_style is not None
32
- ), "factory_id or template_style must be set"
31
+ assert self.factory_id is not None or self.template_style is not None, (
32
+ "factory_id or template_style must be set"
33
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-ads
3
- Version: 0.2.0.dev38
3
+ Version: 0.2.0.dev505
4
4
  Summary: Display Google Ads in Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -41,7 +41,9 @@ This package supports the following platforms:
41
41
  | Android | ✅ |
42
42
  | Web | ❌ |
43
43
 
44
- ## Installation
44
+ ## Usage
45
+
46
+ ### Installation
45
47
 
46
48
  To install the `flet-ads` package and add it to your project dependencies:
47
49
 
@@ -61,6 +63,6 @@ To install the `flet-ads` package and add it to your project dependencies:
61
63
  poetry add flet-ads
62
64
  ```
63
65
 
64
- ## Examples
66
+ ### Examples
65
67
 
66
- For examples, see [this](./examples)
68
+ For examples, see [these](./examples).
@@ -1,68 +0,0 @@
1
- [project]
2
- name = "flet-ads"
3
- version = "0.2.0.dev38"
4
- description = "Display Google Ads in Flet apps."
5
- readme = "README.md"
6
- authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
7
- license = "Apache-2.0"
8
- requires-python = ">=3.10"
9
- dependencies = [
10
- "flet >=0.70.0.dev0",
11
- ]
12
-
13
- [project.urls]
14
- Homepage = "https://flet.dev"
15
- Documentation = "https://flet-dev.github.io/flet-ads"
16
- Repository = "https://github.com/flet-dev/flet-ads"
17
- Issues = "https://github.com/flet-dev/flet-ads/issues"
18
-
19
- [dependency-groups]
20
- dev = [
21
- "pre-commit>=4.2.0",
22
- "ruff>=0.11.7",
23
- ]
24
- docs = [
25
- "mkdocs",
26
- "mkdocs-material",
27
- "mkdocstrings[python]",
28
- "mkdocstrings-python-xref",
29
- "mike",
30
- "markdown>=3.6",
31
- "pymdown-extensions",
32
- "mkdocs-glightbox",
33
- "mkdocs-section-index",
34
- "griffe-modernized-annotations",
35
- "pygments>=2.16",
36
- ]
37
-
38
- [build-system]
39
- requires = ["setuptools"]
40
- build-backend = "setuptools.build_meta"
41
-
42
- [tool.ruff]
43
- line-length = 88
44
- target-version = "py39"
45
- fix = true
46
- show-fixes = true
47
-
48
- [tool.ruff.lint]
49
- select = [
50
- # pycodestyle
51
- "E",
52
- # Pyflakes
53
- "F",
54
- # pyupgrade
55
- "UP",
56
- # flake8-bugbear
57
- "B",
58
- # flake8-simplify
59
- "SIM",
60
- # isort
61
- "I"
62
- ]
63
- preview = true
64
-
65
- [tool.ruff.format]
66
- quote-style = "double"
67
- indent-style = "space"
68
- line-ending = "auto"
@@ -1,10 +0,0 @@
1
- from .banner_ad import BannerAd
2
- from .base_ad import BaseAd
3
- from .interstitial_ad import InterstitialAd
4
- from .types import ( # NativeAdTemplateStyle,; NativeAdTemplateTextStyle,; NativeAdTemplateType,; NativeTemplateFontStyle,
5
- AdRequest,
6
- PaidAdEvent,
7
- PrecisionType,
8
- )
9
-
10
- # from .native_ad import NativeAd
File without changes