s/get_hardware_manager/get_manager.
It was redundant.
This commit is contained in:
parent
3c66cb899f
commit
361b8372b6
@ -90,13 +90,13 @@ class HardwareManager(object):
|
|||||||
else:
|
else:
|
||||||
self._service.set_keyboard_brightness(True)
|
self._service.set_keyboard_brightness(True)
|
||||||
|
|
||||||
def get_hardware_manager():
|
def get_manager():
|
||||||
return _hardware_manager
|
return _manager
|
||||||
|
|
||||||
def get_network_manager():
|
def get_network_manager():
|
||||||
return _network_manager
|
return _network_manager
|
||||||
|
|
||||||
_hardware_manager = HardwareManager()
|
_manager = HardwareManager()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_network_manager = NMClient()
|
_network_manager = NMClient()
|
||||||
|
@ -62,7 +62,7 @@ class KeyHandler(object):
|
|||||||
self._key_grabber.grab(key)
|
self._key_grabber.grab(key)
|
||||||
|
|
||||||
def _set_display_brightness(self, level):
|
def _set_display_brightness(self, level):
|
||||||
hw_manager = hardwaremanager.get_hardware_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
hw_manager.set_display_brightness(level)
|
hw_manager.set_display_brightness(level)
|
||||||
if level == 0:
|
if level == 0:
|
||||||
self._set_display_mode(hardwaremanager.B_AND_W_MODE)
|
self._set_display_mode(hardwaremanager.B_AND_W_MODE)
|
||||||
@ -70,7 +70,7 @@ class KeyHandler(object):
|
|||||||
self._set_display_mode(hardwaremanager.COLOR_MODE)
|
self._set_display_mode(hardwaremanager.COLOR_MODE)
|
||||||
|
|
||||||
def _set_display_mode(self, mode):
|
def _set_display_mode(self, mode):
|
||||||
hw_manager = hardwaremanager.get_hardware_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
hw_manager.set_display_mode(mode)
|
hw_manager.set_display_mode(mode)
|
||||||
|
|
||||||
def handle_zoom_mesh(self):
|
def handle_zoom_mesh(self):
|
||||||
@ -98,21 +98,21 @@ class KeyHandler(object):
|
|||||||
self._set_display_brightness(15)
|
self._set_display_brightness(15)
|
||||||
|
|
||||||
def handle_volume_1(self):
|
def handle_volume_1(self):
|
||||||
hw_manager = hardwaremanager.get_hardware_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
hw_manager.set_mute(True)
|
hw_manager.set_mute(True)
|
||||||
|
|
||||||
def handle_volume_2(self):
|
def handle_volume_2(self):
|
||||||
hw_manager = hardwaremanager.get_hardware_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
hw_manager.set_mute(False)
|
hw_manager.set_mute(False)
|
||||||
hw_manager.set_volume(50)
|
hw_manager.set_volume(50)
|
||||||
|
|
||||||
def handle_volume_3(self):
|
def handle_volume_3(self):
|
||||||
hw_manager = hardwaremanager.get_hardware_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
hw_manager.set_mute(False)
|
hw_manager.set_mute(False)
|
||||||
hw_manager.set_volume(80)
|
hw_manager.set_volume(80)
|
||||||
|
|
||||||
def handle_volume_4(self):
|
def handle_volume_4(self):
|
||||||
hw_manager = hardwaremanager.get_hardware_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
hw_manager.set_mute(False)
|
hw_manager.set_mute(False)
|
||||||
hw_manager.set_volume(100)
|
hw_manager.set_volume(100)
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ class KeyHandler(object):
|
|||||||
mgr.Shutdown()
|
mgr.Shutdown()
|
||||||
|
|
||||||
def handle_keyboard_brightness(self):
|
def handle_keyboard_brightness(self):
|
||||||
hw_manager = hardwaremanager.get_hardware_manager()
|
hw_manager = hardwaremanager.get_manager()
|
||||||
if hw_manager:
|
if hw_manager:
|
||||||
hw_manager.toggle_keyboard_brightness()
|
hw_manager.toggle_keyboard_brightness()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user