summaryrefslogtreecommitdiff
path: root/py_modules/lsfg_vk/base_service.py
diff options
context:
space:
mode:
authorKurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>2025-10-21 23:54:40 -0400
committerGitHub <noreply@github.com>2025-10-21 23:54:40 -0400
commit7e6d29d9cb731d2648399282be87adb98e183084 (patch)
tree58db3626b3678546e5cb1c4de9bcfc627fde46c7 /py_modules/lsfg_vk/base_service.py
parent7b5f3cb8b3d17ad125d2f40a58fbba80e863d703 (diff)
parent192716ecfd85199f2d5704314eb7873635d190e9 (diff)
downloaddecky-lsfg-vk-7e6d29d9cb731d2648399282be87adb98e183084.tar.gz
decky-lsfg-vk-7e6d29d9cb731d2648399282be87adb98e183084.zip
Merge pull request #190 from xXJSONDeruloXx/cleanup-miscv0.12.1
More cleanup
Diffstat (limited to 'py_modules/lsfg_vk/base_service.py')
-rw-r--r--py_modules/lsfg_vk/base_service.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/py_modules/lsfg_vk/base_service.py b/py_modules/lsfg_vk/base_service.py
index 9c3dec3..262e2b0 100644
--- a/py_modules/lsfg_vk/base_service.py
+++ b/py_modules/lsfg_vk/base_service.py
@@ -12,7 +12,6 @@ import decky
from .constants import LOCAL_LIB, LOCAL_SHARE_BASE, VULKAN_LAYER_DIR, SCRIPT_NAME, CONFIG_DIR, CONFIG_FILENAME
-# Generic type for response dictionaries
ResponseType = TypeVar('ResponseType', bound=Dict[str, Any])
@@ -30,12 +29,11 @@ class BaseService:
else:
self.log = logger
- # Initialize common paths using pathlib
self.user_home = Path.home()
self.local_lib_dir = self.user_home / LOCAL_LIB
self.local_share_dir = self.user_home / VULKAN_LAYER_DIR
self.lsfg_script_path = self.user_home / SCRIPT_NAME
- self.lsfg_launch_script_path = self.user_home / SCRIPT_NAME # ~/lsfg launch script
+ self.lsfg_launch_script_path = self.user_home / SCRIPT_NAME
self.config_dir = self.user_home / CONFIG_DIR
self.config_file_path = self.config_dir / CONFIG_FILENAME
@@ -82,13 +80,11 @@ class BaseService:
OSError: If write fails
"""
try:
- # Write directly to the file
with open(path, 'w', encoding='utf-8') as f:
f.write(content)
- f.flush() # Ensure data is written to disk
- os.fsync(f.fileno()) # Force filesystem sync
+ f.flush()
+ os.fsync(f.fileno())
- # Set permissions
path.chmod(mode)
self.log.info(f"Wrote to {path}")