Exporting has been fixed.
it is also now usable with python 3.7
This commit is contained in:
+72
-72
@@ -1,20 +1,21 @@
|
|||||||
import graphics, time, os, platform, json
|
import graphics, time, os, platform, json
|
||||||
|
|
||||||
System = None
|
System = (None)
|
||||||
PCname = None
|
PCname = (None)
|
||||||
CPUPowerLimit = None
|
CPUPowerLimit = (None)
|
||||||
CPUClock = None
|
CPUClock = (None)
|
||||||
Processor = None
|
Processor = (None)
|
||||||
Gprocessor = None
|
Gprocessor = (None)
|
||||||
GPUpowerLimit = None
|
GPUpowerLimit = (None)
|
||||||
GPUClock = None
|
GPUClock = (None)
|
||||||
GPUMemoryClock = None
|
GPUMemoryClock = (None)
|
||||||
BusClock = None
|
BusClock = (None)
|
||||||
RyzenADJI = None
|
RyzenADJI = (None)
|
||||||
USBdevices = None
|
USBdevices = (None)
|
||||||
TotalUSBpower = None
|
TotalUSBpower = (None)
|
||||||
TotalPower = None
|
TotalPower = (None)
|
||||||
lang = None
|
lang = (None)
|
||||||
|
|
||||||
|
|
||||||
def lang():
|
def lang():
|
||||||
global lang
|
global lang
|
||||||
@@ -198,75 +199,50 @@ def configdisplay():
|
|||||||
errorhandler(error, funchtion)
|
errorhandler(error, funchtion)
|
||||||
|
|
||||||
def export():
|
def export():
|
||||||
try:
|
variables = {
|
||||||
|
'System': System,
|
||||||
|
'PCname': PCname,
|
||||||
|
'CPUPowerLimit': CPUPowerLimit,
|
||||||
|
'CPUClock': CPUClock,
|
||||||
|
'Processor': Processor,
|
||||||
|
'Gprocessor': Gprocessor,
|
||||||
|
'GPUpowerLimit': GPUpowerLimit,
|
||||||
|
'GPUClock': GPUClock,
|
||||||
|
'GPUMemoryClock': GPUMemoryClock,
|
||||||
|
'BusClock': BusClock,
|
||||||
|
'RyzenADJI': RyzenADJI,
|
||||||
|
'USBdevices': USBdevices,
|
||||||
|
'TotalUSBpower': TotalUSBpower,
|
||||||
|
'TotalPower': TotalPower,
|
||||||
|
}
|
||||||
if lang == "1":
|
if lang == "1":
|
||||||
with open("Configuationtable.json", "r") as file:
|
with open("Configuationtable.json", "r") as file:
|
||||||
data = json.loads(file.read())
|
data = json.loads(file.read())
|
||||||
with open("config_data.txt", "w") as file:
|
with open("config_data.txt", "w") as file:
|
||||||
file.write("="*5 + " last Saved Configuation/System Information " + "="*5 + "\n")
|
file.write("="*5 + " last Saved Configuation/System Information " + "="*5 + "\n")
|
||||||
file.write(" System: " + data["System"] + "\n")
|
for key, value in variables.items():
|
||||||
file.write(" PC Name: " + data["PCname"] + "\n")
|
file.write(f'{key} = {value}\n')
|
||||||
file.write("\n Processor: " + data["Processor"] + "\n")
|
|
||||||
file.write(" Processor Power Limit: " + data["CPUPowerLimit"] + "W" + "\n")
|
print("Data exported to config")
|
||||||
file.write(" Processor clock: " + str(data["CPUClock"]) + "Ghz" + "\n")
|
input("Press enter to continue")
|
||||||
file.write(" Bus clock: " + str(data["BusClock"]) + "Mhz" + "\n")
|
|
||||||
file.write("\n GPU: " + data["Gprocessor"] + "\n")
|
|
||||||
file.write(" GPU Power Limit: " + str(data["GPUpowerLimit"]) + "W" + "\n")
|
|
||||||
file.write(" GPU Clock: " + str(data["GPUClock"]) + "Mhz" + "\n")
|
|
||||||
file.write(" GPU Memory clock: " + str(data["GPUMemoryclock"]) + "Mhz" + "\n")
|
|
||||||
file.write("\n Ryzen ADJI: " + data["RyzenADJI"] + "\n")
|
|
||||||
file.write("\n Static USB devices: " + str(data["USBdevices"]) + "\n")
|
|
||||||
file.write(" Total USB power: " + str(data["TotalUSBPower"]) + "W" + "\n")
|
|
||||||
file.write(" Total Power: " + str(data["TotalPower"]) + "W" + "\n")
|
|
||||||
file.write(graphics.rever)
|
|
||||||
print(" Data exported to config")
|
|
||||||
input(" Press enter to continue")
|
|
||||||
Menu()
|
Menu()
|
||||||
elif lang == "2":
|
elif lang == "2":
|
||||||
with open("Configuationtable.json", "r") as file:
|
with open("Configuationtable.json", "r") as file:
|
||||||
data = json.loads(file.read())
|
data = json.loads(file.read())
|
||||||
with open("config_data.txt", "w") as file:
|
with open("config_data.txt", "w") as file:
|
||||||
file.write("="*5 + "zuletzt gespeicherte Konfigurations-/Systeminformatione" + "="* + "\n")
|
for key, value in variables.items():
|
||||||
file.write(" System: " + data["System"] + "\n")
|
file.write(f'{key} = {value}\n')
|
||||||
file.write(" PC Name: " + data["PCname"] + "\n")
|
|
||||||
file.write("\n Proezsor: " + data["Processor"] + "\n")
|
print("Daten exportiert nach config")
|
||||||
file.write(" Prozessorleistungsgrenze: " + float(data["CPUPowerLimit"] + "W" + "\n"))
|
input("Drücken Sie die Eingabetaste, um fortzufahren")
|
||||||
file.write(" Prozessoruhr: " + str(data["CPUClock"]) + "Ghz" + "\n")
|
|
||||||
file.write(" Busuhr: " + str(data["BusClock"]) + "Mhz" + "\n")
|
|
||||||
file.write("\n GPU: " + data["Gprocessor"] + "\n")
|
|
||||||
file.write(" GPU-Leistungsbegrenzung: " + str(data["GPUpowerLimit"]) + "W" + "\n")
|
|
||||||
file.write(" GPU-Takt: " + str(data["GPUClock"]) + "Mhz" + "\n")
|
|
||||||
file.write(" GPU-Speichertakt: " + str(data["GPUMemoryclock"]) + "Mhz" + "\n")
|
|
||||||
file.write("\n Ryzen ADJI: " + data["RyzenADJI"] + "\n")
|
|
||||||
file.write("\n Statische USB-Geräte: " + str(data["USBdevices"]) + "\n")
|
|
||||||
file.write(" Totale USB-Leistung: " + str(data["TotalUSBPower"]) + "W" + "\n")
|
|
||||||
file.write(" Totale Kraft: " + str(data["TotalPower"]) + "W" + "\n")
|
|
||||||
file.write(graphics.rever)
|
|
||||||
print(" Daten exportiert nach config")
|
|
||||||
input(" Drücken Sie die Eingabetaste, um fortzufahren")
|
|
||||||
Menu()
|
Menu()
|
||||||
else:
|
else:
|
||||||
error = ('1')
|
error = '1'
|
||||||
funchtion = ('6')
|
function = '6'
|
||||||
errorhandler(error, funchtion)
|
errorhandler(error, function)
|
||||||
except:
|
|
||||||
error = 2
|
|
||||||
funchtion = 3
|
|
||||||
errorhandler(error, funchtion)
|
|
||||||
|
|
||||||
def errorhandler(error, funchtion):
|
def errorhandler(error, funchtion):
|
||||||
if error == "1":
|
|
||||||
print(" A language baised error has occured \n Ein sprachbasierter Fehler ist aufgetreten")
|
|
||||||
time.sleep(1.5987654321)
|
|
||||||
lang()
|
|
||||||
funchtionhandler(funchtion)
|
|
||||||
elif error == "2":
|
|
||||||
if lang == 1:
|
|
||||||
print("read and/or write error occured, please try again or wait for next patch")
|
|
||||||
time.sleep(1.5987654321)
|
|
||||||
funchtionhandler(funchtion)
|
|
||||||
|
|
||||||
def funchtionhandler(task):
|
|
||||||
options = {
|
options = {
|
||||||
'1': start,
|
'1': start,
|
||||||
'2': load,
|
'2': load,
|
||||||
@@ -279,8 +255,32 @@ def funchtionhandler(task):
|
|||||||
'9': load,
|
'9': load,
|
||||||
'10': exit,
|
'10': exit,
|
||||||
}
|
}
|
||||||
if task in options:
|
if error == "1":
|
||||||
options[task]()
|
print(" A language baised error has occured \n Ein sprachbasierter Fehler ist aufgetreten")
|
||||||
|
time.sleep(1.5987654321)
|
||||||
|
lang()
|
||||||
|
funchtionhandler(funchtion)
|
||||||
|
elif error == "2":
|
||||||
|
if lang == 1:
|
||||||
|
print("read and/or write error occured, please try again or wait for next patch")
|
||||||
|
time.sleep(1.5987654321)
|
||||||
|
funchtionhandler(funchtion)
|
||||||
|
|
||||||
|
def funchtionhandler(funchtion):
|
||||||
|
options = {
|
||||||
|
'1': start,
|
||||||
|
'2': load,
|
||||||
|
'3': Menu,
|
||||||
|
'4': editor,
|
||||||
|
'5': configdisplay,
|
||||||
|
'6': export,
|
||||||
|
'7': existstage1,
|
||||||
|
'8': existstage1,
|
||||||
|
'9': load,
|
||||||
|
'10': exit,
|
||||||
|
}
|
||||||
|
if funchtion in options:
|
||||||
|
options[funchtion]()
|
||||||
|
|
||||||
|
|
||||||
def existstage1():
|
def existstage1():
|
||||||
|
|||||||
Reference in New Issue
Block a user