Skip to content

Commit 03cd8e9

Browse files
committed
update requirements.txt and file read/write issue on systems with non-english languages
1 parent 115e023 commit 03cd8e9

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

main.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
from PyQt6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QPushButton, QCheckBox, QGridLayout, QComboBox, QDoubleSpinBox, QTabWidget, QSpacerItem, QSizePolicy, QMessageBox, QStackedWidget
22
import json
33
from iobt_options import default_enabled, default_offsets, default_toggles, default_misc, temp_offsets, tooltips_enabled
4-
import psutil
54
import qdarktheme
65
import os
76
import subprocess
87

9-
108
def process_exists(process_name):
119
call = 'TASKLIST', '/FI', 'imagename eq %s' % process_name
1210
# use buildin check_output right away
@@ -35,7 +33,7 @@ def __init__(self):
3533

3634
self.steam = ""
3735
try:
38-
with open(f"{os.getenv('LOCALAPPDATA')}\\openvr\\openvrpaths.vrpath", "r") as file:
36+
with open(f"{os.getenv('LOCALAPPDATA')}\\openvr\\openvrpaths.vrpath", "r", encoding="utf-8") as file:
3937
self.steam = json.load(file)["config"][0].replace("\\", "/")
4038
except Exception as e:
4139
dlg2 = QMessageBox()
@@ -270,7 +268,7 @@ def elbows_only_clicked(self):
270268

271269
def load_settings_clicked(self):
272270
try:
273-
with open(f"{self.steam}/steamvr.vrsettings", "r") as file:
271+
with open(f"{self.steam}/steamvr.vrsettings", "r", encoding="utf-8") as file:
274272
current = json.load(file)["driver_VirtualDesktop"]
275273

276274
for variable in default_enabled:
@@ -374,15 +372,15 @@ def export_clicked(self):
374372
()
375373

376374

377-
# with open("output.json", "w") as outfile:
375+
# with open("output.json", "w", encoding="utf-8") as outfile:
378376
# json.dump(export_dict, indent=2, fp=outfile)
379377

380378
try:
381-
with open(f"{self.steam}/steamvr.vrsettings", "r+") as settings:
379+
with open(f"{self.steam}/steamvr.vrsettings", "r+", encoding="utf-8") as settings:
382380

383381
temp = json.load(settings)
384382
try:
385-
with open(f"{self.steam}/steamvr.vrsettings.originalbackup", "x") as backup:
383+
with open(f"{self.steam}/steamvr.vrsettings.originalbackup", "x", encoding="utf-8") as backup:
386384
json.dump(temp, fp=backup)
387385
backup.close()
388386
except:

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
PyQt6
2-
psutil
32
pyqtdarktheme

0 commit comments

Comments
 (0)