Skip to content

Commit

Permalink
fix: Microsoft modifying their webpage. Fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaVandaele committed Nov 3, 2024
1 parent 1202591 commit 06daf2a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ cd SuperISOUpdater
python -m pip install .
```

### Updating

To update the package to the latest version, run the following command:

```sh
python -m pip install --upgrade sisou
```

## Usage

To use SISOU, follow these steps:
Expand Down
10 changes: 1 addition & 9 deletions modules/updaters/Windows10.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class Windows10(GenericUpdater):
Attributes:
download_page (requests.Response): The HTTP response containing the download page HTML.
soup_download_page (BeautifulSoup): The parsed HTML content of the download page.
soup_main_content (Tag): The main contents of the page.
Note:
This class inherits from the abstract base class GenericUpdater.
Expand Down Expand Up @@ -96,13 +95,6 @@ def __init__(self, folder_path: Path, lang: str) -> None:
self.download_page.content, features="html.parser"
)

self.soup_main_content: Tag = self.soup_download_page.find(
"main", attrs={"id": "mainContent"}
) # type: ignore

if not self.soup_main_content:
raise ConnectionError("Failed to fetch the main content from the webpage")

self.hash: str | None = None

@cache
Expand All @@ -127,7 +119,7 @@ def check_integrity(self) -> bool:

@cache
def _get_latest_version(self) -> list[str]:
software_download_tag: Tag | None = self.soup_main_content.find("div", attrs={"id": "SoftwareDownload_EditionSelection"}) # type: ignore
software_download_tag: Tag | None = self.soup_download_page.find("div", attrs={"id": "SoftwareDownload_EditionSelection"}) # type: ignore
if not software_download_tag:
raise VersionNotFoundError(
"Could not find the software download section containing version information"
Expand Down
2 changes: 2 additions & 0 deletions modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def parse_config_from_dict(input_dict: dict):
for key, value in input_dict.items():
if isinstance(value, dict):
if "enabled" in value and not value["enabled"]:
logging.debug(f"Skipping disabled module {key}")
del value
continue
if "directory" in value:
Expand All @@ -67,6 +68,7 @@ def parse_config_from_dict(input_dict: dict):
elif key == "enabled":
continue
else:
logging.debug(f"Found key {key}")
new_dict[key] = value
return new_dict

Expand Down

0 comments on commit 06daf2a

Please sign in to comment.