flet-ads 0.2.0.dev38__py3-none-any.whl → 0.2.0.dev48__py3-none-any.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.

Potentially problematic release.


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

flet_ads/__init__.py CHANGED
@@ -1,10 +1,17 @@
1
1
  from .banner_ad import BannerAd
2
2
  from .base_ad import BaseAd
3
3
  from .interstitial_ad import InterstitialAd
4
- from .types import ( # NativeAdTemplateStyle,; NativeAdTemplateTextStyle,; NativeAdTemplateType,; NativeTemplateFontStyle,
4
+ from .types import (
5
5
  AdRequest,
6
6
  PaidAdEvent,
7
7
  PrecisionType,
8
8
  )
9
9
 
10
- # from .native_ad import NativeAd
10
+ __all__ = [
11
+ "AdRequest",
12
+ "BannerAd",
13
+ "BaseAd",
14
+ "InterstitialAd",
15
+ "PaidAdEvent",
16
+ "PrecisionType",
17
+ ]
flet_ads/banner_ad.py CHANGED
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  import flet as ft
2
4
 
3
5
  from .base_ad import BaseAd
@@ -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
 
flet_ads/base_ad.py CHANGED
@@ -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
+ )
flet_ads/native_ad.py CHANGED
@@ -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.dev48
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
@@ -0,0 +1,11 @@
1
+ flet_ads/__init__.py,sha256=FzQJce1OGDOeKGznqUggWIu2U9mfnL3F-ntUPAes5CE,302
2
+ flet_ads/banner_ad.py,sha256=o6w-g6h3UzdhAOoQrdUlwLT_TmsGINtjuTHHt-9UQkI,680
3
+ flet_ads/base_ad.py,sha256=Ln6OYjq1UVHVi05gsLILovGw5X-G9gPkAN83gdo7r4Y,1824
4
+ flet_ads/interstitial_ad.py,sha256=KXGcf0bXIDDw4gPeo4O0vR3LK9wgRSa6gAzxPl40qNg,432
5
+ flet_ads/native_ad.py,sha256=NCyjEpYOk4Ssnlusj0sE5bs4HP1BfsdaD0GgRvaoxEs,753
6
+ flet_ads/types.py,sha256=q1Hpmu_w6afkG6ovLUgToWSRVb1Euf-OVlf52si00VM,3212
7
+ flet_ads-0.2.0.dev48.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
+ flet_ads-0.2.0.dev48.dist-info/METADATA,sha256=UIpshPn_R7G0S9Xa-HbVbcxv2sVEjMJbWEYjh2305dQ,1870
9
+ flet_ads-0.2.0.dev48.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ flet_ads-0.2.0.dev48.dist-info/top_level.txt,sha256=gv6ICx8xIfzUQalF99v9x0gh0g0R8EPksQFAknB3baM,9
11
+ flet_ads-0.2.0.dev48.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- flet_ads/__init__.py,sha256=IJRqRlozCGkISTdcXX7xn7-jzUtp1yMp6y2msgpPR6g,316
2
- flet_ads/banner_ad.py,sha256=esnqiKAmeaLEpBSJfO1_z847FyKvTrtk3YypjRh8d0U,645
3
- flet_ads/base_ad.py,sha256=lYuEWwYVVd1qTmVFt02igcAS-g6tOcFzwbO4Li18mY0,1748
4
- flet_ads/interstitial_ad.py,sha256=KXGcf0bXIDDw4gPeo4O0vR3LK9wgRSa6gAzxPl40qNg,432
5
- flet_ads/native_ad.py,sha256=-4xOvEjaIWCWSQbgPX1JBpqOTBARN-cwaPPTPuQxCrQ,737
6
- flet_ads/types.py,sha256=q1Hpmu_w6afkG6ovLUgToWSRVb1Euf-OVlf52si00VM,3212
7
- flet_ads-0.2.0.dev38.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
- flet_ads-0.2.0.dev38.dist-info/METADATA,sha256=SYla7hgDCSQe5bU0aebE2cCxLHxbY_f6jkrPW2FfY2U,1870
9
- flet_ads-0.2.0.dev38.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- flet_ads-0.2.0.dev38.dist-info/top_level.txt,sha256=gv6ICx8xIfzUQalF99v9x0gh0g0R8EPksQFAknB3baM,9
11
- flet_ads-0.2.0.dev38.dist-info/RECORD,,