Update gimp metrics and getters
This commit is contained in:
@@ -7,4 +7,4 @@ from .misc import get_rule, get_accessibility_tree
|
||||
from .replay import get_replay
|
||||
from .vlc import get_vlc_playing_info, get_vlc_config
|
||||
from .vscode import get_vscode_config
|
||||
from .impress import get_audio_in_slide
|
||||
# from .impress import get_audio_in_slide
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import logging
|
||||
import os
|
||||
from typing import Dict
|
||||
|
||||
logger = logging.getLogger("desktopenv.getters.gimp")
|
||||
|
||||
|
||||
def get_gimp_config(env, config: Dict[str, str]):
|
||||
"""
|
||||
Gets the config setting of GIMP.
|
||||
"""
|
||||
|
||||
os_type = env.vm_platform
|
||||
|
||||
if os_type == "Linux":
|
||||
config_path = \
|
||||
env.controller.execute_python_command(f"import os; print("
|
||||
f"os"
|
||||
f".path.expanduser("
|
||||
f"'~/.config/GIMP/2.10/"
|
||||
f"{config['file_name']}'))")[
|
||||
'output'].strip()
|
||||
# TODO: Add support for macOS and Windows
|
||||
else:
|
||||
raise Exception("Unsupported operating system", os_type)
|
||||
|
||||
_path = os.path.join(env.cache_dir, config["dest"])
|
||||
content = env.controller.get_file(config_path)
|
||||
with open(_path, "wb") as f:
|
||||
f.write(content)
|
||||
|
||||
return _path
|
||||
|
||||
Reference in New Issue
Block a user