show version in settings window

This commit is contained in:
dries.k
2023-08-22 20:49:24 +02:00
parent de7229e911
commit 851056852d
6 changed files with 63 additions and 9 deletions

View File

@@ -35,7 +35,7 @@ def verify_server(force_new: bool = False, enable_import: bool = True) -> bool:
def process_messages(messages: list[gotify.GotifyMessageModel]) -> Iterator[gotify.GotifyMessageModel]:
downloader = Downloader()
for message in messages:
if image_url := get_image(message.message):
if image_url := extract_image(message.message):
downloader.get_filename(image_url)
yield message
@@ -57,7 +57,7 @@ def convert_links(text):
return _link.sub(replace, text)
def get_image(s: str) -> str | None:
def extract_image(s: str) -> str | None:
"""If `s` contains only an image URL, this function returns that URL.
This function also extracts a URL in the `![](<url>)` markdown image format.
"""
@@ -91,6 +91,10 @@ def open_file(filename: str):
subprocess.call(["open", filename])
def get_image(name: str) -> str:
return get_abs_path(f"gotify_tray/gui/images/{name}")
def get_icon(name: str) -> str:
if platform.system() == "Darwin":
name += "-macos"