v1.0.15 New features and bug fixes

pull/81/head v1.0.15
aristocratos 2020-08-15 18:07:44 +02:00
parent c10bb09371
commit 21b1dc1e81
2 changed files with 15 additions and 8 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## v1.0.15
* Added: Network graph color gradient bandwidth option by @drazil100
* Added: cpu_thermal sensor detection for raspberri pi cpu temp
* Fixed: Single color graphs crash
## v1.0.14 ## v1.0.14
* Added: New theme values "graph_text", "meter_bg", "process_start", "process_mid" and "process_end", see default_black.theme for reference. * Added: New theme values "graph_text", "meter_bg", "process_start", "process_mid" and "process_end", see default_black.theme for reference.

View File

@ -56,7 +56,7 @@ if errors:
print("\nInstall required modules!\n") print("\nInstall required modules!\n")
raise SystemExit(1) raise SystemExit(1)
VERSION: str = "1.0.14" VERSION: str = "1.0.15"
#? Argument parser -------------------------------------------------------------------------------> #? Argument parser ------------------------------------------------------------------------------->
if len(sys.argv) > 1: if len(sys.argv) > 1:
@ -2913,15 +2913,15 @@ class NetCollector(Collector):
if speed > stat["graph_top"]: if speed > stat["graph_top"]:
stat["graph_raise"] += 1 stat["graph_raise"] += 1
if stat["graph_lower"] > 0: stat["graph_lower"] -= 1 if stat["graph_lower"] > 0: stat["graph_lower"] -= 1
elif stat["graph_top"] > cls.net_min[direction] and speed < stat["graph_top"] // 10: elif speed < stat["graph_top"] // 10:
stat["graph_lower"] += 1 stat["graph_lower"] += 1
if stat["graph_raise"] > 0: stat["graph_raise"] -= 1 if stat["graph_raise"] > 0: stat["graph_raise"] -= 1
if stat["graph_raise"] >= 5 or stat["graph_lower"] >= 5: if stat["graph_raise"] >= 5 or stat["graph_lower"] >= 5:
if stat["graph_raise"] >= 5: if stat["graph_raise"] >= 5:
stat["graph_top"] = round(max(stat["speed"][-10:]) / 0.8) stat["graph_top"] = round(max(stat["speed"][-5:]) / 0.8)
elif stat["graph_lower"] >= 5: elif stat["graph_lower"] >= 5:
stat["graph_top"] = max(10 << 10, max(stat["speed"][-10:]) * 3) stat["graph_top"] = max(10 << 10, max(stat["speed"][-5:]) * 3)
stat["graph_raise"] = 0 stat["graph_raise"] = 0
stat["graph_lower"] = 0 stat["graph_lower"] = 0
stat["redraw"] = True stat["redraw"] = True
@ -3626,7 +3626,7 @@ class Menu:
'Start in network graphs auto rescaling mode.', 'Start in network graphs auto rescaling mode.',
'', '',
'Ignores any values set above at start and', 'Ignores any values set above at start and',
'rescales down to 10KibiBytes at he lowest.', 'rescales down to 10KibiBytes at the lowest.',
'', '',
'True or False.'], 'True or False.'],
"net_color_fixed" : [ "net_color_fixed" : [
@ -3812,6 +3812,7 @@ class Menu:
CpuCollector.sensor_method = "" CpuCollector.sensor_method = ""
CpuCollector.got_sensors = False CpuCollector.got_sensors = False
if selected in ["net_auto", "net_color_fixed"]: if selected in ["net_auto", "net_color_fixed"]:
if selected == "net_auto": NetCollector.auto_min = CONFIG.net_auto
NetBox.redraw = True NetBox.redraw = True
Term.refresh(force=True) Term.refresh(force=True)
cls.resized = False cls.resized = False
@ -4312,11 +4313,11 @@ if __name__ == "__main__":
if start: return if start: return
cls.draw_bg(10) cls.draw_bg(5)
Draw.buffer("+init!", f'{Mv.restore}{Symbol.ok}\n{Mv.r(Term.width // 2 - 22)}{Mv.save}') Draw.buffer("+init!", f'{Mv.restore}{Symbol.ok}\n{Mv.r(Term.width // 2 - 22)}{Mv.save}')
@classmethod @classmethod
def draw_bg(cls, times: int = 10): def draw_bg(cls, times: int = 5):
for _ in range(times): for _ in range(times):
sleep(0.05) sleep(0.05)
x = randint(0, 100) x = randint(0, 100)
@ -4330,7 +4331,7 @@ if __name__ == "__main__":
if cls.resized: if cls.resized:
Draw.now(Term.clear) Draw.now(Term.clear)
else: else:
cls.draw_bg(20) cls.draw_bg(10)
Draw.clear("initbg", "banner", "init", saved=True) Draw.clear("initbg", "banner", "init", saved=True)
if cls.resized: return if cls.resized: return
del cls.initbg_up, cls.initbg_down, cls.initbg_data, cls.initbg_colors del cls.initbg_up, cls.initbg_down, cls.initbg_data, cls.initbg_colors