pyflowlauncher 0.5.0.dev0__tar.gz → 0.6.0.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/PKG-INFO +1 -1
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/plugin.py +13 -3
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/string_matcher.py +4 -3
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher.egg-info/PKG-INFO +1 -1
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyproject.toml +2 -2
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/README.md +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/__init__.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/api.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/event.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/icons.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/jsonrpc.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/manifest.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/method.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/py.typed +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/result.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher/shared.py +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher.egg-info/SOURCES.txt +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher.egg-info/dependency_links.txt +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher.egg-info/requires.txt +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher.egg-info/top_level.txt +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/setup.cfg +0 -0
- {pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/setup.py +0 -0
|
@@ -59,12 +59,22 @@ class Plugin:
|
|
|
59
59
|
feedback['SettingsChange'] = self.settings
|
|
60
60
|
self._client.send(feedback)
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
@property
|
|
63
|
+
def run_dir(self) -> Path:
|
|
64
|
+
"""Return the run directory of the plugin."""
|
|
64
65
|
return Path(sys.argv[0]).parent
|
|
65
66
|
|
|
67
|
+
def root_dir(self) -> Path:
|
|
68
|
+
"""Return the root directory of the plugin."""
|
|
69
|
+
current_dir = self.run_dir
|
|
70
|
+
for part in current_dir.parts:
|
|
71
|
+
if current_dir.joinpath(MANIFEST_FILE).exists():
|
|
72
|
+
return current_dir
|
|
73
|
+
current_dir = current_dir.parent
|
|
74
|
+
raise FileNotFoundError(f"Could not find {MANIFEST_FILE} in {self.run_dir} or any parent directory.")
|
|
75
|
+
|
|
66
76
|
def manifest(self) -> PluginManifestSchema:
|
|
67
77
|
"""Return the plugin manifest."""
|
|
68
|
-
with open(self.
|
|
78
|
+
with open(self.root_dir() / MANIFEST_FILE, 'r', encoding='utf-8') as f:
|
|
69
79
|
manifest = json.load(f)
|
|
70
80
|
return manifest
|
|
@@ -123,10 +123,11 @@ def string_matcher(query: str, text: str, ignore_case: bool = True,
|
|
|
123
123
|
nearest_space_index = calculate_closest_space_index(
|
|
124
124
|
space_indices, first_match_index)
|
|
125
125
|
|
|
126
|
-
score = calculate_search_score(query, text, first_match_index - nearest_space_index - 1,
|
|
127
|
-
|
|
126
|
+
score: float = calculate_search_score(query, text, first_match_index - nearest_space_index - 1,
|
|
127
|
+
space_indices, last_match_index - first_match_index,
|
|
128
|
+
all_substrings_contained_in_text)
|
|
128
129
|
|
|
129
|
-
return MatchData(True, query_search_precision, index_list, score)
|
|
130
|
+
return MatchData(True, query_search_precision, index_list, int(score))
|
|
130
131
|
|
|
131
132
|
return MatchData(False, query_search_precision)
|
|
132
133
|
|
|
@@ -6,7 +6,7 @@ name = "pyflowlauncher"
|
|
|
6
6
|
authors = [
|
|
7
7
|
{name = "William McAllister", email = "dev.garulf@gmail.com"}
|
|
8
8
|
]
|
|
9
|
-
version = '0.
|
|
9
|
+
version = '0.6.0-dev.0'
|
|
10
10
|
description = "Python library to help build Flow Launcher plugins."
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
requires-python = ">=3.8"
|
|
@@ -27,7 +27,7 @@ packages = ["pyflowlauncher"]
|
|
|
27
27
|
"pyflowlauncher" = ["py.typed"]
|
|
28
28
|
|
|
29
29
|
[tool.bumpversion]
|
|
30
|
-
current_version = "0.
|
|
30
|
+
current_version = "0.6.0-dev.0"
|
|
31
31
|
parse = """(?x)
|
|
32
32
|
(?P<major>[0-9]+)
|
|
33
33
|
\\.(?P<minor>[0-9]+)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher.egg-info/requires.txt
RENAMED
|
File without changes
|
{pyflowlauncher-0.5.0.dev0 → pyflowlauncher-0.6.0.dev0}/pyflowlauncher.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|