1919except ImportError :
2020 WINDOWS = False
2121
22-
23- def _init_com ():
24- if WINDOWS :
25- try :
26- comtypes .CoInitialize ()
27- except Exception :
28- pass
29-
3022# ---------------- Linux ----------------
3123try :
3224 import pulsectl
@@ -36,7 +28,7 @@ def _init_com():
3628
3729
3830logging .basicConfig (level = logging .INFO )
39- logger = logging .getLogger ("pydeej " )
31+ logger = logging .getLogger ("deej " )
4032
4133
4234# =========================================================
@@ -53,12 +45,6 @@ def __init__(self):
5345 except :
5446 self .pulse = None
5547
56- if WINDOWS :
57- try :
58- comtypes .CoInitialize ()
59- except Exception :
60- pass
61-
6248 # ---------------- Windows ----------------
6349 def refresh_windows (self ):
6450 if not WINDOWS :
@@ -251,19 +237,12 @@ def get(self):
251237# App
252238# =========================================================
253239class DeejApp :
254- _instance = None
255-
256240 def __init__ (self , config , debug = False ):
257241 self .config = Path (config )
258242 self .debug = debug
259243 self .volume = VolumeController ()
260244 self .reader = None
261- DeejApp ._instance = self
262245
263- @classmethod
264- def get_instance (cls ):
265- return cls ._instance
266-
267246 def load (self ):
268247 with open (self .config ) as f :
269248 return yaml .safe_load (f )
@@ -283,7 +262,6 @@ def run(self):
283262 self .reader = SerialReader (port , baud , sliders , self .debug , jitter_threshold = jitter , reconnect = reconnect )
284263 self .last_percent = {}
285264 self .invert = invert
286- self .current_volumes = {}
287265
288266 def handle (values ):
289267 if self .invert :
@@ -297,7 +275,6 @@ def handle(values):
297275
298276 percent = int ((v / 1023 ) * 100 )
299277 apps = mapping [key ]
300- self .current_volumes [key ] = {"percent" : percent , "apps" : apps }
301278
302279 if key not in self .last_percent or self .last_percent [key ] != percent :
303280 self .last_percent [key ] = percent
0 commit comments