Files
Derek Hirotsu 0c6ee870de Audit Harness utils - second pass (#38)
* add changes to steam utils to harnesses

* replace steam path

* cleanup duplicated functions for removing video files

* Add util func to remove files
2023-09-21 09:25:31 -07:00

28 lines
939 B
Python

"""Atomic Heart utility functions"""
import os
import re
APPDATA = os.getenv("LOCALAPPDATA")
CONFIG_LOCATION = f"{APPDATA}\\AtomicHeart\\Saved\\Config\\WindowsNoEditor"
CONFIG_FILENAME = "GameUserSettings.ini"
PROCESS_NAME = "AtomicHeart"
def read_resolution():
"""Gets resolution width and height values from local file"""
height_pattern = re.compile(r"ResolutionSizeY=(\d+)")
width_pattern = re.compile(r"ResolutionSizeX=(\d+)")
cfg = f"{CONFIG_LOCATION}\\{CONFIG_FILENAME}"
height = 0
width = 0
with open(cfg, encoding="utf-8") as file:
lines = file.readlines()
for line in lines:
height_match = height_pattern.search(line)
width_match = width_pattern.search(line)
if height_match is not None:
height = height_match.group(1)
if width_match is not None:
width = width_match.group(1)
return (height, width)