[modules/sensors] Linting

Un-import os, fix indentation
This commit is contained in:
ibrokemypie 2017-06-05 12:54:23 +10:00
parent 3317b6d2d8
commit 644c55292d
No known key found for this signature in database
GPG key ID: 972E990922570890

View file

@ -1,14 +1,15 @@
# pylint: disable=C0111,R0903
"""Displays sensor temperature """Displays sensor temperature
Requires the following executable: Requires the following executable:
* sensors * sensors
Parameters: Parameters:
* sensors.match: What line in the output of `sensors -u` should be matched against (default: temp1_input) * sensors.match: Line to match against output of 'sensors -u' (default: temp1_input)
* sensors.match_number: which of the matches you want (default -1: last match). * sensors.match_number: which of the matches you want (default -1: last match).
""" """
import os
import re import re
import bumblebee.input import bumblebee.input
@ -18,8 +19,7 @@ import bumblebee.engine
class Module(bumblebee.engine.Module): class Module(bumblebee.engine.Module):
def __init__(self, engine, config): def __init__(self, engine, config):
super(Module, self).__init__(engine, config, super(Module, self).__init__(engine, config,
bumblebee.output.Widget(full_text=self.temperature) bumblebee.output.Widget(full_text=self.temperature))
)
self._temperature = "unknown" self._temperature = "unknown"
pattern = self.parameter("match", "temp1_input") pattern = self.parameter("match", "temp1_input")
pattern_string = r"^\s*{}:\s*([\d.]+)$".format(pattern) pattern_string = r"^\s*{}:\s*([\d.]+)$".format(pattern)
@ -36,7 +36,7 @@ class Module(bumblebee.engine.Module):
return temperature return temperature
def temperature(self, widget): def temperature(self, _):
return self._temperature return self._temperature
def update(self, widgets): def update(self, widgets):