android-widgets 0.1.7__tar.gz → 0.1.8__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.
- {android_widgets-0.1.7 → android_widgets-0.1.8}/PKG-INFO +1 -1
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/maker.py +4 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets.egg-info/PKG-INFO +1 -1
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets.egg-info/SOURCES.txt +2 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets.egg-info/top_level.txt +0 -1
- {android_widgets-0.1.7 → android_widgets-0.1.8}/pyproject.toml +1 -1
- android_widgets-0.1.8/tests/test_maker.py +51 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/README.md +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/__init__.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/__main__.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/aw_logging.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/config.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/facade.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/__init__.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/bindings.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/cli.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/drawables.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/generator.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/java.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/layout.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/manifest.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/nodes.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/provider.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/values.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/generate/xml.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/java_classes.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/runtime.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/templates/p4a_hook.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets/tools.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets.egg-info/dependency_links.txt +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets.egg-info/entry_points.txt +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets.egg-info/requires.txt +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/setup.cfg +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/sample.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/test_cli.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/test_generator.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/test_generators.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/test_java.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/test_manifest.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/test_naming.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/test_nodes.py +0 -0
- {android_widgets-0.1.7 → android_widgets-0.1.8}/tests/test_runtime.py +0 -0
|
@@ -12,6 +12,7 @@ class Receiver:
|
|
|
12
12
|
label: Optional[str] = None
|
|
13
13
|
meta_name: Optional[str] = "android.appwidget.provider"
|
|
14
14
|
meta_resource: Optional[str] = None
|
|
15
|
+
process: Optional[str] = None
|
|
15
16
|
|
|
16
17
|
def to_xml(self, package: str = None, spec_file_path: str = None) -> str:
|
|
17
18
|
if not package and spec_file_path:
|
|
@@ -26,6 +27,9 @@ class Receiver:
|
|
|
26
27
|
f'android:exported="{str(self.exported).lower()}"',
|
|
27
28
|
]
|
|
28
29
|
|
|
30
|
+
if self.process:
|
|
31
|
+
attrs.append(f'android:process="{self.process}"')
|
|
32
|
+
|
|
29
33
|
if self.label:
|
|
30
34
|
attrs.append(f'android:label="{self.label}"')
|
|
31
35
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
README.md
|
|
2
2
|
pyproject.toml
|
|
3
|
+
setup.cfg
|
|
3
4
|
android_widgets/__init__.py
|
|
4
5
|
android_widgets/__main__.py
|
|
5
6
|
android_widgets/aw_logging.py
|
|
@@ -33,6 +34,7 @@ tests/test_cli.py
|
|
|
33
34
|
tests/test_generator.py
|
|
34
35
|
tests/test_generators.py
|
|
35
36
|
tests/test_java.py
|
|
37
|
+
tests/test_maker.py
|
|
36
38
|
tests/test_manifest.py
|
|
37
39
|
tests/test_naming.py
|
|
38
40
|
tests/test_nodes.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "android-widgets"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.8"
|
|
8
8
|
description = "This would be used to auto gen XMLs for Android Home Screen widgets."
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
10
|
authors = [
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import tempfile
|
|
2
|
+
import unittest
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from android_widgets.maker import Receiver
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TestReceiverMaker(unittest.TestCase):
|
|
9
|
+
def test_default_has_no_process(self):
|
|
10
|
+
xml = Receiver(name="CarouselReceiver", actions=["ACTION_STOP"]).to_xml(
|
|
11
|
+
package="org.wally.waller"
|
|
12
|
+
)
|
|
13
|
+
self.assertIn('android:name="org.wally.waller.CarouselReceiver"', xml)
|
|
14
|
+
self.assertIn('android:enabled="true"', xml)
|
|
15
|
+
self.assertIn('android:exported="false"', xml)
|
|
16
|
+
self.assertIn('<action android:name="ACTION_STOP" />', xml)
|
|
17
|
+
self.assertNotIn("android:process", xml)
|
|
18
|
+
|
|
19
|
+
def test_process_is_emitted(self):
|
|
20
|
+
xml = Receiver(
|
|
21
|
+
name="CarouselReceiver",
|
|
22
|
+
actions=["ACTION_STOP", "ACTION_SKIP"],
|
|
23
|
+
process=":service_Wallpapercarousel",
|
|
24
|
+
).to_xml(package="org.wally.waller")
|
|
25
|
+
self.assertIn('android:process=":service_Wallpapercarousel"', xml)
|
|
26
|
+
self.assertIn('android:name="org.wally.waller.CarouselReceiver"', xml)
|
|
27
|
+
|
|
28
|
+
def test_process_ignored_when_empty(self):
|
|
29
|
+
xml = Receiver(name="CarouselReceiver", actions=["ACTION_STOP"], process="").to_xml(
|
|
30
|
+
package="org.wally.waller"
|
|
31
|
+
)
|
|
32
|
+
self.assertNotIn("android:process", xml)
|
|
33
|
+
|
|
34
|
+
def test_package_from_spec_file(self):
|
|
35
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
36
|
+
spec = Path(tmp) / "buildozer.spec"
|
|
37
|
+
spec.write_text(
|
|
38
|
+
"[app]\npackage.name = waller\npackage.domain = org.wally\n",
|
|
39
|
+
encoding="utf-8",
|
|
40
|
+
)
|
|
41
|
+
xml = Receiver(
|
|
42
|
+
name="CarouselReceiver",
|
|
43
|
+
actions=["ACTION_STOP"],
|
|
44
|
+
process=":service_Wallpapercarousel",
|
|
45
|
+
).to_xml(spec_file_path=str(spec))
|
|
46
|
+
self.assertIn('android:name="org.wally.waller.CarouselReceiver"', xml)
|
|
47
|
+
self.assertIn('android:process=":service_Wallpapercarousel"', xml)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
if __name__ == "__main__":
|
|
51
|
+
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{android_widgets-0.1.7 → android_widgets-0.1.8}/android_widgets.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|