def write_endpoint(self, endpoint, data): try: with open(self._endpoints[endpoint], 'w') as e: return e.write(str(data)) except PermissionError: logger.error('Failed writing to devfs file, are you sure your running as root?') sys.exit(1)
def __init__(self, config): self._scanner = Scanner(config.get('cards')) if len(self._scanner.cards) < 1: logger.error('no compatible cards found, exiting') sys.exit(1) self.curve = Curve(config.get('speed_matrix')) self._frequency = 1
def __init__(self, config): self._scanner = Scanner(config.get('cards')) if len(self._scanner.cards) < 1: logger.error('no compatible cards found, exiting') sys.exit(1) speed_matrix = config.get('speed_matrix') self.temp_drop = config.get('temp_drop', 5) self.curve = Curve(speed_matrix) self._frequency = 1 self._interval = 1 / self._frequency