-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ed7215
commit 8d39729
Showing
10 changed files
with
259 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sync: | ||
uv cache clean && uv sync | ||
|
||
build: sync | ||
just _build_python_host Wox/resource/hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
"""Plugin manager for handling plugin instances and responses""" | ||
from typing import Dict, Any | ||
from typing import Dict, TypeVar, Callable | ||
from dataclasses import dataclass | ||
import asyncio | ||
from wox_plugin import PublicAPI, Plugin, RefreshableResult, ActionContext | ||
|
||
# Global state | ||
plugin_instances: Dict[str, Dict[str, Any]] = {} | ||
waiting_for_response: Dict[str, Any] = {} | ||
@dataclass | ||
class PluginInstance: | ||
plugin: Plugin | ||
api: PublicAPI | ||
module_path: str | ||
actions: Dict[str, Callable[[ActionContext], None]] | ||
refreshes: Dict[str, Callable[[RefreshableResult], RefreshableResult]] | ||
|
||
T = TypeVar('T') | ||
|
||
# Global state with strong typing | ||
plugin_instances: Dict[str, PluginInstance] = {} | ||
waiting_for_response: Dict[str, asyncio.Future[T]] = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ requires-python = ">=3.10" | |
dependencies = [ | ||
"loguru", | ||
"websockets", | ||
"wox-plugin==0.0.24", | ||
"wox-plugin==0.0.28", | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,4 +52,4 @@ | |
PluginInitParams, | ||
) | ||
|
||
__version__ = "0.0.24" | ||
__version__ = "0.0.28" |
Oops, something went wrong.