Reformat
This commit is contained in:
parent
d9e3dec0c2
commit
cdf9176258
@ -16,6 +16,7 @@ class CommandEndpoint:
|
|||||||
:param modules: dict-like object with item access semantics via .get()
|
:param modules: dict-like object with item access semantics via .get()
|
||||||
:param io_handler_factory: function creating a file-like object returning a JSON generator on .read()
|
:param io_handler_factory: function creating a file-like object returning a JSON generator on .read()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, modules, io_handler_factory):
|
def __init__(self, modules, io_handler_factory):
|
||||||
self.modules = modules
|
self.modules = modules
|
||||||
self.io_handler_factory = io_handler_factory
|
self.io_handler_factory = io_handler_factory
|
||||||
@ -57,7 +58,9 @@ class Status:
|
|||||||
"""Register a new module."""
|
"""Register a new module."""
|
||||||
from i3pystatus.text import Text
|
from i3pystatus.text import Text
|
||||||
|
|
||||||
if module:
|
if not module:
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return self.modules.append(module, *args, **kwargs)
|
return self.modules.append(module, *args, **kwargs)
|
||||||
except ImportError as import_error:
|
except ImportError as import_error:
|
||||||
@ -74,8 +77,6 @@ class Status:
|
|||||||
return self.modules.append(Text(
|
return self.modules.append(Text(
|
||||||
color="#FF0000",
|
color="#FF0000",
|
||||||
text=configuration_error.message))
|
text=configuration_error.message))
|
||||||
else:
|
|
||||||
return None
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.command_endpoint.start()
|
self.command_endpoint.start()
|
||||||
|
Loading…
Reference in New Issue
Block a user