Skip to content

Commit

Permalink
Type up translation _() function
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rn3j committed Nov 26, 2024
1 parent f0733e6 commit 6e9d62d
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 24 deletions.
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
if TYPE_CHECKING:
from tauon.t_modules.t_main import Tauon

_ = lambda m: m
def _(m: str) -> str:
return m

def get_ip() -> str:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
Expand Down
5 changes: 4 additions & 1 deletion src/tauon/t_modules/t_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@

import logging
import os

from tauon.t_modules.t_extra import tryint

_ = lambda m: m

def _(m: str) -> str:
return m

class Config:

Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

from tauon.t_modules.t_main import Tauon

_ = lambda m: m
def _(m: str) -> str:
return m

class Gnome:

Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
except Exception:
logging.exception("Unkown error trying to import jxlpy, JPEG XL support will be disabled.")

_ = lambda m: m
def _(m: str) -> str:
return m

system = "Linux"
if sys.platform == "win32":
Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class TauonPlaylist:
parent_playlist_id: str # Filter parent playlist id (string)
persist_time_positioning: bool # Persist time positioning

_ = lambda m: m
def _(m: str) -> str:
return m

def tmp_cache_dir() -> str:
tmp_dir = GLib.get_tmp_dir()
Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_jellyfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
from tauon.t_modules.t_extra import TauonPlaylist
from tauon.t_modules.t_main import Tauon, TrackClass

_ = lambda m: m
def _(m: str) -> str:
return m

class Jellyfin:

Expand Down
4 changes: 3 additions & 1 deletion src/tauon/t_modules/t_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
if TYPE_CHECKING:
from tauon.t_modules.t_main import GuiVar, PlayerCtl, Tauon, TDraw

_ = lambda m: m
def _(m: str) -> str:
return m

class Launch:
def __init__(self, tauon: Tauon, pctl: PlayerCtl, gui: GuiVar, ddt: TDraw) -> None:
self.tauon = tauon
Expand Down
4 changes: 3 additions & 1 deletion src/tauon/t_modules/t_lyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
from bs4 import BeautifulSoup
from unidecode import unidecode

_ = lambda m: m

def _(m: str) -> str:
return m

# def lyricwiki(artist: str, title: str) -> str:
#
Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_phazor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
if TYPE_CHECKING:
from tauon.t_modules.t_main import PlayerCtl, Tauon, TrackClass

_ = lambda m: m
def _(m: str) -> str:
return m

def find_library(libname: str) -> Path | None:
"""Search for 'libname.so'.
Expand Down
4 changes: 2 additions & 2 deletions src/tauon/t_modules/t_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
if TYPE_CHECKING:
from collections.abc import Callable

_ = lambda m: m

def _(m: str) -> str:
return m

def bandcamp_search(artist: str, callback: Callable[[str | None], None] | None = None) -> str | None:
"""Search Bandcamp for the artist and return their URL"""
Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_spot.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
else:
tekore_imported = True

_ = lambda m: m
def _(m: str) -> str:
return m

class SpotCtl:

Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@

from tauon.t_modules.t_main import Tauon

_ = lambda m: m
def _(m: str) -> str:
return m

class StreamEnc:

Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_svgout.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
require_version("Rsvg", "2.0")
from gi.repository import Rsvg

_ = lambda m: m
def _(m: str) -> str:
return m

def render_icons(source_directory: str, output_directory: str, scale: int) -> None:
"""Render SVG files to PNG"""
Expand Down
4 changes: 3 additions & 1 deletion src/tauon/t_modules/t_tagscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

from tauon.t_modules.t_extra import process_odat

_ = lambda m: m

def _(m: str) -> str:
return m

def parse_mbids_from_vorbis(object, key, value):

Expand Down
5 changes: 3 additions & 2 deletions src/tauon/t_modules/t_themeload.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
from tauon.t_modules.t_draw import TDraw
from tauon.t_modules.t_main import GuiVar, Tauon

_ = lambda m: m
def get_colour_from_line(cline: str) -> list[int]:
def _(m: str) -> str:
return m

def get_colour_from_line(cline: str) -> list[int]:
colour = [-1, -1, -1, -1]
colour_str = ["", "", "", ""]
mode = 0
Expand Down
3 changes: 2 additions & 1 deletion src/tauon/t_modules/t_tidal.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
if TYPE_CHECKING:
from tauon.t_modules.t_main import Tauon, TrackClass

_ = lambda m: m
def _(m: str) -> str:
return m

class Tidal:

Expand Down
10 changes: 5 additions & 5 deletions src/tauon/t_modules/t_topchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@

import logging
import os
from typing import TYPE_CHECKING

import gi
from PIL import Image

gi.require_version("Pango", "1.0")
gi.require_version("PangoCairo", "1.0")

from typing import TYPE_CHECKING

import cairo
from gi.repository import Pango, PangoCairo
from PIL import Image

if TYPE_CHECKING:
from tauon.t_modules.t_main import AlbumArt, Tauon, TrackClass

_ = lambda m: m
def _(m: str) -> str:
return m

class TopChart:

def __init__(self, tauon: Tauon, album_art_gen: AlbumArt) -> None:
Expand Down
4 changes: 3 additions & 1 deletion src/tauon/t_modules/t_webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
if TYPE_CHECKING:
from tauon.t_modules.t_main import AlbumArt, GuiVar, PlayerCtl, Prefs, Tauon, TrackClass

_ = lambda m: m
def _(m: str) -> str:
return m

def send_file(path: str, mime: str, server) -> None:
range_req = False
start = 0
Expand Down

0 comments on commit 6e9d62d

Please sign in to comment.