From 171311af2c863bd5720eb17ca15aa37a57060e27 Mon Sep 17 00:00:00 2001 From: zigai Date: Tue, 31 Dec 2024 18:17:00 +0100 Subject: [PATCH] update --- pyproject.toml | 2 +- wrighter/options.py | 8 ++++---- wrighter/plugin_manager.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e31de93..99044bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ dependencies = [ "playwright>=1.33.0", "pydantic>=1.10.8", "playwright_stealth>=1.0.5", - "stdl>=0.4.4", + "stdl>=0.5.5", "loguru>=0.7.0", ] diff --git a/wrighter/options.py b/wrighter/options.py index cebc7db..d89d329 100644 --- a/wrighter/options.py +++ b/wrighter/options.py @@ -13,7 +13,7 @@ ) from pydantic import BaseModel, validator from stdl import fs -from stdl.str_u import FG, colored +from stdl.st import FG, colored from wrighter.constants import BROWSER_LAUNCH_OPTS_NAMES, BROWSERS, CONTEXT_OPTS_NAMES, PERMISSIONS @@ -36,8 +36,8 @@ def export(self, path: str | Path, *, full: bool = False): """ excl_unset = not full excl_defaults = not full - json_opts = self.json(exclude_unset=excl_unset, exclude_defaults=excl_defaults) - fs.json_dump(data=json.loads(json_opts), path=path) + data = self.model_dump(exclude_unset=excl_unset, exclude_defaults=excl_defaults) + fs.json_dump(data, path=path) def print(self, *, full=False): print(colored(self.__class__.__name__, color=FG.LIGHT_BLUE) + ":") @@ -178,7 +178,7 @@ def __validate_viewport_size(cls, v: ViewportSize): "storage_state", ) def __validate_path(cls, v): - fs.assert_paths_exist(v) + fs.ensure_paths_exist(v) return os.path.abspath(str(v)) diff --git a/wrighter/plugin_manager.py b/wrighter/plugin_manager.py index 63535a5..6b385e5 100644 --- a/wrighter/plugin_manager.py +++ b/wrighter/plugin_manager.py @@ -1,5 +1,5 @@ from playwright.sync_api import BrowserContext, Page -from stdl.str_u import FG, colored +from stdl.st import FG, colored from wrighter.plugin import Plugin