From: ghost Date: Thu, 5 Aug 2010 09:15:00 +0000 (+0200) Subject: lib/python/Components/VolumeControl.py: move instance to class X-Git-Tag: 3.0.0~28^2~27 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/83ca71426637db994d49662a00f1388ba6394dca lib/python/Components/VolumeControl.py: move instance to class --- diff --git a/lib/python/Components/VolumeControl.py b/lib/python/Components/VolumeControl.py index eef74d0e..38102926 100644 --- a/lib/python/Components/VolumeControl.py +++ b/lib/python/Components/VolumeControl.py @@ -5,22 +5,20 @@ from Screens.Mute import Mute from GlobalActions import globalActionMap from config import config, ConfigSubsection, ConfigInteger -instance = None - profile("VolumeControl") #TODO .. move this to a own .py file class VolumeControl: + instance = None """Volume control, handles volUp, volDown, volMute actions and display a corresponding dialog""" def __init__(self, session): global globalActionMap - global instance globalActionMap.actions["volumeUp"]=self.volUp globalActionMap.actions["volumeDown"]=self.volDown globalActionMap.actions["volumeMute"]=self.volMute - assert not instance, "only one VolumeControl instance is allowed!" - instance = self + assert not VolumeControl.instance, "only one VolumeControl instance is allowed!" + VolumeControl.instance = self config.audio = ConfigSubsection() config.audio.volume = ConfigInteger(default = 100, limits = (0, 100))