|
1 | 1 | from PyQt6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QPushButton, QCheckBox, QGridLayout, QComboBox, QDoubleSpinBox, QTabWidget, QSpacerItem, QSizePolicy, QMessageBox, QStackedWidget |
2 | 2 | import json |
3 | 3 | from iobt_options import default_enabled, default_offsets, default_toggles, default_misc, temp_offsets, tooltips_enabled |
4 | | -import psutil |
5 | 4 | import qdarktheme |
6 | 5 | import os |
7 | 6 | import subprocess |
8 | 7 |
|
9 | | - |
10 | 8 | def process_exists(process_name): |
11 | 9 | call = 'TASKLIST', '/FI', 'imagename eq %s' % process_name |
12 | 10 | # use buildin check_output right away |
@@ -35,7 +33,7 @@ def __init__(self): |
35 | 33 |
|
36 | 34 | self.steam = "" |
37 | 35 | 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: |
39 | 37 | self.steam = json.load(file)["config"][0].replace("\\", "/") |
40 | 38 | except Exception as e: |
41 | 39 | dlg2 = QMessageBox() |
@@ -270,7 +268,7 @@ def elbows_only_clicked(self): |
270 | 268 |
|
271 | 269 | def load_settings_clicked(self): |
272 | 270 | 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: |
274 | 272 | current = json.load(file)["driver_VirtualDesktop"] |
275 | 273 |
|
276 | 274 | for variable in default_enabled: |
@@ -374,15 +372,15 @@ def export_clicked(self): |
374 | 372 | () |
375 | 373 |
|
376 | 374 |
|
377 | | - # with open("output.json", "w") as outfile: |
| 375 | + # with open("output.json", "w", encoding="utf-8") as outfile: |
378 | 376 | # json.dump(export_dict, indent=2, fp=outfile) |
379 | 377 |
|
380 | 378 | 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: |
382 | 380 |
|
383 | 381 | temp = json.load(settings) |
384 | 382 | 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: |
386 | 384 | json.dump(temp, fp=backup) |
387 | 385 | backup.close() |
388 | 386 | except: |
|
0 commit comments