switched to python3 and virtualenv

This commit is contained in:
erpalma
2018-04-20 10:46:00 +02:00
parent 1d92edf769
commit 6db2b091f2
6 changed files with 46 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
import ConfigParser
import configparser
import dbus
import glob
import os
@@ -49,8 +49,8 @@ def is_on_battery():
def calc_time_window_vars(t):
for Y in xrange(2**5):
for Z in xrange(2**2):
for Y in range(2**5):
for Z in range(2**2):
if t <= (2**Y) * (1. + Z / 4.) * 0.000977:
return (Y, Z)
raise Exception('Unable to find a good combination!')
@@ -70,7 +70,7 @@ def calc_undervolt_msr(plane, offset):
def load_config():
config = ConfigParser.ConfigParser()
config = configparser.ConfigParser()
config.read(CONFIG_PATH)
for power_source in ('AC', 'BATTERY'):