summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/net_rate.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/net_rate.py b/modules/net_rate.py
index 6e5d40e..dff075c 100644
--- a/modules/net_rate.py
+++ b/modules/net_rate.py
@@ -11,7 +11,7 @@ Module for displaying current network transfer rate.
@license Eclipse Public License
"""
-CACHED_TIME = 1 # update time (in seconds)
+CACHED_TIME = 2 # update time (in seconds)
POSITION = 0 # bar position
DEVFILE = "/proc/net/dev" # location of dev file under /proc
@@ -32,7 +32,7 @@ Placeholders:
FORMAT = "{interface}: {total}"
PRECISION = 1 # amount of numbers after dot
-MULTIPLIER_TOP = 1024 # if value is greater, divide it with UNIT_MULTI and get next unit from UNITS
+MULTIPLIER_TOP = 999 # if value is greater, divide it with UNIT_MULTI and get next unit from UNITS
LEFT_ALIGN = len(str(MULTIPLIER_TOP)) + 1 + PRECISION # == 6 characters (from MULTIPLIER_TOP + dot + PRECISION)
"""
@@ -53,10 +53,10 @@ NO_CONNECTION = "! no data" # when there is no data transmitted from the start
HIDE_IF_NO = False # hide indicator if rate == 0
-"""
-Get statistics from devfile in list of lists of words
-"""
def get_stat():
+ """
+ Get statistics from devfile in list of lists of words
+ """
def dev_filter(x):
# get first word and remove trailing interface number
x = x.strip().split(" ")[0][:-1]
@@ -83,10 +83,10 @@ def get_stat():
return None
-"""
-Divide a value and return formatted string
-"""
def divide_and_format(value):
+ """
+ Divide a value and return formatted string
+ """
for i, unit in enumerate(UNITS):
if value > MULTIPLIER_TOP:
value /= UNIT_MULTI