diff --git a/desktop_env/evaluators/metrics/__init__.py b/desktop_env/evaluators/metrics/__init__.py index 73090bc..69d65c5 100644 --- a/desktop_env/evaluators/metrics/__init__.py +++ b/desktop_env/evaluators/metrics/__init__.py @@ -1,2 +1,3 @@ -from .table import compare_table, compare_with_sparklines, compare_with_charts -from .table import check_sheet_list, check_xlsx_freeze +from .table import compare_table +from .table import check_sheet_list, check_xlsx_freeze, check_zoom +from .docs import find_default_font, contains_page_break, compare_docx_files diff --git a/desktop_env/evaluators/metrics/docs.py b/desktop_env/evaluators/metrics/docs.py new file mode 100644 index 0000000..6953dd8 --- /dev/null +++ b/desktop_env/evaluators/metrics/docs.py @@ -0,0 +1,65 @@ +import xml.etree.ElementTree as ET + +from docx import Document + +def find_default_font(expected, config_file_path): + """Find the default font in LibreOffice Writer.""" + default_font = None + try: + tree = ET.parse(config_file_path) + root = tree.getroot() + + # Define the XML namespace used in the file + namespace = {'oor': 'http://openoffice.org/2001/registry'} + + # Search for the node containing the default font setting for LibreOffice Writer + for elem in root.findall('.//item[@oor:path="/org.openoffice.Office.Writer/DefaultFont"]', namespace): + for prop in elem.findall('.//prop[@oor:name="Standard"]', namespace): + for value in prop.findall('value', namespace): + default_font = value.text + except Exception as e: + print(f"Error: {e}") + return 1 if default_font == expected else 0 + + +def contains_page_break(docx_file): + doc = Document(docx_file) + + namespaces = {'w': 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'} + + for paragraph in doc.paragraphs: + for run in paragraph.runs: + br_elems = run.element.findall('.//w:br', namespaces) + for br in br_elems: + if br is not None and '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}type' in br.attrib and br.attrib['{http://schemas.openxmlformats.org/wordprocessingml/2006/main}type'] == 'page': + return 1 + return 0 + +def compare_docx_files(file1, file2): + + doc1 = Document(file1) + doc2 = Document(file2) + + doc1_paragraphs = [p.text for p in doc1.paragraphs] + doc2_paragraphs = [p.text for p in doc2.paragraphs] + + if len(doc1_paragraphs) != len(doc2_paragraphs): + return 0 + + # Compare each paragraph + for p1, p2 in zip(doc1_paragraphs, doc2_paragraphs): + if p1 != p2: + return 0 + + return 1 + +# file1 = 'path/to/file1.docx' +# file2 = 'path/to/file2.docx' + +# print(are_docx_files_same(file1, file2)) +# Replace 'your_document.docx' with the path to your document +# result = contains_page_break('your_document.docx') +# print(result) + +#config_path = "/home/[username]/.config/libreoffice/4/user/registrymodifications.xcu" +#print(find_default_font("Ani", config_path)) \ No newline at end of file diff --git a/desktop_env/evaluators/metrics/table.py b/desktop_env/evaluators/metrics/table.py index 4591b82..f1a3eda 100644 --- a/desktop_env/evaluators/metrics/table.py +++ b/desktop_env/evaluators/metrics/table.py @@ -1,56 +1,72 @@ import pandas as pd import openpyxl +from openpyxl import Workbook from openpyxl.worksheet.worksheet import Worksheet from .utils import load_charts, load_sparklines +import operator from typing import Dict, List -from typing import Any +from typing import Any, Union +from numbers import Number -def compare_table(actual, expected): - df1 = pd.read_excel(expected) - df2 = pd.read_excel(actual) - - # Compare the DataFrames - return 1 if df1.equals(df2) else 0 - - -def compare_with_sparklines(actual: str, expected: str) -> float: - df1 = pd.read_excel(actual) - df2 = pd.read_excel(expected) - normal_content_metric: bool = df1.equals(df2) - print("Normal Contents Metric: {:}".format(normal_content_metric)) - - sp1 = load_sparklines(actual) - sp2 = load_sparklines(expected) - sparkline_metric: bool = sp1 == sp2 - print("Sparkline Metric: {:}".format(sparkline_metric)) - - return float(normal_content_metric and sparkline_metric) - - -def compare_with_charts(actual: str, expected: str, **options) -> float: +def compare_table(actual: str, expected: str, **options) -> float: """ Args: actual (str): path to result xlsx expected (str): path to gold xlsx - options (Dict[str, List[str]]): dict like {"chart_props": list of str} - giving the concerned chart properties + options (Dict[str, List[str]]): dict like + { + "features": list of str for other features, supports: + * sparkline + * chart + * number_format + "chart_props": list of str, giving the converned chart properties + } + + Return: + float: the score """ - df1 = pd.read_excel(actual) - df2 = pd.read_excel(expected) - normal_content_metric: bool = df1.equals(df2) - print("Normal Contents Metric: {:}".format(normal_content_metric)) + df1 = pd.read_excel(expected) + df2 = pd.read_excel(actual) + metric: bool = df1.equals(df2) + print("Normal Contents Metric: {:}".format(metric)) - charts1 = load_charts(actual, **options) - charts2 = load_charts(expected, **options) - chart_metric: bool = charts1 == charts2 - print("Chart Metric: {:}".format(chart_metric)) + features: List[str] = options.get("features", []) + for ftr in features: + workbook1: Workbook = openpyxl.load_workbook(actual) + workbook2: Workbook = openpyxl.load_workbook(expected) - return float(normal_content_metric and chart_metric) + if ftr=="sparkline": + sp1 = load_sparklines(actual) + sp2 = load_sparklines(expected) + new_metric: bool = sp1 == sp2 + print("Sparkline Metric: {:}".format(new_metric)) + elif ftr=="chart": + charts1 = load_charts(workbook1, **options) + charts2 = load_charts(workbook2, **options) + new_metric: bool = charts1 == charts2 + print("Chart Metric: {:}".format(new_metric)) + elif ftr=="number_format": + number_formats1: List[str] = [ c.number_format.lower()\ + for col in workbook1.active.iter_cols()\ + for c in col\ + if c.data_type=="n" + ] + number_formats2: List[str] = [ c.number_format.lower()\ + for col in workbook2.active.iter_cols()\ + for c in col\ + if c.data_type=="n" + ] + new_metric: bool = number_formats1==number_formats2 + print("Number Format Metric: {:}".format(new_metric)) + else: + raise NotImplementedError("Unsupported xlsx feature: {:}".format(ftr)) + metric = metric and new_metric + return float(metric) def check_sheet_list(result: str, rules: List[Dict[str, Any]]) -> float: # workbook: Workbook = openpyxl.load_workbook(filename=result) @@ -90,11 +106,17 @@ def check_sheet_list(result: str, rules: List[Dict[str, Any]]) -> float: return float(passes) - def check_xlsx_freeze(result: str, rules: Dict[str, str]) -> float: worksheet: Worksheet = openpyxl.load_workbook(filename=result).active return float(worksheet.freeze_panes == rules["position"]) +def check_zoom(result: str, rules: Dict[str, Union[str, Number]]) -> float: + worksheet = openpyxl.load_workbook(filename=result).active + zoom_scale: Number = worksheet.sheet_view.zoomScale or 100. + return float( getattr(operator, rules["relation"])( zoom_scale + , rules["ref_value"] + ) + ) if __name__ == '__main__': # path1 = "" @@ -132,6 +154,38 @@ if __name__ == '__main__': # ] # print(check_sheet_list(path1, rule)) - path1 = "../../../../../任务数据/LibreOffice Calc/Create_column_charts_using_statistics_gold.xlsx" - path2 = "../../../../../任务数据/LibreOffice Calc/Create_column_charts_using_statistics_gold2.xlsx" - print(compare_with_charts(path1, path2, chart_props=["type", "direction"])) + #path1 = "../../任务数据/LibreOffice Calc/Create_column_charts_using_statistics_gold.xlsx" + #path2 = "../../任务数据/LibreOffice Calc/Create_column_charts_using_statistics_gold2.xlsx" + #print(compare_table(path1, path2, features=["chart"], chart_props=["type", "direction"])) + + #path1 = "../../任务数据/LibreOffice Calc/Represent_in_millions_billions_gold.xlsx" + #path2 = "../../任务数据/LibreOffice Calc/Represent_in_millions_billions_gold3.xlsx" + #workbook1: Workbook = openpyxl.load_workbook(filename=path1) + #worksheet1: Worksheet = workbook1.active +# + #import itertools + #for col, r in itertools.product( ['A', 'B', 'C'] + #, range(1, 9) + #): + #position: str = "{:}{:d}".format(col, r) + #print(worksheet1[position]) + #print(worksheet1[position].value) + #print(worksheet1[position].number_format) + #print(compare_table(path1, path2, features=["number_format"])) + + path1 = "../../任务数据/LibreOffice Calc/Zoom_Out_Oversized_Cells_gold.xlsx" + path2 = "../../任务数据/LibreOffice Calc/Zoom_Out_Oversized_Cells.xlsx" + #workbook1: Workbook = openpyxl.load_workbook(filename=path1) + #worksheet1: Worksheet = workbook1.active + #print(worksheet1.sheet_view.zoomScale) + #print(type(worksheet1.sheet_view.zoomScale)) +# + #import os + #import os.path + #for wb in filter( lambda f: f.endswith(".xlsx") + #, os.listdir("../../任务数据/LibreOffice Calc/") + #): + #path = os.path.join("../../任务数据/LibreOffice Calc/", wb) + #print(wb, openpyxl.load_workbook(filename=path).active.sheet_view.zoomScale) + print(check_zoom(path1, {"relation": "lt", "ref_value": 100})) + print(check_zoom(path2, {"relation": "lt", "ref_value": 100})) diff --git a/desktop_env/evaluators/metrics/utils.py b/desktop_env/evaluators/metrics/utils.py index 65db158..b826d87 100644 --- a/desktop_env/evaluators/metrics/utils.py +++ b/desktop_env/evaluators/metrics/utils.py @@ -56,10 +56,10 @@ def load_sparklines(xlsx_file: str) -> Dict[str, str]: # type: "scatterChart" | "lineChart" | "barChart" # direction: "bar" (hori) | "col" (vert) # xtitle, ytitle, ztitle: str -def load_charts(xlsx_file: str, **options) -> Dict[str, Any]: +def load_charts(xlsx_file: Workbook, **options) -> Dict[str, Any]: """ Args: - xlsx_file (str): path to xlsx + xlsx_file (Workbook): concerned excel book options (Dict[str, List[str]]): dict like {"chart_props": list of str} giving the concerned chart properties @@ -67,8 +67,8 @@ def load_charts(xlsx_file: str, **options) -> Dict[str, Any]: Dict[str, Any]: information of charts """ - workbook: Workbook = openpyxl.load_workbook(filename=xlsx_file) - worksheet: Worksheet = workbook.active + #workbook: Workbook = openpyxl.load_workbook(filename=xlsx_file) + worksheet: Worksheet = xlsx_file.active charts: List[ChartBase] = worksheet._charts chart_set: Dict[str, Any] = {} diff --git a/evaluation_examples/examples/libreoffice_calc/1334ca3e-f9e3-4db8-9ca7-b4c653be7d17.json b/evaluation_examples/examples/libreoffice_calc/1334ca3e-f9e3-4db8-9ca7-b4c653be7d17.json new file mode 100644 index 0000000..aa131f6 --- /dev/null +++ b/evaluation_examples/examples/libreoffice_calc/1334ca3e-f9e3-4db8-9ca7-b4c653be7d17.json @@ -0,0 +1,44 @@ +{ + "id": "1334ca3e-f9e3-4db8-9ca7-b4c653be7d17", + "snapshot": "libreoffice_calc", + "instruction": "The cells are so big that I can not click on the cell I want, zoom out a little bit.", + "source": "https://techcommunity.microsoft.com/t5/excel/excel-workbook-top-way-too-big-can-t-see-rows-and-columns/m-p/4014694", + "config": [ + { + "type": "download", + "parameters": { + "file": [ + { + "url": "https://drive.usercontent.google.com/download?id=1Wkepf_vic9o7CZFiosZ4jZT_Hy2WbRPZ&export=download&authuser=0&confirm=t&uuid=bc2ce901-a6bb-433f-bcce-cbe42d813f18&at=APZUnTVQcGTcXjwqenmtSH6IMFkM:1703858853235", + "path": "Desktop/Zoom_Out_Oversized_Cells.xlsx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "Desktop/Zoom_Out_Oversized_Cells.xlsx" + } + } + ], + "trajectory": "trajectories/1334ca3e-f9e3-4db8-9ca7-b4c653be7d17", + "related_apps": [ + "libreoffice_calc" + ], + "evaluator": { + "func": "check_zoom", + "result": { + "type": "vm_file", + "path": "Desktop/Zoom_Out_Oversized_Cells.xlsx", + "dest": "Zoom_Out_Oversized_Cells.xlsx" + }, + "expected": { + "type": "rule", + "rules": { + "relation": "lt", + "ref_value": 260 + } + } + } +} diff --git a/evaluation_examples/examples/libreoffice_calc/21df9241-f8d7-4509-b7f1-37e501a823f7.json b/evaluation_examples/examples/libreoffice_calc/21df9241-f8d7-4509-b7f1-37e501a823f7.json new file mode 100644 index 0000000..a54a774 --- /dev/null +++ b/evaluation_examples/examples/libreoffice_calc/21df9241-f8d7-4509-b7f1-37e501a823f7.json @@ -0,0 +1,47 @@ +{ + "id": "21df9241-f8d7-4509-b7f1-37e501a823f7", + "snapshot": "libreoffice_calc", + "instruction": "Change the representation of colum \"Parameter\" and show in Millions (M) and Billions (B). Keep one decimal and place a white space between the digits and the unit.", + "source": "https://www.youtube.com/watch?v=p5C4V_AO1UU", + "config": [ + { + "type": "download", + "parameters": { + "file": [ + { + "url": "https://drive.usercontent.google.com/download?id=16PowrQA4E71xUoJmpXPHy0dr9HBcTRmo&export=download&authuser=0&confirm=t&uuid=9a6265f7-585c-4cf8-b321-3b859aec1e68&at=APZUnTWzzOw85wws0ojXNPsIwnjE:1703858126178", + "path": "Desktop/Represent_in_millions_billions.xlsx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "Desktop/Represent_in_millions_billions.xlsx" + } + } + ], + "trajectory": "trajectories/21df9241-f8d7-4509-b7f1-37e501a823f7", + "related_apps": [ + "libreoffice_calc" + ], + "evaluator": { + "func": "compare_table", + "result": { + "type": "vm_file", + "path": "Desktop/Represent_in_millions_billions.xlsx", + "dest": "Represent_in_millions_billions.xlsx" + }, + "expected": { + "type": "cloud_file", + "path": "https://drive.usercontent.google.com/download?id=1Jy6lZexhU5t0eW1GwXJ_csnwIe0Xiy9-&export=download&authuser=0&confirm=t&uuid=601701e7-9eb8-4ce8-83d5-35916094a15d&at=APZUnTW4WE-plIC5MmWTuFu24qLL:1703857882995", + "dest": "Represent_in_millions_billions_gold.xlsx" + }, + "options": { + "features": [ + "number_format" + ] + } + } +} diff --git a/evaluation_examples/examples/libreoffice_calc/2bd59342-0664-4ccb-ba87-79379096cc08.json b/evaluation_examples/examples/libreoffice_calc/2bd59342-0664-4ccb-ba87-79379096cc08.json index 4a211a2..f0b143f 100644 --- a/evaluation_examples/examples/libreoffice_calc/2bd59342-0664-4ccb-ba87-79379096cc08.json +++ b/evaluation_examples/examples/libreoffice_calc/2bd59342-0664-4ccb-ba87-79379096cc08.json @@ -19,14 +19,15 @@ "type": "open", "parameters": { "path": "Desktop/OrderId_Month_Chart.xlsx" - ] - }, + } + } + ], "trajectory": "trajectories/2bd59342-0664-4ccb-ba87-79379096cc08", "related_apps": [ "libreoffice calc" ], "evaluator": { - "func": "compare_with_sparklines", + "func": "compare_table", "expected": { "type": "cloud_file", "path": "https://drive.usercontent.google.com/download?id=1KQJJLVPGtTL_7ArEWvwwbFbJSiA3cgSE&export=download&authuser=0&confirm=t&uuid=6b11c721-caad-439a-b369-4c13c7a485df&at=APZUnTV5-1isKrDKSHV9NeJ6TDeS:1703509054094", @@ -36,6 +37,10 @@ "type": "vm_file", "path": "Desktop/OrderId_Month_Chart.xlsx", "dest": "OrderId_Month_Chart.xlsx" - } + }, + "options": { + "features": [ + "sparkline" + ] } } diff --git a/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json b/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json index 38f853b..d359ca2 100644 --- a/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json +++ b/evaluation_examples/examples/libreoffice_calc/347ef137-7eeb-4c80-a3bb-0951f26a8aff.json @@ -27,7 +27,7 @@ "libreoffice_calc" ], "evaluator": { - "func": "compare_with_charts", + "func": "compare_table", "result": { "type": "vm_file", "path": "Desktop/Create_column_charts_using_statistics.xlsx", @@ -39,6 +39,9 @@ "dest": "Create_column_charts_using_statistics_gold.xlsx" }, "options": { + "features": [ + "chart" + ], "chart_props": [ "type", "direction" diff --git a/evaluation_examples/examples/libreoffice_calc/f9584479-3d0d-4c79-affa-9ad7afdd8850.json b/evaluation_examples/examples/libreoffice_calc/f9584479-3d0d-4c79-affa-9ad7afdd8850.json index 6a2094e..a9cae16 100644 --- a/evaluation_examples/examples/libreoffice_calc/f9584479-3d0d-4c79-affa-9ad7afdd8850.json +++ b/evaluation_examples/examples/libreoffice_calc/f9584479-3d0d-4c79-affa-9ad7afdd8850.json @@ -21,13 +21,13 @@ "path": "Desktop/Quarterly_Product_Sales_by_Zone.xlsx" } } - ], - "trajectory": "trajectories/f9584479-3d0d-4c79-affa-9ad7afdd8850", - "related_apps": [ - "libreoffice calc" - ], - "evaluator": { - "func": "compare_table", + ], + "trajectory": "trajectories/f9584479-3d0d-4c79-affa-9ad7afdd8850", + "related_apps": [ + "libreoffice calc" + ], + "evaluator": { + "func": "compare_table", "expected": { "type": "cloud_file", "path": "https://drive.usercontent.google.com/download?id=17f1wZuJPvUEc5at_Fy3c18VFdOk0x7xz&export=download&authuser=0&confirm=t&uuid=6d2edffd-0ce0-426e-9820-8af25b4667f3&at=APZUnTVh7JS85dwZBaV2hytWQgDK:1702361510956", @@ -38,5 +38,5 @@ "path": "Desktop/Quarterly_Product_Sales_by_Zone.xlsx", "dest": "Quarterly_Product_Sales_by_Zone.xlsx" } - } + } } diff --git a/evaluation_examples/examples/libreoffice_writer/adf5e2c3-64c7-4644-b7b6-d2f0167927e7.json b/evaluation_examples/examples/libreoffice_writer/adf5e2c3-64c7-4644-b7b6-d2f0167927e7.json index a3bb270..8cd9da2 100644 --- a/evaluation_examples/examples/libreoffice_writer/adf5e2c3-64c7-4644-b7b6-d2f0167927e7.json +++ b/evaluation_examples/examples/libreoffice_writer/adf5e2c3-64c7-4644-b7b6-d2f0167927e7.json @@ -3,10 +3,40 @@ "snapshot": "libreoffice_writer", "instruction": "Helping me adding CITATION_TEXT to my reference list, and add a cross reference after the word \"WHERE_WE_ADD_REFERENCE\"", "source": "https://seekstar.github.io/2022/04/11/libreoffice%E5%BC%95%E7%94%A8%E6%96%87%E7%8C%AE/", - "config": [], + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.google.com/uc?export=download&id=1boNZ3JuqUx2apMqExL3UX9A4Sopi77ke7yKnIO3cpbg", + "path": "Desktop/Add_Citation_Cross_Reference.docx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "Desktop/Add_Citation_Cross_Reference.docx" + } + } + ], "trajectory": "trajectories/", "related_apps": [ "libreoffice_writer" ], - "evaluator": "evaluation_dir" -} + "evaluator": { + "func": "compare_docx_files", + "expected": { + "type": "cloud_file", + "path": "https://doc-14-20-docstext.googleusercontent.com/export/hglu5spf1pl3kjo47q5hl516lk/erhjsu6vpod00o7ruf95hlnqkk/1703931360000/108888117743638485671/108888117743638485671/1tiN6A9-zQ2gfDPTWAYK5mv5JbUe2Y_PqPIyuvsu7PgA?format=docx&dat=AOBvIb1uRgycIK4pNup7ZrnJqwNjYOgTUlrhxAc8DnBWzUt9zDxLm3e4s0KQytzQ1qvFZaBr8-ymrVv7Mmb7ovpVk4k8sgS_2MRD1m-tMUDiUEGFtoxrECd4Xoaspuwb-BZttyU1cCdY3U12qcNWy5Cts_uys6ouKZok01Z7s1J233udfrMbXvDt_X-HeNo_7e6Bh64ZC4ohHOKZddsuayKYxPTKpgnho_8FPuWXqZDKyfYRDoTXxGWv-WrZSVqRSHP6GMtBdWc1-QBuWzH_iRTM64joeveSDppMjMeB5bjdJQ7EXf-EjA8MjSxtvQQGBmun7PoZ-W7fLmQ1E3fZKJ5BwQDOIJHDCBar83iHHoXOUJ1Q5UbkKcCS0nJ_pprCzRYXLSeVfN0_bdGuY2lSE8GhX-yGlyGIjAIZK-YulOFXwV0--4aD10rh43A5GLmSLeNZe6maUU33j1V-zUtp1qPgRk3SnPJENNOXf-sOYAvQqSgROSBvAwElqgHUMD_ROK692M7_7OtFe4sjs0eVnBzROEHy-ZznXqdSXJj6-2vloXHWfswPfE-Mq5kc7F1zX4CY6H1kQ-zgHzeLX-qQA6YmgZPJ0pLzFkAkBiMAjPigA_2dy7jk-niePSbZ9DcgYoX6iv6MkJ0y6JE_HQF7Gr6kDBiOjOyDp7gFoMj35F41Fac1wpSJmoiUEGLg0qGRBZ6BPc54m-AAFuy-2s4BUUtPgk-FlTD1jSpHDXLbJ-VQFglx1CYpfqFAnmIE8yseQPh3GqQYyCtCfD-zzO-CRTT9A-XOQVuH27npfk2gMDKtGwJr7XhNL8lL9b8540uTjt9nFnmNfDZCFK01VULdHZesSBedqM4iApgVVnjok8nmYw14e9WSgJOdjeiYAwI", + "dest": "Add_Citation_Cross_Reference_Gold.docx" + }, + "result": { + "type": "vm_file", + "path": "Desktop/Add_Citation_Cross_Reference.xlsx", + "dest": "Add_Citation_Cross_Reference.xlsx" + } + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_writer/e528b65e-1107-4b8c-8988-490e4fece599.json b/evaluation_examples/examples/libreoffice_writer/e528b65e-1107-4b8c-8988-490e4fece599.json index e7576ab..7c3656e 100644 --- a/evaluation_examples/examples/libreoffice_writer/e528b65e-1107-4b8c-8988-490e4fece599.json +++ b/evaluation_examples/examples/libreoffice_writer/e528b65e-1107-4b8c-8988-490e4fece599.json @@ -3,10 +3,40 @@ "snapshot": "libreoffice_writer", "instruction": "Capitalize the first letter of all words.", "source": "https://www.youtube.com/watch?v=l25Evu4ohKg", - "config": [], + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://doc-08-20-docstext.googleusercontent.com/export/hglu5spf1pl3kjo47q5hl516lk/50aih0mm4k09m25qfa3qrhiuk4/1703929965000/108888117743638485671/108888117743638485671/1NcJF7vVondy_r7toxlB9hLPAZa_SE2J8Q8jwMXS8VUA?format=docx&dat=AOBvIb2I6t_SHXA1k8jP6BwfHmYlD9vYHbrSA2-mYotTRWVDp45o4YRrwJXoy21qBnq92d646pP7IQH6-gXTi7oDIcGqD0iYR6CLD1s2PyYX2F8wQ703_cw61GoVYGf8BoorXDY6Y44dfXY0j2RigWDdbimS1rSLUy3TGEmTl8jZq71zrNUKiS25zCsfuXONsexH0tGI1d8LfnVKrFLCQvIlrVF7lV9lgi4lJhuUwIIKF1JdziNoNBohbCuhv-h4iGPRyoFxC4hZAOVJEHy1wIvBA64rNsw1N_nplLxx42I7MC9-3F24Lkxi3xfJ81nEYSx8ma5D9V_AHLLRLmIrpPKYk1s47qPQxbSGrcO1362WJeMxb8lys71APnPwfWbodnxZLdJR2x2WfdYiQWpZGRzBf3-CeQmORrMQDSwWOHsEGMiCw8qTKevzhY1s4aZWBxpQO7ocCoL1gLOxxEvj4eSLvxp2S1u_dFjjr-dcMxt9-Xu210BGd-1Q6kUYzexRuI6I1vkWxDFn7GHgkVf-RhbMT52W_FFOo2Um4rXIfV62W5_nZrmJjz6KNOGdAbIJdkmTrS_lESb6GDmkOFwNarmTlZVOCDN-On7HGaYF1KvX0hobR0559-wKetJj2diqCDOlDXFemtkzvX-CDCRBnDmQxq1ZaQEsjAHhu7sE9jlZT0ywUHV3VpKBcepolqaCRAhX0gCf1cSht7LDHODeX9Hbn3tz810aYlETCJQo9QScbN87i4IV3qFbezwymMi0ZDLgWW0BtEa1gFMY89om6YGscnCHUHGCGy_GW2XscOiQq3rJngCmuu4Ivfta_7GB0e9NeflOIO3wlCpTlw6aQVh9sIB0MMTpDaZ6V1SXSnPInj15tLbCiAPXzNxfg-8", + "path": "Desktop/Capitalize_First_Letter.docx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "Desktop/Capitalize_First_Letter.docx" + } + } + ], "trajectory": "trajectories/", "related_apps": [ "libreoffice_writer" ], - "evaluator": "evaluation_dir" -} + "evaluator": { + "func": "compare_docx_files", + "expected": { + "type": "cloud_file", + "path": "https://doc-10-20-docstext.googleusercontent.com/export/hglu5spf1pl3kjo47q5hl516lk/tj4rm8e6bt50lht09qgev340nk/1703930035000/108888117743638485671/108888117743638485671/1vmb6LphTM8jKf2K7fkrmeWhy_wEgMtvthJx7KFtBwhE?format=docx&dat=AOBvIb1sqCYIZBDWtevTgWhVtsxSMJl1RuUy-MFBRUZszTYkE1Y_qhzC_RfgEvMx5kJz_GECf3mFQkPQq6Re7HFsKVaDU4_KXQE13ZM1cCIEtAEJ7UKZPcI55xO_dMh7ig_1wArgt_jviaEmA5RJcdLHu-omc7W23lcTfPZQpZTextkU7vtgQJGceYeC25JIdRPpsTYVXvqhD5Bjtq-ArRQO4f3huW-TfFKdiVh3MFjkuMx8fMg3l60l8JH_lUqw2BqCqzQDVeD_ajYrmzrFQMP5rFXj353S5HtCiAdSlClI1I6nRMLAELwtsgkqEIc5pwNxcOUKZU1lHkCl1wljzOkrLxRSPlQ1Hb2h0YbRVbPARBB6ywe5QooHn9HatQr_4hkzMTRug4Qv-fo39-F5Uy5bNeGPlK4tDtOUPUDUQs0Kbnn_gT9zzSUCXj4BW85tmNtCNc-Akt4_tPXGyEqlNELpFeBaK27EETF6S93N7C5OU9SfYbL8u29YgTLq1229JmJ3dcUr8yDv2oFLx9x_PNbAStSYABZaDCi1B5B2gPSUvxdQ7CtkoFodD0e7XwBWqDi3jC1N2LdBa8mUsIkFVJvI3PmixODcgzJb5MTkKBwWKHw0UqV-Zsl2whtWEEMeeu6HdgsIiuzSs56dUDsOIJXhu2PfIojjyoX91-NeffGEVQ5-w9l3_EfNpOUHLli3_Ju8w5YvjNoS9gU-g2HTdljnWydN0j0jiz1otjiE0oQxMzVqvWNMa3Qap2vPvQMVoOB_7SwBzcEVmi-SnitWvrXIXs3o585Qc6MBeDQ20D0VhJGsFJ8vVqxtDI8AOIC-t8NaYatFoKXuQLJckJ1wcqA7NmFxWa2hWU79l6dwPztsK9w0VJQyMSwJOMFPXWU", + "dest": "Capitalize_First_Letter_Gold.docx" + }, + "result": { + "type": "vm_file", + "path": "Desktop/Capitalize_First_Letter.xlsx", + "dest": "Capitalize_First_Letter.xlsx" + } + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_writer/ecc2413d-8a48-416e-a3a2-d30106ca36cb.json b/evaluation_examples/examples/libreoffice_writer/ecc2413d-8a48-416e-a3a2-d30106ca36cb.json index 930a13d..5e35598 100644 --- a/evaluation_examples/examples/libreoffice_writer/ecc2413d-8a48-416e-a3a2-d30106ca36cb.json +++ b/evaluation_examples/examples/libreoffice_writer/ecc2413d-8a48-416e-a3a2-d30106ca36cb.json @@ -3,10 +3,35 @@ "snapshot": "libreoffice_writer", "instruction": "Insert a blank page here", "source": "https://www.quora.com/How-can-I-insert-a-blank-page-on-libreoffice", - "config": [], + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://doc-0s-20-docstext.googleusercontent.com/export/hglu5spf1pl3kjo47q5hl516lk/nqen29nemcpds1sk8t0ck303a8/1703926705000/108888117743638485671/108888117743638485671/10KfmCo_A5M04w4TA_qzPkd6vw04K3xzBzluIgeRCXuo?format=docx&dat=AOBvIb208vnoN2v6hNgA1FJ6jqegOR6oyVuKcoeroXXtmMiXWTao5vsteKCqxz2lnj5rioDVslkXyDQPCKYBnAJhtvKsIE8cJ7V2DtYuL9jFKYtJgClq2RsfpGE0hgvlLuoLZmeaRLaEJv10NTPGRTULPYwgN-RqLdnyG4EojXxrTKxk4TfVM7xAqob7uE24vFyGMH4uMctC2obdXNsDKnZ4dM1eao-3ABtlyPzSVpT891ziY_SMclP7l7y7cLqw4S11zbbnteVYpM5ytRlgpWKFrKvCmX8gRKpT0ENcNlL4ILJdi3KOAhU97X3vQNkS0LyqmAzKjBeuxz5tD3CuAj7LN1xu2t-DaLVvvrZPm_-XHFGvbHdy5wY66HtMqqPmaRb9_898Tl5ODZxfd5XP1CCRw-c8ohA2Jmdl86Scr8XDA7C_mAT8m_E1FLvJLJhJ_TyL74H0-TRiAPA2noaX2PUmOt4G1qFF_aIOn56iPPt3hB3eHvgthD0bVuW3TZUyr6cP4ZM_TF7g9awhXa1xWusltHItieNfNaJOPiI4Lacon_uICbbpSvEhuq5-apCsnwXpKIvK18UKP5u1Fw1Zb8AhAocJpHLxej87mInzYfFr7XAdf1kiPPxh1zRL2yW_Qe-J4YxWn0oBRrNrf_IgfQK_z9QRXgzzS3xaby2AsmA0qMNHIbMT73Uvha0TvO5UxozPc-aejeuaoi7ot27uSAwd0Cd4Yi-d4e7qfqVgNqvLl-psT9ZZ7cWq8vhU2lPiHrlmhVIwiWjf-s57gRNyXN99SY7MLG-b_JhOI43JgzZzfhjMc0EG2UrCxEEiOOGCp57BwH9FjqM1SQSenAlPmy28e8wCShBwZba_WUbwStumKQakIkwYqeoc0VoJN38", + "path": "Desktop/Insert_Blank_Page.docx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "Desktop/Insert_Blank_Page.docx" + } + } + ], "trajectory": "trajectories/", "related_apps": [ "libreoffice_writer" ], - "evaluator": "evaluation_dir" -} + "evaluator": { + "func": "contains_page_break", + "result": { + "type": "vm_file", + "path": "Desktop/Insert_Blank_Page.docx", + "dest": "Insert_Blank_Page.docx" + } + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_writer/f178a4a9-d090-4b56-bc4c-4b72a61a035d.json b/evaluation_examples/examples/libreoffice_writer/f178a4a9-d090-4b56-bc4c-4b72a61a035d.json index 2872625..29a7834 100644 --- a/evaluation_examples/examples/libreoffice_writer/f178a4a9-d090-4b56-bc4c-4b72a61a035d.json +++ b/evaluation_examples/examples/libreoffice_writer/f178a4a9-d090-4b56-bc4c-4b72a61a035d.json @@ -3,10 +3,36 @@ "snapshot": "libreoffice_writer", "instruction": "Make Times New Roman the default Font", "source": "https://ask.libreoffice.org/t/how-do-i-make-times-new-roman-the-default-font-in-lo/64604", - "config": [], + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://doc-10-20-docstext.googleusercontent.com/export/hglu5spf1pl3kjo47q5hl516lk/jq5b3etcrfdc25il9orjsk8jgo/1703926500000/108888117743638485671/108888117743638485671/1ufVZd-Uibt9pVClmK9BceqMR6iQNSekH5ECxysnPehY?format=docx&dat=AOBvIb3K-ByHFQ8OY7SbFlbA41gbWygryhR0tjcDhZuUWmdje6d2VxzZsK00RoorX_LOOjpnln1zFpw9-W1PLbjKMx1-cOGZfuVpqBiL3mOiYLdQPxqqPgrRKjzJzeD0SZOCK96nu8wIGoY-tDVwAoGzf98-lxjDOO1Z3slrW4YeTUPZQ17EusYw75S8FzBIMxW9UGzMPMtubUK_JVrHQOU-ghu8bz0atPRrkB44ysWeF0W063sg03ysAnb1557Ie0p3RgrcMc9aeGtKvQFCo0Tr7BkR93D2klp6M5pDMJekgtUGxurwiEmNeZ6nRhp-bYoev1uesAhGzZONVi_1DtaHvGzL6MGMIzfV5rWtMXbFI1CBwtP00AuF5qFOD6l2wkRVogas48MWOxBCX-bcUHOxezVDmxb0ohfCveIDMq0s8ebY5HggfrE9I8pMs-2GNPABUSr4S7MkRO-2yzy-j8pgTtzO3QRc146gd9Hci6aYoAnBIludK31AsLckcVba-OrEyB7Lx31sfzvdITS8nZ4Cg_JWMV9CugNgF_8w0SprvDMw9vsoEjYaJpY2Z_K445GGENY7dGRQbGmBhLeP9wJBXHsNhObWKV71BrPm2wSOJLrFU2iLa5jLY7mkz7xKhq3e9dDttus9c6A0KPj1f54YAsvZ_SEPbE1WBVzMYPD3MV-6yw2KbKgZxYQ9A0lf87KoffIbA24Y2S97FBuOWJ5ZVN2rz02PbpXyuMf1fcnUb8JpAm6ewwArKqtmIJg20hySiYOtZUgfQvjwBaDrMhQjKGKYiLXIEdGTWVQuuTGQhG8pqd4StbxUsCwdMiFOFVXV0mNNncz3QZEOPF5fgW564KuE9qFClhq620ve61mgg6_3S2kQ9RhHYaShvuI", + "path": "Desktop/Set_Default_Font.docx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "Desktop/Set_Default_Font.docx" + } + } + ], "trajectory": "trajectories/", "related_apps": [ "libreoffice_writer" ], - "evaluator": "evaluation_dir" -} + "evaluator": { + "func": "find_default_font", + "expected": "Times New Roman", + "result": { + "type": "vm_file", + "path": "/home/[your-username]/.config/libreoffice/4/user/registrymodifications.xcu", + "dest": "registrymodifications.xcu" + } + } +} \ No newline at end of file