|
5 | 5 | import os
|
6 | 6 | import re
|
7 | 7 | import time
|
| 8 | +from typing import cast |
8 | 9 |
|
9 | 10 | import requests
|
10 | 11 | from bs4 import BeautifulSoup
|
@@ -2747,7 +2748,7 @@ def get_atl_request(url: str):
|
2747 | 2748 | try:
|
2748 | 2749 | response = self.get(url, advanced_mode=True)
|
2749 | 2750 | parsed_html = BeautifulSoup(response.text, "html.parser")
|
2750 |
| - atl_token = parsed_html.find("input", {"name": "atl_token"}).get("value") |
| 2751 | + atl_token = parsed_html.find("input", {"name": "atl_token"}).get("value") # type: ignore[union-attr] |
2751 | 2752 | return atl_token
|
2752 | 2753 | except Exception as e:
|
2753 | 2754 | raise ApiError("Problems with getting the atl_token for get_space_export method :", reason=e)
|
@@ -2799,17 +2800,18 @@ def get_atl_request(url: str):
|
2799 | 2800 | parsed_html = BeautifulSoup(response.text, "html.parser")
|
2800 | 2801 | # Getting the poll URL to get the export progress status
|
2801 | 2802 | try:
|
2802 |
| - poll_url = parsed_html.find("meta", {"name": "ajs-pollURI"}).get("content") |
| 2803 | + poll_url = cast("str", parsed_html.find("meta", {"name": "ajs-pollURI"}).get("content")) # type: ignore[union-attr] |
2803 | 2804 | except Exception as e:
|
2804 | 2805 | raise ApiError("Problems with getting the poll_url for get_space_export method :", reason=e)
|
2805 | 2806 | running_task = True
|
2806 | 2807 | while running_task:
|
2807 | 2808 | try:
|
2808 | 2809 | progress_response = self.get(poll_url)
|
| 2810 | + assert progress_response |
2809 | 2811 | log.info("Space" + space_key + " export status: " + progress_response["message"])
|
2810 | 2812 | if progress_response["complete"]:
|
2811 | 2813 | parsed_html = BeautifulSoup(progress_response["message"], "html.parser")
|
2812 |
| - download_url = parsed_html.find("a", {"class": "space-export-download-path"}).get("href") |
| 2814 | + download_url = cast("str", parsed_html.find("a", {"class": "space-export-download-path"}).get("href")) # type: ignore |
2813 | 2815 | if self.url in download_url:
|
2814 | 2816 | return download_url
|
2815 | 2817 | else:
|
|
0 commit comments