mirror of
https://github.com/LTTLabsOSS/markbench-tests.git
synced 2026-01-08 21:48:00 -05:00
* add changes to steam utils to harnesses * replace steam path * cleanup duplicated functions for removing video files * Add util func to remove files
28 lines
939 B
Python
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)
|