mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-21 15:52:19 +00:00
Python: Make the re-exported classes show up property in the documentation
The variable assignment trick doesn't work for pdoc. Instead, fix the name properly and import them as re-export cleanly.
This commit is contained in:
parent
08fc503f68
commit
74f1674c57
6 changed files with 19 additions and 21 deletions
|
@ -3,11 +3,9 @@
|
|||
|
||||
import pytest
|
||||
from slint import slint as native
|
||||
from slint.slint import ValueType, PyImage
|
||||
from slint.slint import ValueType, Image, Color, Brush
|
||||
import os
|
||||
|
||||
Color = native.PyColor
|
||||
Brush = native.PyBrush
|
||||
|
||||
|
||||
def test_property_access():
|
||||
|
@ -94,9 +92,9 @@ def test_property_access():
|
|||
assert "cat.jpg" in imageval.path
|
||||
|
||||
with pytest.raises(RuntimeError, match="The image cannot be loaded"):
|
||||
PyImage.load_from_path("non-existent.png")
|
||||
Image.load_from_path("non-existent.png")
|
||||
|
||||
instance.set_property("imageprop", PyImage.load_from_path(os.path.join(
|
||||
instance.set_property("imageprop", Image.load_from_path(os.path.join(
|
||||
os.path.dirname(__file__), "../../../examples/iot-dashboard/images/humidity.png")))
|
||||
imageval = instance.get_property("imageprop")
|
||||
assert imageval.size == (36, 36)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue