Skip to content

Commit

Permalink
Move more imports to top
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rn3j committed Mar 3, 2025
1 parent d030439 commit 25a4cb0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/tauon/t_modules/t_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,21 @@
from tauon.t_modules.t_themeload import Deco, load_theme
from tauon.t_modules.t_tidal import Tidal
from tauon.t_modules.t_webserve import authserve, controller, stream_proxy, webserve, webserve2

if sys.platform == "linux":
from tauon.t_modules import t_topchart

if sys.platform not in ("win32", "darwin"):
import gi
try:
gi.require_version("Notify", "0.7")
except Exception:
logging.exception("Failed importing gi Notify 0.7, will try 0.8")
gi.require_version("Notify", "0.8")
from gi.repository import Notify
from gi.repository import GdkPixbuf
from gi.repository import GLib

if TYPE_CHECKING:
from ctypes import CDLL
from io import BufferedReader, BytesIO
Expand Down Expand Up @@ -23460,7 +23472,6 @@ def audio(self, x0: int, y0: int, w0: int, h0: int) -> None:
if not self.phazor_found:
x += round(20 * self.gui.scale)
self.ddt.text((x, y - 25 * self.gui.scale), _("PHAzOR DLL not found!"), colour, 213)

elif self.prefs.backend == 4:
y = y0 + round(20 * self.gui.scale)
x = x0 + 20 * self.gui.scale
Expand Down Expand Up @@ -38840,9 +38851,6 @@ def main(holder: Holder) -> None:
last_fm_enable = False

if not windows_native:
import gi
from gi.repository import GLib

font_folder = str(install_directory / "fonts")
if os.path.isdir(font_folder):
logging.info(f"Fonts directory: {font_folder}")
Expand Down Expand Up @@ -39284,14 +39292,6 @@ def main(holder: Holder) -> None:

if system == "Windows":
os.environ["SDL_BINARY_PATH"] = str(install_directory / "lib")
elif not msys and not macos:
try:
gi.require_version("Notify", "0.7")
except Exception:
logging.exception("Failed importing gi Notify 0.7, will try 0.8")
gi.require_version("Notify", "0.8")
from gi.repository import Notify
from gi.repository import GdkPixbuf

wayland = True
if os.environ.get("SDL_VIDEODRIVER") != "wayland":
Expand Down

0 comments on commit 25a4cb0

Please sign in to comment.