mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 05:44:52 +00:00
python: hide native module behind python front-end API
Encapsulate the rust code behind a public API (in __init__.py for now)
This commit is contained in:
parent
07c168bbf9
commit
d1529af3cc
7 changed files with 35 additions and 23 deletions
10
api/python/slint/__init__.py
Normal file
10
api/python/slint/__init__.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
|
||||
|
||||
from . import slint as native
|
||||
|
||||
def load_file(path):
|
||||
compiler = native.ComponentCompiler()
|
||||
compdef = compiler.build_from_path(path)
|
||||
instance = compdef.create()
|
||||
return instance
|
Loading…
Add table
Add a link
Reference in a new issue