Skip to content

Commit

Permalink
rename StableCache to ScraperCache, add OSError to except statment
Browse files Browse the repository at this point in the history
  • Loading branch information
zeptofine committed Oct 29, 2024
1 parent c44c43d commit 51cf594
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions source/modules/scraper_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def to_dict(self):


@dataclass
class StableCache:
class ScraperCache:
folders: dict[Version, StableFolder] = field(default_factory=dict)

def __contains__(self, ver: Version) -> bool:
Expand All @@ -74,7 +74,7 @@ def try_from_file(cls, file: Path):
cache = json.load(f)
logging.debug(f"Loaded cache from {file!r}")
return cls.from_dict(cache)
except (json.decoder.JSONDecodeError, FileNotFoundError) as e:
except (json.decoder.JSONDecodeError, FileNotFoundError, OSError) as e:
logging.error(f"Failed to load cache {file}: {e}")
return None

Expand Down
6 changes: 3 additions & 3 deletions source/threads/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
update_stable_builds_cache,
)
from modules.build_info import BuildInfo, parse_blender_ver
from modules.scraper_cache import StableCache
from modules.scraper_cache import ScraperCache
from modules.settings import (
get_minimum_blender_stable_version,
get_scrape_automated_builds,
Expand Down Expand Up @@ -180,8 +180,8 @@ def __init__(self, parent, man: ConnectionManager):
self.cache_path = stable_cache_path()
self.bfa_cache_path = bfa_cache_path()

self.cache = StableCache.from_file_or_default(self.cache_path)
self.bfa_cache = StableCache.from_file_or_default(self.bfa_cache_path)
self.cache = ScraperCache.from_file_or_default(self.cache_path)
self.bfa_cache = ScraperCache.from_file_or_default(self.bfa_cache_path)

self.json_platform = {
"Windows": "windows",
Expand Down

0 comments on commit 51cf594

Please sign in to comment.