PyWebView window calls not returning data
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
調査の方向性
pywebview_window_call と _monitor_action_requests から始め、次に _action_queue がアクションをディスパッチする仕組みと、server on_message がどのように登録されるかを追跡します。既存の menu:open_file_dialog フローを確認し、呼び出し結果をどこで観測できるかを判断します。create_file_dialog の結果が UI をブロックせずにアプリケーションへ届き、ファイルを開くワークフローで利用できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The pywebview window calls aren't returning data from fn
my code
# Instead of directly opening the dialog, send a request to the UI process
def open_file_dialog(self):
state, ctrl = GLOBAL_APP.server.state, GLOBAL_APP.server.controller
# Send the action to the UI process
result = ctrl.pywebview_window_call(
"create_file_dialog",
webview.FileDialog.OPEN,
file_types = ('PVD Files (*.pvd)', 'All Files (*.*)'),
allow_multiple = False
)
logging.info(f"File dialog result: {result}")
result never comes back, should probably be async anyway ... so I cant hook it up to the on_message on the server or a client state or anything else
# Register a handler for messages from the UI process
def on_message(msg):
# Check for file dialog result
logging.info(f"Received file dialog result: {msg}")
if isinstance(msg, dict) and msg.get("action") == "file_dialog_result":
logging.info(f"Received file dialog result: {msg} {dict}")
result = msg["result"]
# Set the result in the trame state
app.server.state.file_to_open = result
# ...existing message handling...
app.server.on_message = on_message
menu = [
("File", [
("Open...", "open_file_dialog"),
]),
# ("Help", [("About", app.show_about)]),
]
def on_message(msg):
logging.info(f"Message {msg}")
if msg == "menu:open_file_dialog":
app.open_file_dialog()
app.server.start(exec_mode="desktop",
maximized=True,
menu=menu,
on_message=on_message
)
Trame code
async def _monitor_action_requests(self):
while self._monitoring:
await asyncio.sleep(0.5)
if not self._action_queue.empty():
msg = self._action_queue.get_nowait()
action = msg.get("action")
args = msg.get("args", [])
kwargs = msg.get("kwargs", {})
fn = getattr(self._main_window, action)
if action == "destroy":
self.exit()
fn(*args, **kwargs)
This prevents me from being able to user pywebview menu to do a file->open in trame web view. I'd prefer not having to get rust just for file open, if we could have a return queue for pywebview that would help a ton.
- 主要言語
- Python
- スター
- 17
- フォーク
- 16
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kitware/trame-server のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
Kitware/trame-server#103 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
Kitware/trame-server#30 · コメント 2 件 ·
Kitware/trame-server の issue をすべて見る
似ている issue
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)対応中かも @geyazheng が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
langchain-ai/langchain-aws#1469 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
b4b usability
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
fix(schedule): align list_tasks since cursor filter boundary from strict > to >=対応中かも @bfs2021 が今日担当しました。 オープンagent-ready bug p2 schedule
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
allenporter/supernote#540 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
frazane/scoringrules#164 ·
メンテナーはふだん 1 日以内に返信