summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessio Sergi <al3hex@gmail.com>2014-05-27 01:07:47 +0200
committerAlessio Sergi <al3hex@gmail.com>2014-05-27 01:07:47 +0200
commit950b12cfcf089751614e5778108efbba142dfde8 (patch)
treef4d6b8786b639d721ef6c928e582f78b278a39ce
parent21b5a27ed6e368af89f464a76ecda75806532168 (diff)
batterie -> battery
Remove unused variables No whitespace inside parentheses Add missing whitespace around arithmetic operator Fix indentation Remove trailing whitespaces
-rw-r--r--conf/glances-monitor.conf8
-rw-r--r--conf/glances.conf8
-rw-r--r--glances/outputs/glances_colorconsole.py2
-rw-r--r--glances/plugins/glances_batpercent.py20
-rw-r--r--glances/plugins/glances_network.py14
-rw-r--r--glances/plugins/glances_sensors.py14
6 files changed, 33 insertions, 33 deletions
diff --git a/conf/glances-monitor.conf b/conf/glances-monitor.conf
index c9f6338b..94fb17a0 100644
--- a/conf/glances-monitor.conf
+++ b/conf/glances-monitor.conf
@@ -81,10 +81,10 @@ temperature_core_critical=80
temperature_hdd_careful=45
temperature_hdd_warning=52
temperature_hdd_critical=60
-# Batterie % limits
-batterie_careful=80
-batterie_warning=90
-batterie_critical=95
+# Battery % limits
+battery_careful=80
+battery_warning=90
+battery_critical=95
[processlist]
# Limit values for CPU/MEM per process in %
diff --git a/conf/glances.conf b/conf/glances.conf
index 77771544..c315e7fc 100644
--- a/conf/glances.conf
+++ b/conf/glances.conf
@@ -81,10 +81,10 @@ temperature_core_critical=80
temperature_hdd_careful=45
temperature_hdd_warning=52
temperature_hdd_critical=60
-# Batterie % limits
-batterie_careful=80
-batterie_warning=90
-batterie_critical=95
+# Battery % limits
+battery_careful=80
+battery_warning=90
+battery_critical=95
[processlist]
# Limit values for CPU/MEM per process in %
diff --git a/glances/outputs/glances_colorconsole.py b/glances/outputs/glances_colorconsole.py
index 48e1cfcc..20d9b1ae 100644
--- a/glances/outputs/glances_colorconsole.py
+++ b/glances/outputs/glances_colorconsole.py
@@ -17,9 +17,9 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import time
import sys
import threading
+import time
import msvcrt
try:
diff --git a/glances/plugins/glances_batpercent.py b/glances/plugins/glances_batpercent.py
index fe792536..becf958b 100644
--- a/glances/plugins/glances_batpercent.py
+++ b/glances/plugins/glances_batpercent.py
@@ -32,7 +32,7 @@ from glances.plugins.glances_plugin import GlancesPlugin
class Plugin(GlancesPlugin):
"""
- Glances's batterie capacity Plugin
+ Glances battery capacity plugin
stats is a list
"""
@@ -59,7 +59,7 @@ class Plugin(GlancesPlugin):
def update(self):
"""
- Update batterie capacity stats using the input method
+ Update battery capacity stats using the input method
"""
# Reset stats
@@ -77,9 +77,10 @@ class Plugin(GlancesPlugin):
return self.stats
+
class glancesGrabBat:
"""
- Get batteries stats using the Batinfo librairie
+ Get batteries stats using the Batinfo library
"""
def __init__(self):
@@ -91,11 +92,10 @@ class glancesGrabBat:
self.initok = True
self.bat_list = []
self.update()
- except Exception as e:
- # print(_("Warning: Can not grab batterie sensor. Missing BatInfo lib (%s).") % e)
+ except Exception:
+ # print(_("Warning: Cannot grab battery sensor. Missing BatInfo library."))
self.initok = False
-
def update(self):
"""
Update the stats
@@ -103,13 +103,13 @@ class glancesGrabBat:
if self.initok:
try:
self.bat.update()
- except Exception as e:
+ except Exception:
self.bat_list = []
else:
self.bat_list = []
- new_item = { 'label': _("Batterie (%)"),
- 'value': self.getcapacitypercent() }
- self.bat_list.append(new_item)
+ new_item = {'label': _("Battery (%)"),
+ 'value': self.getcapacitypercent()}
+ self.bat_list.append(new_item)
else:
self.bat_list = []
diff --git a/glances/plugins/glances_network.py b/glances/plugins/glances_network.py
index bcb7b161..88b0dd2e 100644
--- a/glances/plugins/glances_network.py
+++ b/glances/plugins/glances_network.py
@@ -228,7 +228,7 @@ class Plugin(GlancesPlugin):
sx = self.auto_unit(int(i['rx'] // i['time_since_update'])
+ int(i['tx'] // i['time_since_update']))
else:
- # Bits per second (for real network administrator | Default)
+ # Bits per second (for real network administrator | Default)
if args.network_cumul:
rx = self.auto_unit(int(i['cumulative_rx'] * 8)) + "b"
tx = self.auto_unit(int(i['cumulative_tx'] * 8)) + "b"
@@ -248,12 +248,12 @@ class Plugin(GlancesPlugin):
ret.append(self.curse_add_line(msg))
else:
msg = "{0:>7}".format(rx)
- ret.append(self.curse_add_line(msg,
- self.get_alert(int(i['rx'] // i['time_since_update'] * 8),
- header=ifname+'_rx')))
+ ret.append(self.curse_add_line(
+ msg, self.get_alert(int(i['rx'] // i['time_since_update'] * 8),
+ header=ifname + '_rx')))
msg = "{0:>7}".format(tx)
- ret.append(self.curse_add_line(msg,
- self.get_alert(int(i['tx'] // i['time_since_update'] * 8),
- header=ifname+'_tx')))
+ ret.append(self.curse_add_line(
+ msg, self.get_alert(int(i['tx'] // i['time_since_update'] * 8),
+ header=ifname + '_tx')))
return ret
diff --git a/glances/plugins/glances_sensors.py b/glances/plugins/glances_sensors.py
index 9b72eac0..60f60f4f 100644
--- a/glances/plugins/glances_sensors.py
+++ b/glances/plugins/glances_sensors.py
@@ -26,9 +26,9 @@ except ImportError:
# Import Glances lib
from glances.core.glances_globals import is_py3
-from glances.plugins.glances_plugin import GlancesPlugin
-from glances.plugins.glances_hddtemp import Plugin as HddTempPlugin
from glances.plugins.glances_batpercent import Plugin as BatPercentPlugin
+from glances.plugins.glances_hddtemp import Plugin as HddTempPlugin
+from glances.plugins.glances_plugin import GlancesPlugin
class Plugin(GlancesPlugin):
@@ -85,8 +85,8 @@ class Plugin(GlancesPlugin):
hddtemp = self.__set_type(self.hddtemp_plugin.update(), 'temperature_hdd')
self.stats.extend(hddtemp)
# Append Batteries %
- batpercent = self.__set_type(self.batpercent_plugin.update(), 'batterie')
- self.stats.extend(batpercent)
+ batpercent = self.__set_type(self.batpercent_plugin.update(), 'battery')
+ self.stats.extend(batpercent)
elif self.get_input() == 'snmp':
# Update stats using SNMP
# No standard: http://www.net-snmp.org/wiki/index.php/Net-SNMP_and_lm-sensors_on_Ubuntu_10.04
@@ -99,10 +99,10 @@ class Plugin(GlancesPlugin):
3 types of stats is possible in the Sensors plugins:
- Core temperature
- HDD temperature
- - Batterie capacity
+ - Battery capacity
"""
for i in stats:
- i.update({ 'type': sensor_type })
+ i.update({'type': sensor_type})
return stats
def msg_curse(self, args=None):
@@ -132,7 +132,7 @@ class Plugin(GlancesPlugin):
msg = "{0:18}".format(item['label'][:18])
ret.append(self.curse_add_line(msg))
msg = "{0:>5}".format(item['value'])
- if item['type'] == 'batterie':
+ if item['type'] == 'battery':
ret.append(self.curse_add_line(msg, self.get_alert(100 - item['value'], header=item['type'])))
else:
ret.append(self.curse_add_line(msg, self.get_alert(item['value'], header=item['type'])))