Initialize VLC getters and metrics, fix some bugs in infra logic, needs to be refactored later on

This commit is contained in:
Timothyxxx
2024-01-04 17:55:07 +08:00
parent ca73a96da5
commit 2401513c19
3 changed files with 58 additions and 19 deletions

View File

@@ -0,0 +1,22 @@
import os
def get_gimp_export_path():
# Path to GIMP's configuration file. This example assumes GIMP version 2.10.
# You need to adjust the path according to the GIMP version and user's file system.
gimp_config_file = os.path.expanduser("~/.config/GIMP/2.10/gimprc")
try:
# Open and read the configuration file
with open(gimp_config_file, 'r') as file:
for line in file:
# Search for the default export path setting
if "default-export-path" in line:
# Extract the current path from the line (assuming it's enclosed in quotes)
current_path = line.split('"')[1]
# Compare the current path with the expected path
return current_path
except FileNotFoundError:
# Handle the case where the configuration file is not found
print("GIMP configuration file not found")
return False