pyflowlauncher 0.2.0.dev1__tar.gz → 0.3.0.dev1__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.
Files changed (21) hide show
  1. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/PKG-INFO +3 -3
  2. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/README.md +2 -2
  3. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/__init__.py +4 -2
  4. pyflowlauncher-0.3.0.dev1/pyflowlauncher/manifest.py +25 -0
  5. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/plugin.py +14 -0
  6. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher.egg-info/PKG-INFO +3 -3
  7. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher.egg-info/SOURCES.txt +1 -0
  8. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyproject.toml +2 -2
  9. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/api.py +0 -0
  10. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/event.py +0 -0
  11. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/icons.py +0 -0
  12. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/jsonrpc.py +0 -0
  13. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/method.py +0 -0
  14. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/result.py +0 -0
  15. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/shared.py +0 -0
  16. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher/string_matcher.py +0 -0
  17. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher.egg-info/dependency_links.txt +0 -0
  18. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher.egg-info/requires.txt +0 -0
  19. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/pyflowlauncher.egg-info/top_level.txt +0 -0
  20. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/setup.cfg +0 -0
  21. {pyflowlauncher-0.2.0.dev1 → pyflowlauncher-0.3.0.dev1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyflowlauncher
3
- Version: 0.2.0.dev1
3
+ Version: 0.3.0.dev1
4
4
  Summary: Python library to help build Flow Launcher plugins.
5
5
  Author-email: William McAllister <dev.garulf@gmail.com>
6
6
  License: MIT
@@ -26,7 +26,7 @@ A basic plugin using a function as the query method.
26
26
 
27
27
  ```py
28
28
  from pyflowlauncher import Plugin, Result, send_results
29
- from pyflowlauncher.result import, ResultResponse
29
+ from pyflowlauncher.result import ResultResponse
30
30
 
31
31
  plugin = Plugin()
32
32
 
@@ -50,7 +50,7 @@ A more advanced usage using a `Method` class as the query method.
50
50
 
51
51
  ```py
52
52
  from pyflowlauncher import Plugin, Result, Method
53
- from pyflowlauncher.result import, ResultResponse
53
+ from pyflowlauncher.result import ResultResponse
54
54
 
55
55
  plugin = Plugin()
56
56
 
@@ -14,7 +14,7 @@ A basic plugin using a function as the query method.
14
14
 
15
15
  ```py
16
16
  from pyflowlauncher import Plugin, Result, send_results
17
- from pyflowlauncher.result import, ResultResponse
17
+ from pyflowlauncher.result import ResultResponse
18
18
 
19
19
  plugin = Plugin()
20
20
 
@@ -38,7 +38,7 @@ A more advanced usage using a `Method` class as the query method.
38
38
 
39
39
  ```py
40
40
  from pyflowlauncher import Plugin, Result, Method
41
- from pyflowlauncher.result import, ResultResponse
41
+ from pyflowlauncher.result import ResultResponse
42
42
 
43
43
  plugin = Plugin()
44
44
 
@@ -2,8 +2,9 @@ import importlib.metadata
2
2
  import logging
3
3
  import os
4
4
 
5
- from .plugin import Plugin, ResultResponse
6
- from .result import JsonRPCAction, Result, send_results
5
+ from .plugin import Plugin
6
+ from .result import JsonRPCAction, Result, send_results, ResultResponse
7
+ from .method import Method
7
8
 
8
9
  log_level = os.environ.get("FLOW_LAUNCHER_API_LOG_LEVEL", "INFO")
9
10
 
@@ -19,6 +20,7 @@ __all__ = [
19
20
  "send_results",
20
21
  "Result",
21
22
  "JsonRPCAction",
23
+ "Method",
22
24
  ]
23
25
 
24
26
 
@@ -0,0 +1,25 @@
1
+ from typing import TypedDict, Literal
2
+
3
+ MANIFEST_FILE = 'plugin.json'
4
+
5
+ Languages = Literal[
6
+ 'Python',
7
+ 'CSharp',
8
+ 'FSharp',
9
+ 'Executable',
10
+ 'TypeScript',
11
+ 'JavaScript',
12
+ ]
13
+
14
+
15
+ class PluginManifestSchema(TypedDict):
16
+ ID: str
17
+ ActionKeyword: str
18
+ Name: str
19
+ Description: str
20
+ Author: str
21
+ Version: str
22
+ Language: Languages
23
+ Website: str
24
+ IcoPath: str
25
+ ExecuteFileName: str
@@ -1,13 +1,17 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import sys
3
4
  from functools import wraps
4
5
  from typing import Any, Callable, Iterable, Union
6
+ from pathlib import Path
7
+ import json
5
8
 
6
9
  from pyflowlauncher.shared import logger
7
10
 
8
11
  from .event import EventHandler
9
12
  from .jsonrpc import JsonRPCClient
10
13
  from .result import JsonRPCAction, ResultResponse
14
+ from .manifest import PluginManifestSchema, MANIFEST_FILE
11
15
 
12
16
  Method = Callable[..., Union[ResultResponse, JsonRPCAction]]
13
17
 
@@ -54,3 +58,13 @@ class Plugin:
54
58
  if 'result' in feedback and self._settings is not None:
55
59
  feedback['SettingsChange'] = self.settings
56
60
  self._client.send(feedback)
61
+
62
+ def plugin_root_dir(self) -> Path:
63
+ """Return the root directory of the plugin."""
64
+ return Path(sys.argv[0]).parent
65
+
66
+ def manifest(self) -> PluginManifestSchema:
67
+ """Return the plugin manifest."""
68
+ with open(self.plugin_root_dir() / MANIFEST_FILE, 'r', encoding='utf-8') as f:
69
+ manifest = json.load(f)
70
+ return manifest
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyflowlauncher
3
- Version: 0.2.0.dev1
3
+ Version: 0.3.0.dev1
4
4
  Summary: Python library to help build Flow Launcher plugins.
5
5
  Author-email: William McAllister <dev.garulf@gmail.com>
6
6
  License: MIT
@@ -26,7 +26,7 @@ A basic plugin using a function as the query method.
26
26
 
27
27
  ```py
28
28
  from pyflowlauncher import Plugin, Result, send_results
29
- from pyflowlauncher.result import, ResultResponse
29
+ from pyflowlauncher.result import ResultResponse
30
30
 
31
31
  plugin = Plugin()
32
32
 
@@ -50,7 +50,7 @@ A more advanced usage using a `Method` class as the query method.
50
50
 
51
51
  ```py
52
52
  from pyflowlauncher import Plugin, Result, Method
53
- from pyflowlauncher.result import, ResultResponse
53
+ from pyflowlauncher.result import ResultResponse
54
54
 
55
55
  plugin = Plugin()
56
56
 
@@ -6,6 +6,7 @@ pyflowlauncher/api.py
6
6
  pyflowlauncher/event.py
7
7
  pyflowlauncher/icons.py
8
8
  pyflowlauncher/jsonrpc.py
9
+ pyflowlauncher/manifest.py
9
10
  pyflowlauncher/method.py
10
11
  pyflowlauncher/plugin.py
11
12
  pyflowlauncher/result.py
@@ -6,7 +6,7 @@ name = "pyflowlauncher"
6
6
  authors = [
7
7
  {name = "William McAllister", email = "dev.garulf@gmail.com"}
8
8
  ]
9
- version = '0.2.0-dev.1'
9
+ version = '0.3.0-dev.1'
10
10
  description = "Python library to help build Flow Launcher plugins."
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.8"
@@ -24,7 +24,7 @@ dependencies = [
24
24
  packages = ["pyflowlauncher"]
25
25
 
26
26
  [tool.bumpversion]
27
- current_version = "0.2.0-dev.1"
27
+ current_version = "0.3.0-dev.1"
28
28
  parse = """(?x)
29
29
  (?P<major>[0-9]+)
30
30
  \\.(?P<minor>[0-9]+)