mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Python: Add support for snake case imports (#6229)
When using slint.loader.app_window.XXX look for "app_window.slint" followed by "app-window.slint". Fixes #6216
This commit is contained in:
parent
34fe6b1537
commit
844590cac8
5 changed files with 13 additions and 5 deletions
|
@ -8,7 +8,7 @@ import os
|
|||
|
||||
def test_callback_decorators(caplog):
|
||||
module = load_file(os.path.join(os.path.dirname(
|
||||
__spec__.origin), "test_load_file.slint"), quiet=False)
|
||||
__spec__.origin), "test-load-file.slint"), quiet=False)
|
||||
|
||||
class SubClass(module.App):
|
||||
@slint.callback()
|
||||
|
|
|
@ -8,7 +8,7 @@ import os
|
|||
|
||||
def test_load_file(caplog):
|
||||
module = load_file(os.path.join(os.path.dirname(
|
||||
__spec__.origin), "test_load_file.slint"), quiet=False)
|
||||
__spec__.origin), "test-load-file.slint"), quiet=False)
|
||||
|
||||
assert "The property 'color' has been deprecated. Please use 'background' instead" in caplog.text
|
||||
|
||||
|
@ -42,7 +42,7 @@ def test_load_file_fail():
|
|||
|
||||
def test_load_file_wrapper():
|
||||
module = load_file(os.path.join(os.path.dirname(
|
||||
__spec__.origin), "test_load_file.slint"), quiet=False)
|
||||
__spec__.origin), "test-load-file.slint"), quiet=False)
|
||||
|
||||
instance = module.App()
|
||||
|
||||
|
@ -66,7 +66,7 @@ def test_load_file_wrapper():
|
|||
|
||||
def test_constructor_kwargs():
|
||||
module = load_file(os.path.join(os.path.dirname(
|
||||
__spec__.origin), "test_load_file.slint"), quiet=False)
|
||||
__spec__.origin), "test-load-file.slint"), quiet=False)
|
||||
|
||||
def early_say_hello(arg):
|
||||
return "early:" + arg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue