Skip to content

Debug model error #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
childishtree opened this issue Mar 22, 2025 · 0 comments
Open

Debug model error #4

childishtree opened this issue Mar 22, 2025 · 0 comments

Comments

@childishtree
Copy link

main.py:
from qmlease import app
app.run('view.qml', debug=True)
view.qml:
import QtQuick

Window {
title: 'A simple application'
visible: true
width: 400
height: 300

Text {
    anchors.centerIn: parent
    text: 'Hello World'
}

}

===

PS F:\Code\Python\test> & f:/Code/Python/test/.conda/python.exe f:/Code/Python/test/main.py
./.conda/Lib/site-packages/qmlease/_env.py:24 > [ INFO] auto detected qt api: pyside6 (6.7.2)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qtcore\signal_slot.py:67 in func_wrapper │
│ │
│ 64 │ │ │ │ *args: T.ParamSpec.args, │
│ 65 │ │ │ │ **kwargs: T.ParamSpec.kwargs │
│ 66 │ │ ) -> T.Func: │
│ ❱ 67 │ │ │ from .qobject import QObjectBaseWrapper │
│ 68 │ │ │ new_args = [] │
│ 69 │ │ │ new_kwargs = {} │
│ 70 │
│ in parent:409 │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qmlside\console.py:100 in _handle_message │
│ │
│ 97 │ │ │ │ │ msg = msg[len(m.group()):] │
│ 98 │ │ │ │ │
│ 99 │ │ │ │ file_path = self._normalize_path(ctx.file) │
│ ❱ 100 │ │ │ │ file_path = self._reformat_path(file_path) │
│ 101 │ │ │ │ if IGNORE_UNPLEASENT_WARNINGS: │
│ 102 │ │ │ │ │ if not IS_WINDOWS: │
│ 103 │ │ │ │ │ │ if ( │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qmlside\console.py:200 in _reformat_path │
│ │
│ 197 │ │ # path, style='pretty_relpath' │
│ 198 │ │ # ), ':lv' │
│ 199 │ │ # ) │
│ ❱ 200 │ │ if path_helper.is_external_lib(path): │
│ 201 │ │ │ # if path.startswith(_BUILTIN_WIDGETS_DIR): │
│ 202 │ │ │ # return '[qmlease]/widgets/{}'.format( │
│ 203 │ │ │ # relpath(path, _BUILTIN_WIDGETS_DIR) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'PathHelper' object has no attribute 'is_external_lib'
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ f:\Code\Python\test\main.py:2 in │
│ │
│ 1 from qmlease import app │
│ ❱ 2 app.run('main.qml', debug=True) │
│ 3 │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\application\application.py:126 in run │
│ │
│ 123 │ │ if debug: │
│ 124 │ │ │ from ..qmlside import HotReloader │
│ 125 │ │ │ reloader = HotReloader(reload_scheme='clear_cache', app=app) │
│ ❱ 126 │ │ │ reloader.run(qml_file) │
│ 127 │ │ else: │
│ 128 │ │ │ self._run(qml_file) │
│ 129 │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qmlside\hot_reloader\hot_reloader.py:42 in │
│ run │
│ │
│ 39 │ │ self.source = 'file:///' + file │
│ 40 │ │ self._app.set_app_name(self.title) │
│ 41 │ │ self._app.register(self, 'qmloader') │
│ ❱ 42 │ │ self._app._run(self._get_bootloader_file(file)) # noqa │
│ 43 │ │
│ 44 │ def dry_run(self): │
│ 45 │ │ self._app.register(self, 'qmloader') │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\application\application.py:138 in _run │
│ │
│ 135 │ │ self._register_backend() │
│ 136 │ │ │
│ 137 │ │ from lk_utils import normpath │
│ ❱ 138 │ │ self.engine.load('file:///' + normpath(qmlfile, force_abspath=True)) │
│ 139 │ │ │
│ 140 │ │ self.on_exit.connect(self._exit) │
│ 141 │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qmlside\console.py:96 in _handle_message │
│ │
│ 93 │ │ │ │ # strip <file>:<row>:<col> prefix from msg. │
│ 94 │ │ │ │ if msg.startswith(ctx.file): │
│ 95 │ │ │ │ │ msg = msg.replace(ctx.file, '', 1) │
│ ❱ 96 │ │ │ │ │ assert (m := re.match(r':\d+:\d+: ', msg)), msg │
│ 97 │ │ │ │ │ msg = msg[len(m.group()):] │
│ 98 │ │ │ │ │
│ 99 │ │ │ │ file_path = self._normalize_path(ctx.file) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AssertionError: :18: Error: 'PathHelper' object has no attribute 'is_external_lib'
PS F:\Code\Python\test> & f:/Code/Python/test/.conda/python.exe f:/Code/Python/test/main.py
./.conda/Lib/site-packages/qmlease/_env.py:24 > [ INFO] auto detected qt api: pyside6 (6.7.2)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qtcore\signal_slot.py:67 in func_wrapper │
│ │
│ 64 │ │ │ │ *args: T.ParamSpec.args, │
│ 65 │ │ │ │ **kwargs: T.ParamSpec.kwargs │
│ 66 │ │ ) -> T.Func: │
│ ❱ 67 │ │ │ from .qobject import QObjectBaseWrapper │
│ 68 │ │ │ new_args = [] │
│ 69 │ │ │ new_kwargs = {} │
│ 70 │
│ in parent:409 │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qmlside\console.py:100 in _handle_message │
│ │
│ 97 │ │ │ │ │ msg = msg[len(m.group()):] │
│ 98 │ │ │ │ │
│ 99 │ │ │ │ file_path = self._normalize_path(ctx.file) │
│ ❱ 100 │ │ │ │ file_path = self._reformat_path(file_path) │
│ 101 │ │ │ │ if IGNORE_UNPLEASENT_WARNINGS: │
│ 102 │ │ │ │ │ if not IS_WINDOWS: │
│ 103 │ │ │ │ │ │ if ( │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qmlside\console.py:200 in _reformat_path │
│ │
│ 197 │ │ # path, style='pretty_relpath' │
│ 198 │ │ # ), ':lv' │
│ 199 │ │ # ) │
│ ❱ 200 │ │ if path_helper.is_external_lib(path): │
│ 201 │ │ │ # if path.startswith(_BUILTIN_WIDGETS_DIR): │
│ 202 │ │ │ # return '[qmlease]/widgets/{}'.format( │
│ 203 │ │ │ # relpath(path, _BUILTIN_WIDGETS_DIR) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'PathHelper' object has no attribute 'is_external_lib'
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ f:\Code\Python\test\main.py:2 in │
│ │
│ 1 from qmlease import app │
│ ❱ 2 app.run('view.qml', debug=True) │
│ 3 │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\application\application.py:126 in run │
│ │
│ 123 │ │ if debug: │
│ 124 │ │ │ from ..qmlside import HotReloader │
│ 125 │ │ │ reloader = HotReloader(reload_scheme='clear_cache', app=app) │
│ ❱ 126 │ │ │ reloader.run(qml_file) │
│ 127 │ │ else: │
│ 128 │ │ │ self._run(qml_file) │
│ 129 │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qmlside\hot_reloader\hot_reloader.py:42 in │
│ run │
│ │
│ 39 │ │ self.source = 'file:///' + file │
│ 40 │ │ self._app.set_app_name(self.title) │
│ 41 │ │ self._app.register(self, 'qmloader') │
│ ❱ 42 │ │ self._app._run(self._get_bootloader_file(file)) # noqa │
│ 43 │ │
│ 44 │ def dry_run(self): │
│ 45 │ │ self._app.register(self, 'qmloader') │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\application\application.py:138 in _run │
│ │
│ 135 │ │ self._register_backend() │
│ 136 │ │ │
│ 137 │ │ from lk_utils import normpath │
│ ❱ 138 │ │ self.engine.load('file:///' + normpath(qmlfile, force_abspath=True)) │
│ 139 │ │ │
│ 140 │ │ self.on_exit.connect(self._exit) │
│ 141 │
│ │
│ F:\Code\Python\test.conda\Lib\site-packages\qmlease\qmlside\console.py:96 in _handle_message │
│ │
│ 93 │ │ │ │ # strip <file>:<row>:<col> prefix from msg. │
│ 97 │ │ │ │ │ msg = msg[len(m.group()):] │
│ 98 │ │ │ │ │
│ 99 │ │ │ │ file_path = self._normalize_path(ctx.file) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AssertionError: :18: Error: 'PathHelper' object has no attribute 'is_external_lib'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant