Files
sci-gui-agent-benchmark/desktop_env/evaluators/metrics/gimp.py

23 lines
959 B
Python

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