From 4eb949c6617586ef767635d93bd190944466f4f1 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 15 Feb 2017 12:20:18 +0100 Subject: [PATCH] Removed depricated cpu temp script --- status/linuxcpureader.py | 48 ---------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 status/linuxcpureader.py diff --git a/status/linuxcpureader.py b/status/linuxcpureader.py deleted file mode 100644 index 72943c4..0000000 --- a/status/linuxcpureader.py +++ /dev/null @@ -1,48 +0,0 @@ - -from functools import partial -from os import path - - -class LinuxCpuTemperatureReader(): - files = [ - '/sys/devices/LNXSYSTM:00/LNXTHERM:00/LNXTHERM:01/thermal_zone/temp', - '/sys/bus/acpi/devices/LNXTHERM:00/thermal_zone/temp', - '/proc/acpi/thermal_zone/THM0/temperature', - '/proc/acpi/thermal_zone/THRM/temperature', - '/proc/acpi/thermal_zone/THR1/temperature' - ] - - @classmethod - def get_reader(cls): - readers = { - cls.files[0]: cls.reader1, - cls.files[1]: cls.reader1, - cls.files[2]: cls.reader2, - cls.files[3]: cls.reader2, - cls.files[4]: cls.reader2 - } - for file in cls.files: - if path.exists(file): - reader = readers.get(file) - if reader: - print(reader(file)) - return reader(file) - - @classmethod - def reader1(cls, file): - def reader(file): - temperature = open(file).read().strip() - temperature = int(temperature) // 1000 - return temperature - return partial(reader, file) - - @classmethod - def reader2(cls, file): - def reader(file): - temperature = open(file).read().strip() - temperature = temperature.lstrip('temperature :').rstrip(' C') - return int(temperature) - return partial(reader, file) - - -__all__ = ['LinuxCpuTemperatureReader']