Fixed typo.
This commit is contained in:
parent
96ef3656c8
commit
3a69a5d0eb
@ -1,5 +1,5 @@
|
|||||||
from i3pystatus import SettingsBase, IntervalModule, formatp
|
from i3pystatus import SettingsBase, IntervalModule, formatp
|
||||||
from i3pystatus.core.util import internet
|
from i3pystatus.core.util import internet, require
|
||||||
|
|
||||||
|
|
||||||
class Backend(SettingsBase):
|
class Backend(SettingsBase):
|
||||||
@ -42,7 +42,7 @@ class Updates(IntervalModule):
|
|||||||
|
|
||||||
settings = (
|
settings = (
|
||||||
("backends", "Required list of backends used to check for updates."),
|
("backends", "Required list of backends used to check for updates."),
|
||||||
("format", "String shown when updates are availible. "
|
("format", "String shown when updates are available. "
|
||||||
"May contain formatters."),
|
"May contain formatters."),
|
||||||
("format_no_updates", "String that is shown if no updates are available."
|
("format_no_updates", "String that is shown if no updates are available."
|
||||||
" If not set the module will be hidden if no updates are available."),
|
" If not set the module will be hidden if no updates are available."),
|
||||||
@ -64,11 +64,8 @@ class Updates(IntervalModule):
|
|||||||
if not isinstance(self.backends, list):
|
if not isinstance(self.backends, list):
|
||||||
self.backends = [self.backends]
|
self.backends = [self.backends]
|
||||||
|
|
||||||
|
@require(internet)
|
||||||
def run(self):
|
def run(self):
|
||||||
if not internet():
|
|
||||||
self.logger.info("Updates: No internet connection.")
|
|
||||||
return
|
|
||||||
|
|
||||||
updates_count = 0
|
updates_count = 0
|
||||||
for backend in self.backends:
|
for backend in self.backends:
|
||||||
updates_count += backend.updates
|
updates_count += backend.updates
|
||||||
|
Loading…
Reference in New Issue
Block a user