flet-ads 0.0.1__py3-none-any.whl → 0.70.0.dev6644__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.
- flet_ads/__init__.py +16 -0
- flet_ads/banner_ad.py +31 -0
- flet_ads/base_ad.py +71 -0
- flet_ads/interstitial_ad.py +16 -0
- flet_ads/native_ad.py +33 -0
- flet_ads/types.py +129 -0
- flet_ads-0.70.0.dev6644.dist-info/METADATA +56 -0
- flet_ads-0.70.0.dev6644.dist-info/RECORD +21 -0
- {flet_ads-0.0.1.dist-info → flet_ads-0.70.0.dev6644.dist-info}/WHEEL +2 -1
- flet_ads-0.70.0.dev6644.dist-info/licenses/LICENSE +201 -0
- flet_ads-0.70.0.dev6644.dist-info/top_level.txt +2 -0
- flutter/flet_ads/analysis_options.yaml +4 -0
- flutter/flet_ads/lib/flet_ads.dart +3 -0
- flutter/flet_ads/lib/src/banner.dart +84 -0
- flutter/flet_ads/lib/src/extension.dart +39 -0
- flutter/flet_ads/lib/src/interstitial.dart +70 -0
- flutter/flet_ads/lib/src/native.dart +73 -0
- flutter/flet_ads/lib/utils/ads.dart +14 -0
- flutter/flet_ads/lib/utils/native.dart +51 -0
- flutter/flet_ads/pubspec.lock +822 -0
- flutter/flet_ads/pubspec.yaml +23 -0
- .DS_Store +0 -0
- flet_ads/.DS_Store +0 -0
- flet_ads-0.0.1.dist-info/.DS_Store +0 -0
- flet_ads-0.0.1.dist-info/METADATA +0 -14
- flet_ads-0.0.1.dist-info/RECORD +0 -7
flet_ads/__init__.py
CHANGED
|
@@ -1 +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
|
+
)
|
|
1
9
|
|
|
10
|
+
__all__ = [
|
|
11
|
+
"AdRequest",
|
|
12
|
+
"BannerAd",
|
|
13
|
+
"BaseAd",
|
|
14
|
+
"InterstitialAd",
|
|
15
|
+
"PaidAdEvent",
|
|
16
|
+
"PrecisionType",
|
|
17
|
+
]
|
flet_ads/banner_ad.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import flet as ft
|
|
4
|
+
from flet_ads.base_ad import BaseAd
|
|
5
|
+
from flet_ads.types import PaidAdEvent
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@ft.control("BannerAd")
|
|
9
|
+
class BannerAd(BaseAd):
|
|
10
|
+
"""
|
|
11
|
+
Displays a banner ad.
|
|
12
|
+
|
|
13
|
+
Raises:
|
|
14
|
+
FletUnsupportedPlatformException: When this control is used on a web
|
|
15
|
+
and/or non-mobile platform.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
on_will_dismiss: Optional[ft.ControlEventHandler["BannerAd"]] = None
|
|
19
|
+
"""
|
|
20
|
+
Called before dismissing a full screen view.
|
|
21
|
+
|
|
22
|
+
Note:
|
|
23
|
+
Only available on iOS.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
on_paid: Optional[ft.ControlEventHandler[PaidAdEvent["BannerAd"]]] = None
|
|
27
|
+
"""
|
|
28
|
+
Called when this ad is estimated to have earned money.
|
|
29
|
+
|
|
30
|
+
Available for allowlisted accounts only.
|
|
31
|
+
"""
|
flet_ads/base_ad.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from dataclasses import field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
import flet as ft
|
|
5
|
+
from flet_ads.types import AdRequest
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@ft.control
|
|
9
|
+
class BaseAd(ft.Control):
|
|
10
|
+
"""
|
|
11
|
+
Base class for all ad controls in Flet Ads package.
|
|
12
|
+
|
|
13
|
+
Raises:
|
|
14
|
+
FletUnsupportedPlatformException: When using this control on a web
|
|
15
|
+
and/or non-mobile platform.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
unit_id: str
|
|
19
|
+
"""
|
|
20
|
+
Ad unit ID for this ad.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
request: AdRequest = field(default_factory=lambda: AdRequest())
|
|
24
|
+
"""
|
|
25
|
+
Targeting information used to fetch an Ad.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
on_load: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
29
|
+
"""
|
|
30
|
+
Called when this ad is loaded successfully.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
on_error: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
34
|
+
"""
|
|
35
|
+
Called when an ad request failed.
|
|
36
|
+
|
|
37
|
+
Event handler argument [`data`][flet.Event.data] property
|
|
38
|
+
contains information about the error.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
on_open: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
42
|
+
"""
|
|
43
|
+
Called when this ad opens up.
|
|
44
|
+
|
|
45
|
+
A full screen view/overlay is presented in response to the user clicking
|
|
46
|
+
on an ad. You may want to pause animations and time sensitive
|
|
47
|
+
interactions.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
on_close: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
51
|
+
"""
|
|
52
|
+
Called when the full screen view has been closed. You should restart
|
|
53
|
+
anything paused while handling [`on_open`][flet_ads.BaseAd.on_open].
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
on_impression: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
57
|
+
"""
|
|
58
|
+
Called when an impression occurs on this ad.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
on_click: Optional[ft.ControlEventHandler["BaseAd"]] = None
|
|
62
|
+
"""
|
|
63
|
+
Called when this ad is clicked.
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
def before_update(self):
|
|
67
|
+
if self.page.web or not self.page.platform.is_mobile():
|
|
68
|
+
raise ft.FletUnsupportedPlatformException(
|
|
69
|
+
f"{self.__class__.__name__} is only supported on "
|
|
70
|
+
f"Mobile (Android and iOS)"
|
|
71
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import flet as ft
|
|
2
|
+
from flet_ads.base_ad import BaseAd
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@ft.control("InterstitialAd")
|
|
6
|
+
class InterstitialAd(BaseAd):
|
|
7
|
+
"""
|
|
8
|
+
Displays a full-screen interstitial ad.
|
|
9
|
+
|
|
10
|
+
Raises:
|
|
11
|
+
FletUnsupportedPlatformException: When using this control on a
|
|
12
|
+
web and/or non-mobile platform.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
async def show(self):
|
|
16
|
+
await self._invoke_method("show")
|
flet_ads/native_ad.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import flet as ft
|
|
2
|
+
from flet_ads.banner_ad import BannerAd
|
|
3
|
+
from flet_ads.types import NativeAdTemplateStyle
|
|
4
|
+
|
|
5
|
+
__all__ = ["NativeAd"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@ft.control("NativeAd")
|
|
9
|
+
class NativeAd(BannerAd):
|
|
10
|
+
"""
|
|
11
|
+
Renders a native ad.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
factory_id: str = None
|
|
15
|
+
"""
|
|
16
|
+
An identifier for the factory that creates the Platform view.
|
|
17
|
+
|
|
18
|
+
Raises:
|
|
19
|
+
ValueError: When neither `factory_id` nor [`template_style`][(c).] is set.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
template_style: NativeAdTemplateStyle = None
|
|
23
|
+
"""
|
|
24
|
+
A style for the native ad template.
|
|
25
|
+
|
|
26
|
+
Raises:
|
|
27
|
+
ValueError: When neither [`factory_id`][(c).] nor `template_style` is set.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def before_update(self):
|
|
31
|
+
super().before_update()
|
|
32
|
+
if self.factory_id is None and self.template_style is None:
|
|
33
|
+
raise ValueError("factory_id or template_style must be set")
|
flet_ads/types.py
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from enum import Enum
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
import flet as ft
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"AdRequest",
|
|
9
|
+
"NativeAdTemplateStyle",
|
|
10
|
+
"NativeAdTemplateTextStyle",
|
|
11
|
+
"NativeAdTemplateType",
|
|
12
|
+
"NativeTemplateFontStyle",
|
|
13
|
+
"PaidAdEvent",
|
|
14
|
+
"PrecisionType",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PrecisionType(Enum):
|
|
19
|
+
UNKNOWN = "unknown"
|
|
20
|
+
"""An ad value with unknown precision."""
|
|
21
|
+
|
|
22
|
+
ESTIMATED = "estimated"
|
|
23
|
+
"""An ad value estimated from aggregated data."""
|
|
24
|
+
|
|
25
|
+
PUBLISHER_PROVIDED = "publisherProvided"
|
|
26
|
+
"""A publisher-provided ad value, such as manual CPMs in a mediation group."""
|
|
27
|
+
|
|
28
|
+
PRECISE = "precise"
|
|
29
|
+
"""The precise value paid for this ad."""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass
|
|
33
|
+
class PaidAdEvent(ft.Event[ft.EventControlType]):
|
|
34
|
+
"""
|
|
35
|
+
Event data for paid ad events.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
value: float
|
|
39
|
+
"""
|
|
40
|
+
The monetary value of the ad.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
precision: PrecisionType
|
|
44
|
+
"""
|
|
45
|
+
The precision of the ad value.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
currency_code: str
|
|
49
|
+
"""
|
|
50
|
+
The currency code of the ad value.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass
|
|
55
|
+
class AdRequest:
|
|
56
|
+
"""
|
|
57
|
+
Targeting info per the AdMob API.
|
|
58
|
+
|
|
59
|
+
This class's properties mirror the native AdRequest API. See for example:
|
|
60
|
+
[AdRequest.Builder for Android](https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest.Builder).
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
keywords: Optional[list[str]] = None
|
|
64
|
+
"""
|
|
65
|
+
Words or phrases describing the current user activity.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
content_url: Optional[str] = None
|
|
69
|
+
"""
|
|
70
|
+
URL string for a webpage whose content matches the app’s primary content.
|
|
71
|
+
|
|
72
|
+
This webpage content is used for targeting and brand safety purposes.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
neighboring_content_urls: Optional[list[str]] = None
|
|
76
|
+
"""
|
|
77
|
+
URLs representing web content near an ad.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
non_personalized_ads: Optional[bool] = None
|
|
81
|
+
"""
|
|
82
|
+
Non-personalized ads are ads that are not based on a user’s past behavior.
|
|
83
|
+
|
|
84
|
+
For more information: https://support.google.com/admob/answer/7676680?hl=en
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
http_timeout: Optional[int] = None
|
|
88
|
+
"""
|
|
89
|
+
A custom timeout (in milliseconds) for HTTPS calls during an ad request.
|
|
90
|
+
|
|
91
|
+
Note:
|
|
92
|
+
This is only supported in Android. (ignored on iOS)
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
extras: Optional[dict[str, str]] = None
|
|
96
|
+
"""
|
|
97
|
+
Extras to pass to the AdMob adapter.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class NativeAdTemplateType(Enum):
|
|
102
|
+
SMALL = "small"
|
|
103
|
+
MEDIUM = "medium"
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class NativeTemplateFontStyle(Enum):
|
|
107
|
+
NORMAL = "normal"
|
|
108
|
+
BOLD = "bold"
|
|
109
|
+
ITALIC = "italic"
|
|
110
|
+
MONOSPACE = "monospace"
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@dataclass
|
|
114
|
+
class NativeAdTemplateTextStyle:
|
|
115
|
+
size: Optional[ft.Number] = None
|
|
116
|
+
text_color: Optional[ft.ColorValue] = None
|
|
117
|
+
bgcolor: Optional[ft.ColorValue] = None
|
|
118
|
+
style: Optional[NativeTemplateFontStyle] = None
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@dataclass
|
|
122
|
+
class NativeAdTemplateStyle:
|
|
123
|
+
template_type: NativeAdTemplateType = NativeAdTemplateType.MEDIUM
|
|
124
|
+
main_bgcolor: Optional[ft.ColorValue] = None
|
|
125
|
+
corner_radius: Optional[ft.Number] = None
|
|
126
|
+
call_to_action_text_style: Optional[NativeAdTemplateTextStyle] = None
|
|
127
|
+
primary_text_style: Optional[NativeAdTemplateTextStyle] = None
|
|
128
|
+
secondary_text_style: Optional[NativeAdTemplateTextStyle] = None
|
|
129
|
+
tertiary_text_style: Optional[NativeAdTemplateTextStyle] = None
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flet-ads
|
|
3
|
+
Version: 0.70.0.dev6644
|
|
4
|
+
Summary: Display Google Ads in Flet apps.
|
|
5
|
+
Author-email: Flet contributors <hello@flet.dev>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://flet.dev
|
|
8
|
+
Project-URL: Documentation, https://docs.flet.dev/ads
|
|
9
|
+
Project-URL: Repository, https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet-ads
|
|
10
|
+
Project-URL: Issues, https://github.com/flet-dev/flet/issues
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: flet==0.70.0.dev6644
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# flet-ads
|
|
18
|
+
|
|
19
|
+
[](https://pypi.python.org/pypi/flet-ads)
|
|
20
|
+
[](https://pepy.tech/project/flet-ads)
|
|
21
|
+
[](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-ads/LICENSE)
|
|
22
|
+
|
|
23
|
+
Display Google Ads in [Flet](https://flet.dev) apps.
|
|
24
|
+
|
|
25
|
+
It is based on the [google_mobile_ads](https://pub.dev/packages/google_mobile_ads) Flutter package.
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
Detailed documentation to this package can be found [here](https://docs.flet.dev/ads/).
|
|
30
|
+
|
|
31
|
+
## Platform Support
|
|
32
|
+
|
|
33
|
+
| Platform | Windows | macOS | Linux | iOS | Android | Web |
|
|
34
|
+
|----------|---------|-------|-------|-----|---------|-----|
|
|
35
|
+
| Supported| ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
### Installation
|
|
40
|
+
|
|
41
|
+
To install the `flet-ads` package and add it to your project dependencies:
|
|
42
|
+
|
|
43
|
+
- Using `uv`:
|
|
44
|
+
```bash
|
|
45
|
+
uv add flet-ads
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- Using `pip`:
|
|
49
|
+
```bash
|
|
50
|
+
pip install flet-ads
|
|
51
|
+
```
|
|
52
|
+
After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
|
|
53
|
+
|
|
54
|
+
### Examples
|
|
55
|
+
|
|
56
|
+
For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/ads).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
flet_ads/__init__.py,sha256=tm30fkWLlgwJXpjTg784n4xeh_Box2UfZ-B4ULugq_s,334
|
|
2
|
+
flet_ads/banner_ad.py,sha256=IlJ6-07pCgbZFqq-3GFSniurnBg21yEoQTNRmXtig0c,725
|
|
3
|
+
flet_ads/base_ad.py,sha256=8jZhIEmtJNPHnJygF8MxH42iBEMgZ95ufCE2lgUdUJA,1929
|
|
4
|
+
flet_ads/interstitial_ad.py,sha256=Ep2ba5cIgNAP0PCYqq6Uw-v6zCHgSgyfq3i9Q2ySPeI,373
|
|
5
|
+
flet_ads/native_ad.py,sha256=OsOnXXspzQZZNK5jMKwHbWqD0AgBpJVgrpOmWqmBAIw,835
|
|
6
|
+
flet_ads/types.py,sha256=MXAOSoYR5s8LtRYPv9zaD8L8jpReUT1tD7rhw5qDFg8,3212
|
|
7
|
+
flet_ads-0.70.0.dev6644.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
8
|
+
flutter/flet_ads/analysis_options.yaml,sha256=32kjGAc-zF87inWaH5M46yGZWQDTwrwfvNLHeAocfG4,154
|
|
9
|
+
flutter/flet_ads/pubspec.lock,sha256=f5TzY_rAJwNfQvrIA5HgAGuWamOowx0DpNGRIUUV-lc,24477
|
|
10
|
+
flutter/flet_ads/pubspec.yaml,sha256=qA5sskja1AMBw4W02P_irD7tADR6cjich-98bIz34Lw,376
|
|
11
|
+
flutter/flet_ads/lib/flet_ads.dart,sha256=O4dLFzsJpssVAzdKCMC14t3ihcO4K5rqhI1Qlx4Yllo,63
|
|
12
|
+
flutter/flet_ads/lib/src/banner.dart,sha256=HYRJYgMhSFH3Yps9sJNq2dG4kweJ8odPrepQR5Tu0WA,2674
|
|
13
|
+
flutter/flet_ads/lib/src/extension.dart,sha256=xKkuqEgp7RIKY2HYLq-Ys-agRme1rkAq5uTw-R4U998,965
|
|
14
|
+
flutter/flet_ads/lib/src/interstitial.dart,sha256=H1-DRdaOd-ZBy8F91iih-Wp6fm4tGf5QWGchVstnys0,2354
|
|
15
|
+
flutter/flet_ads/lib/src/native.dart,sha256=aV4XBl2xmOtesqbY-SLpsqGexp42aDk3w4RGRDK09Jg,2600
|
|
16
|
+
flutter/flet_ads/lib/utils/ads.dart,sha256=ysJUvop1pTlnfHUlNWL57S_7AxKiD3hRf0K7XJZHTpo,464
|
|
17
|
+
flutter/flet_ads/lib/utils/native.dart,sha256=iSIOUspBoUdtObDyrWOz-0Yuv4gs79ZyJYTe_-ZAFJQ,2013
|
|
18
|
+
flet_ads-0.70.0.dev6644.dist-info/METADATA,sha256=39OmiMr3Vp9W1xmEwbZ9PQE7IqgSzX7Mk443BpGE7nI,1861
|
|
19
|
+
flet_ads-0.70.0.dev6644.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
20
|
+
flet_ads-0.70.0.dev6644.dist-info/top_level.txt,sha256=Pguk7IG_usM8ZGyS1kjv-mZZhGKthm_734FmTIqDLBE,17
|
|
21
|
+
flet_ads-0.70.0.dev6644.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|