Fix minor errors in vscode and gimp about path and postconfig
This commit is contained in:
@@ -27,6 +27,11 @@ def get_gimp_config_file(env, config: Dict[str, str]):
|
||||
|
||||
_path = os.path.join(env.cache_dir, config["dest"])
|
||||
content = env.controller.get_file(config_path)
|
||||
|
||||
if not content:
|
||||
logger.error("Failed to get GIMP config file.")
|
||||
return None
|
||||
|
||||
with open(_path, "wb") as f:
|
||||
f.write(content)
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ def check_json_settings(actual: str, expected: str, **options) -> float:
|
||||
Return:
|
||||
float: the score
|
||||
"""
|
||||
if not actual:
|
||||
return 0.
|
||||
|
||||
with open(actual, 'r') as f:
|
||||
data = json.load(f)
|
||||
|
||||
@@ -18,7 +18,10 @@
|
||||
{
|
||||
"type": "launch",
|
||||
"parameters": {
|
||||
"command": ["code", "/home/user/Desktop/vscode_replace_text.txt"]
|
||||
"command": [
|
||||
"code",
|
||||
"/home/user/Desktop/vscode_replace_text.txt"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -33,6 +36,36 @@
|
||||
"vscode"
|
||||
],
|
||||
"evaluator": {
|
||||
"postconfig": [
|
||||
{
|
||||
"type": "activate_window",
|
||||
"parameters": {
|
||||
"window_name": "Visual Studio Code"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "sleep",
|
||||
"parameters": {
|
||||
"seconds": 0.5
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "execute",
|
||||
"parameters": {
|
||||
"command": [
|
||||
"python",
|
||||
"-c",
|
||||
"import pyautogui; pyautogui.hotkey('ctrl', 's');"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "sleep",
|
||||
"parameters": {
|
||||
"seconds": 0.5
|
||||
}
|
||||
}
|
||||
],
|
||||
"func": "compare_text_file",
|
||||
"expected": {
|
||||
"type": "cloud_file",
|
||||
|
||||
Reference in New Issue
Block a user