From 4212e14421afb3f0ee77e1c46d2b378defd3bd9e Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sun, 26 Nov 2023 14:24:51 -0500 Subject: [PATCH] Format using isort --- pyflowlauncher/__init__.py | 9 +++------ pyflowlauncher/api.py | 1 + pyflowlauncher/icons.py | 4 +--- pyflowlauncher/jsonrpc.py | 5 +++-- pyflowlauncher/method.py | 5 +++-- pyflowlauncher/plugin.py | 8 ++++---- pyflowlauncher/result.py | 15 ++++----------- 7 files changed, 19 insertions(+), 28 deletions(-) diff --git a/pyflowlauncher/__init__.py b/pyflowlauncher/__init__.py index e15586e..ba999d5 100644 --- a/pyflowlauncher/__init__.py +++ b/pyflowlauncher/__init__.py @@ -1,12 +1,9 @@ -import os +import importlib.metadata import logging +import os from .plugin import Plugin, ResultResponse -from .result import Result, JsonRPCAction, send_results - - -import importlib.metadata - +from .result import JsonRPCAction, Result, send_results log_level = os.environ.get("FLOW_LAUNCHER_API_LOG_LEVEL", "INFO") diff --git a/pyflowlauncher/api.py b/pyflowlauncher/api.py index 22446a1..f0b36cb 100644 --- a/pyflowlauncher/api.py +++ b/pyflowlauncher/api.py @@ -1,4 +1,5 @@ from typing import Optional + from .result import JsonRPCAction NAME_SPACE = 'Flow.Launcher' diff --git a/pyflowlauncher/icons.py b/pyflowlauncher/icons.py index a8be84f..02507e4 100644 --- a/pyflowlauncher/icons.py +++ b/pyflowlauncher/icons.py @@ -1,10 +1,8 @@ -import os import logging - +import os from pathlib import Path from typing import Dict, Optional - _logger = logging.getLogger(__name__) IMAGE_DIR = "Images" diff --git a/pyflowlauncher/jsonrpc.py b/pyflowlauncher/jsonrpc.py index 00c1471..1f422a7 100644 --- a/pyflowlauncher/jsonrpc.py +++ b/pyflowlauncher/jsonrpc.py @@ -1,12 +1,13 @@ from __future__ import annotations + import json import sys from typing import Any, Mapping if sys.version_info < (3, 11): - from typing_extensions import TypedDict, NotRequired + from typing_extensions import NotRequired, TypedDict else: - from typing import TypedDict, NotRequired + from typing import NotRequired, TypedDict class JsonRPCRequest(TypedDict): diff --git a/pyflowlauncher/method.py b/pyflowlauncher/method.py index 264d344..50d3e0a 100644 --- a/pyflowlauncher/method.py +++ b/pyflowlauncher/method.py @@ -1,8 +1,9 @@ from __future__ import annotations -from typing import Any, Dict, Optional + from abc import ABC, abstractmethod +from typing import Any, Dict, Optional -from .result import Result, JsonRPCAction, ResultResponse, send_results +from .result import JsonRPCAction, Result, ResultResponse, send_results from .shared import logger diff --git a/pyflowlauncher/plugin.py b/pyflowlauncher/plugin.py index da0b96b..5365ca1 100644 --- a/pyflowlauncher/plugin.py +++ b/pyflowlauncher/plugin.py @@ -1,13 +1,13 @@ from __future__ import annotations -from typing import Any, Iterable, Callable, Union + from functools import wraps +from typing import Any, Callable, Iterable, Union from pyflowlauncher.shared import logger -from .result import JsonRPCAction, ResultResponse -from .jsonrpc import JsonRPCClient from .event import EventHandler - +from .jsonrpc import JsonRPCClient +from .result import JsonRPCAction, ResultResponse Method = Callable[..., Union[ResultResponse, JsonRPCAction]] diff --git a/pyflowlauncher/result.py b/pyflowlauncher/result.py index 62dedbb..f4e8d5f 100644 --- a/pyflowlauncher/result.py +++ b/pyflowlauncher/result.py @@ -1,21 +1,14 @@ from __future__ import annotations + import sys from dataclasses import dataclass from pathlib import Path -from typing import ( - TYPE_CHECKING, - Any, - Iterable, - Optional, - Union, - Dict, - List -) +from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union if sys.version_info < (3, 11): - from typing_extensions import TypedDict, NotRequired + from typing_extensions import NotRequired, TypedDict else: - from typing import TypedDict, NotRequired + from typing import NotRequired, TypedDict if TYPE_CHECKING: