From fcdaf7ce0b41b14f295b90e7b150af4e629b7352 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Thu, 4 Jul 2024 09:37:13 -0500 Subject: [PATCH 1/4] Update setup.py for update_browse_history function --- desktop_env/controllers/setup.py | 41 ++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/desktop_env/controllers/setup.py b/desktop_env/controllers/setup.py index 3bacb25..7604d11 100644 --- a/desktop_env/controllers/setup.py +++ b/desktop_env/controllers/setup.py @@ -580,11 +580,33 @@ class SetupController: return browser, context def _update_browse_history_setup(self, **config): - db_path = os.path.join("desktop_env", "assets", "history_empty.sqlite") - - # copy a new history file in the tmp folder cache_path = os.path.join(self.cache_dir, "history_new.sqlite") - shutil.copyfile(db_path, cache_path) + db_url = "https://drive.usercontent.google.com/u/0/uc?id=1Lv74QkJYDWVX0RIgg0Co-DUcoYpVL0oX&export=download" # google drive + if not os.path.exists(cache_path): + max_retries = 3 + downloaded = False + e = None + for i in range(max_retries): + try: + response = requests.get(db_url, stream=True) + response.raise_for_status() + + with open(cache_path, 'wb') as f: + for chunk in response.iter_content(chunk_size=8192): + if chunk: + f.write(chunk) + logger.info("File downloaded successfully") + downloaded = True + break + + except requests.RequestException as e: + logger.error( + f"Failed to download {db_url} caused by {e}. Retrying... ({max_retries - i - 1} attempts left)") + if not downloaded: + raise requests.RequestException(f"Failed to download {db_url}. No retries left. Error: {e}") + else: + logger.info("File already exists in cache directory") + # copy a new history file in the tmp folder db_path = cache_path history = config['history'] @@ -632,9 +654,14 @@ class SetupController: """import os; print(os.path.join(os.getenv('HOME'), "Library", "Application Support", "Google", "Chrome", "Default", "History"))""")[ 'output'].strip() elif os_type == 'Linux': - chrome_history_path = controller.execute_python_command( - "import os; print(os.path.join(os.getenv('HOME'), '.config', 'google-chrome', 'Default', 'History'))")[ - 'output'].strip() + if "arm" in platform.machine(): + chrome_history_path = controller.execute_python_command( + "import os; print(os.path.join(os.getenv('HOME'), 'snap', 'chromium', 'common', 'chromium', 'Default', 'History'))")[ + 'output'].strip() + else: + chrome_history_path = controller.execute_python_command( + "import os; print(os.path.join(os.getenv('HOME'), '.config', 'google-chrome', 'Default', 'History'))")[ + 'output'].strip() else: raise Exception('Unsupported operating system') From b4bbe4a3b61752879bcd31338e871aa35a5c5b54 Mon Sep 17 00:00:00 2001 From: tsuky_chen <91684733+chenjix@users.noreply.github.com> Date: Fri, 5 Jul 2024 00:50:14 +0800 Subject: [PATCH 2/4] Update 0a211154-fda0-48d0-9274-eaac4ce5486d.json --- .../0a211154-fda0-48d0-9274-eaac4ce5486d.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluation_examples/examples/libreoffice_impress/0a211154-fda0-48d0-9274-eaac4ce5486d.json b/evaluation_examples/examples/libreoffice_impress/0a211154-fda0-48d0-9274-eaac4ce5486d.json index 13c449e..7ece359 100644 --- a/evaluation_examples/examples/libreoffice_impress/0a211154-fda0-48d0-9274-eaac4ce5486d.json +++ b/evaluation_examples/examples/libreoffice_impress/0a211154-fda0-48d0-9274-eaac4ce5486d.json @@ -61,7 +61,7 @@ "func": "compare_pptx_files", "expected": { "type": "cloud_file", - "path": "https://drive.usercontent.google.com/download?id=1W6yRtc3Z6lGBdwvGqoU4CC20TDKw1Pdq&export=download&authuser=0&confirm=t&uuid=a20dc92d-9d78-4c32-ad3b-a2fd068fd167&at=APZUnTWUSZoFc5RheJ8QOwadHnjF:1709110061143", + "path": "https://drive.usercontent.google.com/download?id=1W6yRtc3Z6lGBdwvGqoU4CC20TDKw1Pdq&export=download&authuser=0&confirm=t&uuid=157e59b1-5b50-48a5-a9bc-aaa1e5d3c5bb&at=APZUnTXLw32ithWfa1jMREjb6Aaa:1720111552480", "dest": "13_0_Gold.pptx" }, "result": { @@ -73,4 +73,4 @@ "examine_shape": false } } -} \ No newline at end of file +} From 48c28970dee544627e6676fd827fce4a677173d7 Mon Sep 17 00:00:00 2001 From: Tianbao Xie <47296835+Timothyxxx@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:19:38 +0800 Subject: [PATCH 3/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a4bdbe0..13c6628 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@

WebsitePaper • + DocDataData ViewerDiscord From 3b0d219e158c122c0fd861915e3a4721d87e1f0c Mon Sep 17 00:00:00 2001 From: Tianbao Xie <47296835+Timothyxxx@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:21:15 +0800 Subject: [PATCH 4/4] Update AWS_GUIDELINE.md --- desktop_env/providers/aws/AWS_GUIDELINE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop_env/providers/aws/AWS_GUIDELINE.md b/desktop_env/providers/aws/AWS_GUIDELINE.md index 1029b43..d45ed0b 100644 --- a/desktop_env/providers/aws/AWS_GUIDELINE.md +++ b/desktop_env/providers/aws/AWS_GUIDELINE.md @@ -15,7 +15,8 @@ You need to assign values to several variables crucial for the operation of thes - Formatted as follows: ```python IMAGE_ID_MAP = { - "us-east-1": "ami-09bab251951b4272c", + "us-east-1": "ami-019f92c05df45031b", + "ap-east-1": "ami-07b4956131da1b282" # Add other regions and corresponding AMIs } ```