Skip to content

Commit

Permalink
distutils version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Schimansky committed Feb 11, 2021
1 parent 830cc24 commit 181c7aa
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import sys
import numpy as np
from distutils.version import StrictVersion as Version

from tuner_audio.audio_analyzer import AudioAnalyzer
from tuner_audio.threading_helper import ProtectedList
Expand All @@ -19,16 +20,12 @@
from settings import Settings


def version_tuple(version: str):
return tuple(map(int, (version.split("."))))


class App(tkinter.Tk):
def __init__(self, *args, **kwargs):
if sys.platform == "darwin": # macOS
if version_tuple(tkinter.Tcl().call("info", "patchlevel")) >= version_tuple("8.6.9"): # Tcl/Tk >= 8.6.9
if Version(tkinter.Tcl().call("info", "patchlevel")) >= Version("8.6.9"): # Tcl/Tk >= 8.6.9
os.system("defaults write -g NSRequiresAquaSystemAppearance -bool No") # Only for dark-mode testing!
# WARNING: This command applies macOS darkmode on all programs. This can cause bugs on some programs.
# WARNING: This command applies macOS dark-mode on all programs. This can cause bugs on some programs.
# Currently this works only with anaconda python version with Tcl/Tk >= 8.6.9.

tkinter.Tk.__init__(self, *args, **kwargs)
Expand Down

0 comments on commit 181c7aa

Please sign in to comment.