Skip to content

Commit 8a4086b

Browse files
committed
run formatters
1 parent a5c9354 commit 8a4086b

5 files changed

Lines changed: 37 additions & 13 deletions

File tree

WordnikDictionary/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import inspect
22
import json
3-
import re, os
3+
import os
4+
import re
45
import sys
56
import webbrowser
67
from logging import getLogger
@@ -181,4 +182,4 @@ def change_query(self, query: str):
181182
FlowLauncherAPI.change_query(query)
182183

183184
def open_log_file_folder(self):
184-
os.system(f"explorer.exe /select, \"wordnik.logs\"")
185+
os.system(f'explorer.exe /select, "wordnik.logs"')

WordnikDictionary/errors.py

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from .options import Option
44

5-
__all__ = ("PluginException","InternalException")
5+
__all__ = ("PluginException", "InternalException")
6+
67

78
class BaseException(Exception):
89
options: list[Option]
@@ -13,6 +14,7 @@ def __init__(self, text: str, options: list[Option]) -> None:
1314
for opt in options:
1415
opt.icon = "error"
1516

17+
1618
class PluginException(BaseException):
1719
@classmethod
1820
def create(
@@ -36,10 +38,32 @@ def wnf(cls: type[PluginException]) -> PluginException:
3638

3739
class InternalException(BaseException):
3840
def __init__(self) -> None:
39-
opts= [
41+
opts = [
4042
Option(score=100, icon="error", title="An internal error has occured."),
41-
Option(score=80, icon="github", title="Please open a github issue", sub="Click this to open github repository", callback="open_url", params=["https://github.com/cibere/Flow.Launcher.Plugin.WordNikDictionary"]),
42-
Option(score=79, icon="discord", title="Or create a thread in our discord server", sub='Click on this to open discord invite', callback="open_url", params=['https://discord.gg/y4STfDvc8j']),
43-
Option(score=0, icon="log_file", title="And provide your log file (wordnik.log)", sub="Click on this to open plugin folder.", callback="open_log_file_folder")
43+
Option(
44+
score=80,
45+
icon="github",
46+
title="Please open a github issue",
47+
sub="Click this to open github repository",
48+
callback="open_url",
49+
params=[
50+
"https://github.com/cibere/Flow.Launcher.Plugin.WordNikDictionary"
51+
],
52+
),
53+
Option(
54+
score=79,
55+
icon="discord",
56+
title="Or create a thread in our discord server",
57+
sub="Click on this to open discord invite",
58+
callback="open_url",
59+
params=["https://discord.gg/y4STfDvc8j"],
60+
),
61+
Option(
62+
score=0,
63+
icon="log_file",
64+
title="And provide your log file (wordnik.log)",
65+
sub="Click on this to open plugin folder.",
66+
callback="open_log_file_folder",
67+
),
4468
]
45-
super().__init__("An Interal Error has occured.", opts)
69+
super().__init__("An Interal Error has occured.", opts)

WordnikDictionary/options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(
1616
context_data: list[Option] = [],
1717
hide_after_callback: bool = True,
1818
score: int = 0,
19-
icon: str = "app"
19+
icon: str = "app",
2020
):
2121
self.title = title
2222
self.icon_name = icon
@@ -30,7 +30,7 @@ def __init__(
3030
@property
3131
def icon(self) -> str:
3232
return f"Images/{self.icon_name}.png"
33-
33+
3434
@icon.setter
3535
def icon(self, name: str) -> None:
3636
self.icon_name = name
@@ -41,7 +41,7 @@ def to_jsonrpc(self) -> dict:
4141
"SubTitle": self.sub,
4242
"IcoPath": self.icon,
4343
"ContextData": [opt.to_jsonrpc() for opt in self.context_data],
44-
"score": self.score
44+
"score": self.score,
4545
}
4646
if self.callback:
4747
data["JsonRPCAction"] = {

WordnikDictionary/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def inner(*args, **kwargs):
4545
def setup_logging() -> None:
4646
level = logging.DEBUG
4747
handler = logging.handlers.RotatingFileHandler("wordnik.logs", maxBytes=1000000)
48-
48+
4949
dt_fmt = "%Y-%m-%d %H:%M:%S"
5050
formatter = logging.Formatter(
5151
"[{asctime}] [{levelname:<8}] {name}: {message}", dt_fmt, style="{"

WordnikDictionary/word_relationship.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
43
from .dataclass import Dataclass
54
from .options import Option
65

0 commit comments

Comments
 (0)