From f2b522b25eb8ff506bd61b153300bfe7f11cb281 Mon Sep 17 00:00:00 2001 From: g1879 Date: Fri, 20 Oct 2023 15:07:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/_base/base.py | 8 +++--- DrissionPage/_base/base.pyi | 2 +- DrissionPage/_base/browser.py | 2 +- DrissionPage/_base/browser.pyi | 4 +-- DrissionPage/_commons/browser.py | 4 +-- DrissionPage/_commons/browser.pyi | 2 +- DrissionPage/_commons/cli.py | 4 +-- DrissionPage/_commons/constants.py | 2 +- DrissionPage/_commons/tools.pyi | 2 +- DrissionPage/_commons/web.pyi | 6 ++--- DrissionPage/_configs/chromium_options.py | 2 +- DrissionPage/_configs/session_options.py | 2 +- DrissionPage/_elements/chromium_element.py | 22 ++++++++-------- DrissionPage/_elements/chromium_element.pyi | 18 ++++++------- DrissionPage/_elements/session_element.py | 8 +++--- DrissionPage/_elements/session_element.pyi | 12 ++++----- DrissionPage/_pages/chromium_base.py | 26 +++++++++---------- DrissionPage/_pages/chromium_base.pyi | 24 ++++++++--------- DrissionPage/_pages/chromium_frame.py | 10 +++---- DrissionPage/_pages/chromium_frame.pyi | 14 +++++----- DrissionPage/_pages/chromium_page.py | 16 ++++++------ DrissionPage/_pages/chromium_page.pyi | 14 +++++----- DrissionPage/_pages/chromium_tab.py | 12 ++++----- DrissionPage/_pages/chromium_tab.pyi | 20 +++++++------- DrissionPage/_pages/session_page.py | 10 +++---- DrissionPage/_pages/session_page.pyi | 10 +++---- DrissionPage/_pages/web_page.py | 12 ++++----- DrissionPage/_pages/web_page.pyi | 14 +++++----- DrissionPage/_units/action_chains.py | 4 +-- DrissionPage/_units/action_chains.pyi | 6 ++--- .../_units/browser_download_manager.py | 6 ++++- .../_units/browser_download_manager.pyi | 4 +-- DrissionPage/_units/network_listener.py | 2 +- DrissionPage/_units/network_listener.pyi | 4 +-- DrissionPage/_units/setter.py | 4 +-- DrissionPage/_units/setter.pyi | 14 +++++----- DrissionPage/_units/waiter.py | 4 +-- DrissionPage/_units/waiter.pyi | 8 +++--- 38 files changed, 171 insertions(+), 167 deletions(-) diff --git a/DrissionPage/_base/base.py b/DrissionPage/_base/base.py index 51d7182..fe6f9a8 100644 --- a/DrissionPage/_base/base.py +++ b/DrissionPage/_base/base.py @@ -10,10 +10,10 @@ from urllib.parse import quote from DownloadKit import DownloadKit -from DrissionPage._commons.constants import Settings, NoneElement -from DrissionPage._commons.locator import get_loc -from DrissionPage._commons.web import format_html -from DrissionPage.errors import ElementNotFoundError +from .._commons.constants import Settings, NoneElement +from .._commons.locator import get_loc +from .._commons.web import format_html +from ..errors import ElementNotFoundError class BaseParser(object): diff --git a/DrissionPage/_base/base.pyi b/DrissionPage/_base/base.pyi index 3ec97a4..2b9228c 100644 --- a/DrissionPage/_base/base.pyi +++ b/DrissionPage/_base/base.pyi @@ -8,7 +8,7 @@ from typing import Union, Tuple, List from DownloadKit import DownloadKit -from DrissionPage._commons.constants import NoneElement +from .._commons.constants import NoneElement class BaseParser(object): diff --git a/DrissionPage/_base/browser.py b/DrissionPage/_base/browser.py index 9019b7f..126afab 100644 --- a/DrissionPage/_base/browser.py +++ b/DrissionPage/_base/browser.py @@ -5,8 +5,8 @@ """ from time import sleep -from DrissionPage._units.browser_download_manager import BrowserDownloadManager from .chromium_driver import BrowserDriver +from .._units.browser_download_manager import BrowserDownloadManager class Browser(object): diff --git a/DrissionPage/_base/browser.pyi b/DrissionPage/_base/browser.pyi index cdee003..3a0b818 100644 --- a/DrissionPage/_base/browser.pyi +++ b/DrissionPage/_base/browser.pyi @@ -5,9 +5,9 @@ """ from typing import List, Optional, Union -from DrissionPage._units.browser_download_manager import BrowserDownloadManager -from DrissionPage._pages.chromium_page import ChromiumPage from .chromium_driver import BrowserDriver +from .._pages.chromium_page import ChromiumPage +from .._units.browser_download_manager import BrowserDownloadManager class Browser(object): diff --git a/DrissionPage/_commons/browser.py b/DrissionPage/_commons/browser.py index 326bc7c..80106c4 100644 --- a/DrissionPage/_commons/browser.py +++ b/DrissionPage/_commons/browser.py @@ -12,7 +12,7 @@ from platform import system from requests import get as requests_get -from DrissionPage.errors import BrowserConnectError +from ..errors import BrowserConnectError from .tools import port_is_using @@ -42,7 +42,7 @@ def connect_browser(option): # 传入的路径找不到,主动在ini文件、注册表、系统变量中找 except FileNotFoundError: - from DrissionPage.easy_set import get_chrome_path + from ..easy_set import get_chrome_path chrome_path = get_chrome_path(show_msg=False) if not chrome_path: diff --git a/DrissionPage/_commons/browser.pyi b/DrissionPage/_commons/browser.pyi index 0294aff..a6fee1c 100644 --- a/DrissionPage/_commons/browser.pyi +++ b/DrissionPage/_commons/browser.pyi @@ -3,7 +3,7 @@ @Author : g1879 @Contact : g1879@qq.com """ -from DrissionPage._configs.chromium_options import ChromiumOptions +from .._configs.chromium_options import ChromiumOptions def connect_browser(option: ChromiumOptions) -> tuple: ... diff --git a/DrissionPage/_commons/cli.py b/DrissionPage/_commons/cli.py index 71f2c28..82e991a 100644 --- a/DrissionPage/_commons/cli.py +++ b/DrissionPage/_commons/cli.py @@ -5,8 +5,8 @@ """ from click import command, option -from DrissionPage._pages.chromium_page import ChromiumPage -from DrissionPage.easy_set import set_paths, configs_to_here as ch +from .._pages.chromium_page import ChromiumPage +from ..easy_set import set_paths, configs_to_here as ch @command() diff --git a/DrissionPage/_commons/constants.py b/DrissionPage/_commons/constants.py index 2a219c7..9192448 100644 --- a/DrissionPage/_commons/constants.py +++ b/DrissionPage/_commons/constants.py @@ -3,7 +3,7 @@ @Author : g1879 @Contact : g1879@qq.com """ -from DrissionPage.errors import ElementNotFoundError +from ..errors import ElementNotFoundError HANDLE_ALERT_METHOD = 'Page.handleJavaScriptDialog' FRAME_ELEMENT = ('iframe', 'frame') diff --git a/DrissionPage/_commons/tools.pyi b/DrissionPage/_commons/tools.pyi index 83dcff1..b430ba9 100644 --- a/DrissionPage/_commons/tools.pyi +++ b/DrissionPage/_commons/tools.pyi @@ -8,7 +8,7 @@ from pathlib import Path from typing import Union from types import FunctionType -from DrissionPage._pages.chromium_page import ChromiumPage +from .._pages.chromium_page import ChromiumPage def get_usable_path(path: Union[str, Path], is_file: bool = True, parents: bool = True) -> Path: ... diff --git a/DrissionPage/_commons/web.pyi b/DrissionPage/_commons/web.pyi index 4a365e9..eae78ce 100644 --- a/DrissionPage/_commons/web.pyi +++ b/DrissionPage/_commons/web.pyi @@ -9,9 +9,9 @@ from typing import Union from requests import Session from requests.cookies import RequestsCookieJar -from DrissionPage.base import DrissionElement, BasePage -from DrissionPage._chromium_element import ChromiumElement -from DrissionPage._chromium_base import ChromiumBase +from .._elements.chromium_element import ChromiumElement +from .._pages.chromium_base import ChromiumBase +from ..base import DrissionElement, BasePage def get_ele_txt(e: DrissionElement) -> str: ... diff --git a/DrissionPage/_configs/chromium_options.py b/DrissionPage/_configs/chromium_options.py index c44529a..38809a4 100644 --- a/DrissionPage/_configs/chromium_options.py +++ b/DrissionPage/_configs/chromium_options.py @@ -6,8 +6,8 @@ from pathlib import Path from tempfile import gettempdir, TemporaryDirectory -from DrissionPage._commons.tools import port_is_using, clean_folder from .options_manage import OptionsManager +from .._commons.tools import port_is_using, clean_folder class ChromiumOptions(object): diff --git a/DrissionPage/_configs/session_options.py b/DrissionPage/_configs/session_options.py index 1aa7c1d..4339b08 100644 --- a/DrissionPage/_configs/session_options.py +++ b/DrissionPage/_configs/session_options.py @@ -8,8 +8,8 @@ from pathlib import Path from requests import Session from requests.structures import CaseInsensitiveDict -from DrissionPage._commons.web import cookies_to_tuple, set_session_cookies from .options_manage import OptionsManager +from .._commons.web import cookies_to_tuple, set_session_cookies class SessionOptions(object): diff --git a/DrissionPage/_elements/chromium_element.py b/DrissionPage/_elements/chromium_element.py index f5fc1fd..e8cb50e 100644 --- a/DrissionPage/_elements/chromium_element.py +++ b/DrissionPage/_elements/chromium_element.py @@ -7,17 +7,17 @@ from os.path import basename, sep from pathlib import Path from time import perf_counter, sleep -from DrissionPage._base.base import DrissionElement, BaseElement -from DrissionPage._commons.constants import FRAME_ELEMENT, NoneElement, Settings -from DrissionPage._commons.keys import keys_to_typing, keyDescriptionForString, keyDefinitions -from DrissionPage._commons.locator import get_loc -from DrissionPage._commons.tools import get_usable_path -from DrissionPage._commons.web import make_absolute_link, get_ele_txt, format_html, is_js_func, location_in_viewport, offset_scroll -from DrissionPage.errors import ContextLossError, ElementLossError, JavaScriptError, NoRectError, ElementNotFoundError, \ +from .._base.base import DrissionElement, BaseElement +from .._commons.constants import FRAME_ELEMENT, NoneElement, Settings +from .._commons.keys import keys_to_typing, keyDescriptionForString, keyDefinitions +from .._commons.locator import get_loc +from .._commons.tools import get_usable_path +from .._commons.web import make_absolute_link, get_ele_txt, format_html, is_js_func, location_in_viewport, offset_scroll +from ..errors import ContextLossError, ElementLossError, JavaScriptError, NoRectError, ElementNotFoundError, \ CDPError, NoResourceError, CanNotClickError from .session_element import make_session_ele -from DrissionPage._units.setter import ChromiumElementSetter -from DrissionPage._units.waiter import ChromiumElementWaiter +from .._units.setter import ChromiumElementSetter +from .._units.waiter import ChromiumElementWaiter class ChromiumElement(DrissionElement): @@ -641,7 +641,7 @@ class ChromiumElement(DrissionElement): points = [(int(current_x + i * (width / num)), int(current_y + i * (height / num))) for i in range(1, num)] points.append((target_x, target_y)) - from .action_chains import ActionChains + from .._units.action_chains import ActionChains actions = ActionChains(self.page) actions.hold(self) @@ -1203,7 +1203,7 @@ def make_chromium_ele(page, node_id=None, obj_id=None): ele = ChromiumElement(page, obj_id=obj_id, node_id=node_id, backend_id=backend_id) if ele.tag in FRAME_ELEMENT: - from ._chromium_frame import ChromiumFrame + from .._pages.chromium_frame import ChromiumFrame ele = ChromiumFrame(page, ele) return ele diff --git a/DrissionPage/_elements/chromium_element.pyi b/DrissionPage/_elements/chromium_element.pyi index a7b0dcb..7ee4253 100644 --- a/DrissionPage/_elements/chromium_element.pyi +++ b/DrissionPage/_elements/chromium_element.pyi @@ -6,15 +6,15 @@ from pathlib import Path from typing import Union, Tuple, List, Any -from DrissionPage._base.base import DrissionElement, BaseElement -from DrissionPage._commons.constants import NoneElement -from DrissionPage._elements.session_element import SessionElement -from DrissionPage._pages.chromium_base import ChromiumBase -from DrissionPage._pages.chromium_frame import ChromiumFrame -from DrissionPage._pages.chromium_page import ChromiumPage -from DrissionPage._pages.web_page import WebPage -from DrissionPage._units.setter import ChromiumElementSetter -from DrissionPage._units.waiter import ChromiumElementWaiter +from .._base.base import DrissionElement, BaseElement +from .._commons.constants import NoneElement +from .._elements.session_element import SessionElement +from .._pages.chromium_base import ChromiumBase +from .._pages.chromium_frame import ChromiumFrame +from .._pages.chromium_page import ChromiumPage +from .._pages.web_page import WebPage +from .._units.setter import ChromiumElementSetter +from .._units.waiter import ChromiumElementWaiter class ChromiumElement(DrissionElement): diff --git a/DrissionPage/_elements/session_element.py b/DrissionPage/_elements/session_element.py index fa241cb..5fd09f4 100644 --- a/DrissionPage/_elements/session_element.py +++ b/DrissionPage/_elements/session_element.py @@ -9,10 +9,10 @@ from re import match, DOTALL from lxml.etree import tostring from lxml.html import HtmlElement, fromstring -from DrissionPage._base.base import DrissionElement, BasePage, BaseElement -from DrissionPage._commons.constants import NoneElement -from DrissionPage._commons.locator import get_loc -from DrissionPage._commons.web import get_ele_txt, make_absolute_link +from .._base.base import DrissionElement, BasePage, BaseElement +from .._commons.constants import NoneElement +from .._commons.locator import get_loc +from .._commons.web import get_ele_txt, make_absolute_link class SessionElement(DrissionElement): diff --git a/DrissionPage/_elements/session_element.pyi b/DrissionPage/_elements/session_element.pyi index 9257354..6d3efc9 100644 --- a/DrissionPage/_elements/session_element.pyi +++ b/DrissionPage/_elements/session_element.pyi @@ -7,12 +7,12 @@ from typing import Union, List, Tuple from lxml.html import HtmlElement -from DrissionPage._base.base import DrissionElement, BaseElement -from DrissionPage._commons.constants import NoneElement -from DrissionPage._elements.chromium_element import ChromiumElement -from DrissionPage._pages.chromium_base import ChromiumBase -from DrissionPage._pages.chromium_frame import ChromiumFrame -from DrissionPage._pages.session_page import SessionPage +from .._base.base import DrissionElement, BaseElement +from .._commons.constants import NoneElement +from .._elements.chromium_element import ChromiumElement +from .._pages.chromium_base import ChromiumBase +from .._pages.chromium_frame import ChromiumFrame +from .._pages.session_page import SessionPage class SessionElement(DrissionElement): diff --git a/DrissionPage/_pages/chromium_base.py b/DrissionPage/_pages/chromium_base.py index c79b8be..e0259c4 100644 --- a/DrissionPage/_pages/chromium_base.py +++ b/DrissionPage/_pages/chromium_base.py @@ -13,20 +13,20 @@ from time import perf_counter, sleep, time from requests import get -from DrissionPage._base.base import BasePage -from DrissionPage._base.chromium_driver import ChromiumDriver -from DrissionPage._commons.constants import HANDLE_ALERT_METHOD, ERROR, NoneElement -from DrissionPage._commons.locator import get_loc -from DrissionPage._commons.tools import get_usable_path, clean_folder -from DrissionPage._commons.web import location_in_viewport -from DrissionPage._elements.chromium_element import ChromiumScroll, ChromiumElement, run_js, make_chromium_ele -from DrissionPage._elements.session_element import make_session_ele -from DrissionPage._units.network_listener import NetworkListener -from DrissionPage._units.setter import ChromiumBaseSetter -from DrissionPage._units.waiter import ChromiumBaseWaiter -from DrissionPage.errors import ContextLossError, ElementLossError, AlertExistsError, CDPError, TabClosedError, \ +from .._base.base import BasePage +from .._base.chromium_driver import ChromiumDriver +from .._commons.constants import HANDLE_ALERT_METHOD, ERROR, NoneElement +from .._commons.locator import get_loc +from .._commons.tools import get_usable_path, clean_folder +from .._commons.web import location_in_viewport +from .._elements.chromium_element import ChromiumScroll, ChromiumElement, run_js, make_chromium_ele +from .._elements.session_element import make_session_ele +from .._units.action_chains import ActionChains +from .._units.network_listener import NetworkListener +from .._units.setter import ChromiumBaseSetter +from .._units.waiter import ChromiumBaseWaiter +from ..errors import ContextLossError, ElementLossError, AlertExistsError, CDPError, TabClosedError, \ NoRectError, BrowserConnectError, GetDocumentError -from _units.action_chains import ActionChains class ChromiumBase(BasePage): diff --git a/DrissionPage/_pages/chromium_base.pyi b/DrissionPage/_pages/chromium_base.pyi index 97020ad..33f4030 100644 --- a/DrissionPage/_pages/chromium_base.pyi +++ b/DrissionPage/_pages/chromium_base.pyi @@ -8,18 +8,18 @@ from typing import Union, Tuple, List, Any from DataRecorder import Recorder -from DrissionPage._base.base import BasePage -from DrissionPage._base.browser import Browser -from DrissionPage._base.chromium_driver import ChromiumDriver -from DrissionPage._commons.constants import NoneElement -from DrissionPage._elements.chromium_element import ChromiumElement, ChromiumScroll -from DrissionPage._elements.session_element import SessionElement -from DrissionPage._pages.chromium_frame import ChromiumFrame -from DrissionPage._pages.chromium_page import ChromiumPage -from DrissionPage._units.action_chains import ActionChains -from DrissionPage._units.network_listener import NetworkListener -from DrissionPage._units.setter import ChromiumBaseSetter -from DrissionPage._units.waiter import ChromiumBaseWaiter +from .._base.base import BasePage +from .._base.browser import Browser +from .._base.chromium_driver import ChromiumDriver +from .._commons.constants import NoneElement +from .._elements.chromium_element import ChromiumElement, ChromiumScroll +from .._elements.session_element import SessionElement +from .._pages.chromium_frame import ChromiumFrame +from .._pages.chromium_page import ChromiumPage +from .._units.action_chains import ActionChains +from .._units.network_listener import NetworkListener +from .._units.setter import ChromiumBaseSetter +from .._units.waiter import ChromiumBaseWaiter class ChromiumBase(BasePage): diff --git a/DrissionPage/_pages/chromium_frame.py b/DrissionPage/_pages/chromium_frame.py index ca037f0..f83f322 100644 --- a/DrissionPage/_pages/chromium_frame.py +++ b/DrissionPage/_pages/chromium_frame.py @@ -10,11 +10,11 @@ from time import sleep, perf_counter from requests import get -from DrissionPage._elements.chromium_element import ChromiumElement -from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll -from DrissionPage._units.setter import ChromiumFrameSetter -from DrissionPage._units.waiter import FrameWaiter -from DrissionPage.errors import ContextLossError +from .._elements.chromium_element import ChromiumElement +from .._pages.chromium_base import ChromiumBase, ChromiumPageScroll +from .._units.setter import ChromiumFrameSetter +from .._units.waiter import FrameWaiter +from ..errors import ContextLossError class ChromiumFrame(ChromiumBase): diff --git a/DrissionPage/_pages/chromium_frame.pyi b/DrissionPage/_pages/chromium_frame.pyi index 1be67ad..8b4e0bf 100644 --- a/DrissionPage/_pages/chromium_frame.pyi +++ b/DrissionPage/_pages/chromium_frame.pyi @@ -6,13 +6,13 @@ from pathlib import Path from typing import Union, Tuple, List, Any -from DrissionPage._elements.chromium_element import ChromiumElement, Locations, ChromiumElementStates -from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll -from DrissionPage._pages.chromium_page import ChromiumPage -from DrissionPage._pages.chromium_tab import ChromiumTab -from DrissionPage._pages.web_page import WebPage -from DrissionPage._units.setter import ChromiumFrameSetter -from DrissionPage._units.waiter import FrameWaiter +from .chromium_base import ChromiumBase, ChromiumPageScroll +from .chromium_page import ChromiumPage +from .chromium_tab import ChromiumTab +from .web_page import WebPage +from .._elements.chromium_element import ChromiumElement, Locations, ChromiumElementStates +from .._units.setter import ChromiumFrameSetter +from .._units.waiter import FrameWaiter class ChromiumFrame(ChromiumBase): diff --git a/DrissionPage/_pages/chromium_page.py b/DrissionPage/_pages/chromium_page.py index 33f343b..64ed600 100644 --- a/DrissionPage/_pages/chromium_page.py +++ b/DrissionPage/_pages/chromium_page.py @@ -8,14 +8,14 @@ from time import perf_counter, sleep from requests import get -from DrissionPage._base.browser import Browser -from DrissionPage._base.chromium_driver import ChromiumDriver -from DrissionPage._commons.browser import connect_browser -from DrissionPage._configs.chromium_options import ChromiumOptions -from DrissionPage._pages.chromium_base import ChromiumBase, Timeout -from DrissionPage._pages.chromium_tab import ChromiumTab -from DrissionPage._units.setter import ChromiumPageSetter -from DrissionPage._units.waiter import ChromiumPageWaiter +from .._base.browser import Browser +from .._base.chromium_driver import ChromiumDriver +from .._commons.browser import connect_browser +from .._configs.chromium_options import ChromiumOptions +from .._pages.chromium_base import ChromiumBase, Timeout +from .._pages.chromium_tab import ChromiumTab +from .._units.setter import ChromiumPageSetter +from .._units.waiter import ChromiumPageWaiter class ChromiumPage(ChromiumBase): diff --git a/DrissionPage/_pages/chromium_page.pyi b/DrissionPage/_pages/chromium_page.pyi index 884a452..9f55304 100644 --- a/DrissionPage/_pages/chromium_page.pyi +++ b/DrissionPage/_pages/chromium_page.pyi @@ -5,13 +5,13 @@ """ from typing import Union, Tuple, List, Optional -from DrissionPage._base.browser import Browser -from DrissionPage._pages.chromium_base import ChromiumBase -from DrissionPage._base.chromium_driver import ChromiumDriver -from DrissionPage._pages.chromium_tab import ChromiumTab -from DrissionPage._configs.chromium_options import ChromiumOptions -from DrissionPage._units.setter import ChromiumPageSetter -from DrissionPage._units.waiter import ChromiumPageWaiter +from .._base.browser import Browser +from .._pages.chromium_base import ChromiumBase +from .._base.chromium_driver import ChromiumDriver +from .._pages.chromium_tab import ChromiumTab +from .._configs.chromium_options import ChromiumOptions +from .._units.setter import ChromiumPageSetter +from .._units.waiter import ChromiumPageWaiter class ChromiumPage(ChromiumBase): diff --git a/DrissionPage/_pages/chromium_tab.py b/DrissionPage/_pages/chromium_tab.py index 6e44f6d..f5d6cff 100644 --- a/DrissionPage/_pages/chromium_tab.py +++ b/DrissionPage/_pages/chromium_tab.py @@ -5,12 +5,12 @@ """ from copy import copy -from DrissionPage._base.base import BasePage -from DrissionPage._commons.web import set_session_cookies, set_browser_cookies -from DrissionPage._pages.chromium_base import ChromiumBase -from DrissionPage._pages.session_page import SessionPage -from DrissionPage._units.setter import TabSetter, WebPageTabSetter -from DrissionPage._units.waiter import ChromiumTabWaiter +from .._base.base import BasePage +from .._commons.web import set_session_cookies, set_browser_cookies +from .._pages.chromium_base import ChromiumBase +from .._pages.session_page import SessionPage +from .._units.setter import TabSetter, WebPageTabSetter +from .._units.waiter import ChromiumTabWaiter class ChromiumTab(ChromiumBase): diff --git a/DrissionPage/_pages/chromium_tab.pyi b/DrissionPage/_pages/chromium_tab.pyi index 6f19d4b..9bb19a5 100644 --- a/DrissionPage/_pages/chromium_tab.pyi +++ b/DrissionPage/_pages/chromium_tab.pyi @@ -7,16 +7,16 @@ from typing import Union, Tuple, Any, List from requests import Session, Response -from DrissionPage._base.browser import Browser -from DrissionPage._elements.chromium_element import ChromiumElement -from DrissionPage._elements.session_element import SessionElement -from DrissionPage._pages.chromium_base import ChromiumBase -from DrissionPage._pages.chromium_frame import ChromiumFrame -from DrissionPage._pages.chromium_page import ChromiumPage, ChromiumTabRect -from DrissionPage._pages.session_page import SessionPage -from DrissionPage._pages.web_page import WebPage -from DrissionPage._units.setter import TabSetter, WebPageTabSetter -from DrissionPage._units.waiter import ChromiumTabWaiter +from .chromium_base import ChromiumBase +from .chromium_frame import ChromiumFrame +from .chromium_page import ChromiumPage, ChromiumTabRect +from .session_page import SessionPage +from .web_page import WebPage +from .._base.browser import Browser +from .._elements.chromium_element import ChromiumElement +from .._elements.session_element import SessionElement +from .._units.setter import TabSetter, WebPageTabSetter +from .._units.waiter import ChromiumTabWaiter class ChromiumTab(ChromiumBase): diff --git a/DrissionPage/_pages/session_page.py b/DrissionPage/_pages/session_page.py index 846ba9b..5a92319 100644 --- a/DrissionPage/_pages/session_page.py +++ b/DrissionPage/_pages/session_page.py @@ -11,11 +11,11 @@ from requests import Session from requests.structures import CaseInsensitiveDict from tldextract import extract -from DrissionPage._base.base import BasePage -from DrissionPage._commons.web import cookie_to_dict -from DrissionPage._configs.session_options import SessionOptions -from DrissionPage._elements.session_element import SessionElement, make_session_ele -from DrissionPage._units.setter import SessionPageSetter +from .._base.base import BasePage +from .._commons.web import cookie_to_dict +from .._configs.session_options import SessionOptions +from .._elements.session_element import SessionElement, make_session_ele +from .._units.setter import SessionPageSetter class SessionPage(BasePage): diff --git a/DrissionPage/_pages/session_page.pyi b/DrissionPage/_pages/session_page.pyi index 145f122..22f6963 100644 --- a/DrissionPage/_pages/session_page.pyi +++ b/DrissionPage/_pages/session_page.pyi @@ -8,11 +8,11 @@ from typing import Any, Union, Tuple, List from requests import Session, Response from requests.structures import CaseInsensitiveDict -from DrissionPage._base.base import BasePage -from DrissionPage._commons.constants import NoneElement -from DrissionPage._configs.session_options import SessionOptions -from DrissionPage._elements.session_element import SessionElement -from DrissionPage._units.setter import SessionPageSetter +from .._base.base import BasePage +from .._commons.constants import NoneElement +from .._configs.session_options import SessionOptions +from .._elements.session_element import SessionElement +from .._units.setter import SessionPageSetter class SessionPage(BasePage): diff --git a/DrissionPage/_pages/web_page.py b/DrissionPage/_pages/web_page.py index 058ad99..e6b055f 100644 --- a/DrissionPage/_pages/web_page.py +++ b/DrissionPage/_pages/web_page.py @@ -3,13 +3,13 @@ @Author : g1879 @Contact : g1879@qq.com """ -from DrissionPage._base.base import BasePage -from DrissionPage._commons.web import set_session_cookies, set_browser_cookies -from DrissionPage._configs.chromium_options import ChromiumOptions -from DrissionPage._pages.chromium_page import ChromiumPage -from DrissionPage._pages.chromium_tab import WebPageTab -from DrissionPage._units.setter import WebPageSetter +from .chromium_page import ChromiumPage +from .chromium_tab import WebPageTab from .session_page import SessionPage +from .._base.base import BasePage +from .._commons.web import set_session_cookies, set_browser_cookies +from .._configs.chromium_options import ChromiumOptions +from .._units.setter import WebPageSetter class WebPage(SessionPage, ChromiumPage, BasePage): diff --git a/DrissionPage/_pages/web_page.pyi b/DrissionPage/_pages/web_page.pyi index de706f9..ce350da 100644 --- a/DrissionPage/_pages/web_page.pyi +++ b/DrissionPage/_pages/web_page.pyi @@ -7,17 +7,17 @@ from typing import Union, Tuple, List, Any from requests import Session, Response -from ._base import BasePage -from ._chromium_driver import ChromiumDriver -from ._chromium_element import ChromiumElement from .chromium_frame import ChromiumFrame from .chromium_page import ChromiumPage from .chromium_tab import WebPageTab -from ._configs.chromium_options import ChromiumOptions -from ._configs.session_options import SessionOptions -from ._session_element import SessionElement from .session_page import SessionPage -from ._units.setter import WebPageSetter +from .._base.base import BasePage +from .._base.chromium_driver import ChromiumDriver +from .._configs.chromium_options import ChromiumOptions +from .._configs.session_options import SessionOptions +from .._elements.chromium_element import ChromiumElement +from .._elements.session_element import SessionElement +from .._units.setter import WebPageSetter class WebPage(SessionPage, ChromiumPage, BasePage): diff --git a/DrissionPage/_units/action_chains.py b/DrissionPage/_units/action_chains.py index fd733ce..0469bef 100644 --- a/DrissionPage/_units/action_chains.py +++ b/DrissionPage/_units/action_chains.py @@ -5,8 +5,8 @@ """ from time import sleep -from DrissionPage._commons.keys import modifierBit, keyDescriptionForString -from DrissionPage._commons.web import location_in_viewport +from .._commons.keys import modifierBit, keyDescriptionForString +from .._commons.web import location_in_viewport class ActionChains: diff --git a/DrissionPage/_units/action_chains.pyi b/DrissionPage/_units/action_chains.pyi index 83163dd..471c797 100644 --- a/DrissionPage/_units/action_chains.pyi +++ b/DrissionPage/_units/action_chains.pyi @@ -5,9 +5,9 @@ """ from typing import Union, Tuple -from DrissionPage._base.chromium_driver import ChromiumDriver -from DrissionPage._elements.chromium_element import ChromiumElement -from DrissionPage._pages.chromium_base import ChromiumBase +from .._base.chromium_driver import ChromiumDriver +from .._elements.chromium_element import ChromiumElement +from .._pages.chromium_base import ChromiumBase class ActionChains: diff --git a/DrissionPage/_units/browser_download_manager.py b/DrissionPage/_units/browser_download_manager.py index 546076d..0a0518c 100644 --- a/DrissionPage/_units/browser_download_manager.py +++ b/DrissionPage/_units/browser_download_manager.py @@ -1,10 +1,14 @@ # -*- coding:utf-8 -*- +""" +@Author : g1879 +@Contact : g1879@qq.com +""" from os.path import sep from pathlib import Path from shutil import move from time import sleep, perf_counter -from DrissionPage._commons.tools import get_usable_path +from .._commons.tools import get_usable_path class BrowserDownloadManager(object): diff --git a/DrissionPage/_units/browser_download_manager.pyi b/DrissionPage/_units/browser_download_manager.pyi index 0d4b266..c4d640e 100644 --- a/DrissionPage/_units/browser_download_manager.pyi +++ b/DrissionPage/_units/browser_download_manager.pyi @@ -1,8 +1,8 @@ from pathlib import Path from typing import Dict, Optional, Union -from DrissionPage._base.browser import Browser -from DrissionPage._pages.chromium_page import ChromiumPage +from .._base.browser import Browser +from .._pages.chromium_page import ChromiumPage class BrowserDownloadManager(object): diff --git a/DrissionPage/_units/network_listener.py b/DrissionPage/_units/network_listener.py index 220b0d0..c2f49b1 100644 --- a/DrissionPage/_units/network_listener.py +++ b/DrissionPage/_units/network_listener.py @@ -12,7 +12,7 @@ from time import perf_counter, sleep from requests.structures import CaseInsensitiveDict -from DrissionPage.errors import CDPError +from ..errors import CDPError class NetworkListener(object): diff --git a/DrissionPage/_units/network_listener.pyi b/DrissionPage/_units/network_listener.pyi index 3472032..e2b7e7a 100644 --- a/DrissionPage/_units/network_listener.pyi +++ b/DrissionPage/_units/network_listener.pyi @@ -8,8 +8,8 @@ from typing import Union, Dict, List, Iterable, Tuple from requests.structures import CaseInsensitiveDict -from DrissionPage._base.chromium_driver import ChromiumDriver -from DrissionPage._pages.chromium_base import ChromiumBase +from .._base.chromium_driver import ChromiumDriver +from .._pages.chromium_base import ChromiumBase class NetworkListener(object): diff --git a/DrissionPage/_units/setter.py b/DrissionPage/_units/setter.py index 94f2262..8102489 100644 --- a/DrissionPage/_units/setter.py +++ b/DrissionPage/_units/setter.py @@ -7,8 +7,8 @@ from pathlib import Path from requests.structures import CaseInsensitiveDict -from DrissionPage._commons.tools import show_or_hide_browser -from DrissionPage._commons.web import set_browser_cookies, set_session_cookies +from .._commons.tools import show_or_hide_browser +from .._commons.web import set_browser_cookies, set_session_cookies class ChromiumBaseSetter(object): diff --git a/DrissionPage/_units/setter.pyi b/DrissionPage/_units/setter.pyi index 994ad87..989b368 100644 --- a/DrissionPage/_units/setter.pyi +++ b/DrissionPage/_units/setter.pyi @@ -11,13 +11,13 @@ from requests.adapters import HTTPAdapter from requests.auth import HTTPBasicAuth from requests.cookies import RequestsCookieJar -from DrissionPage._elements.chromium_element import ChromiumElement -from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll -from DrissionPage._pages.chromium_frame import ChromiumFrame -from DrissionPage._pages.chromium_page import ChromiumPage -from DrissionPage._pages.chromium_tab import ChromiumTab -from DrissionPage._pages.session_page import SessionPage -from DrissionPage._pages.web_page import WebPage +from .._elements.chromium_element import ChromiumElement +from .._pages.chromium_base import ChromiumBase, ChromiumPageScroll +from .._pages.chromium_frame import ChromiumFrame +from .._pages.chromium_page import ChromiumPage +from .._pages.chromium_tab import ChromiumTab +from .._pages.session_page import SessionPage +from .._pages.web_page import WebPage FILE_EXISTS = Literal['skip', 'rename', 'overwrite', 's', 'r', 'o'] diff --git a/DrissionPage/_units/waiter.py b/DrissionPage/_units/waiter.py index 06a98f8..971e21a 100644 --- a/DrissionPage/_units/waiter.py +++ b/DrissionPage/_units/waiter.py @@ -1,8 +1,8 @@ # -*- coding:utf-8 -*- from time import sleep, perf_counter -from DrissionPage._commons.constants import Settings -from DrissionPage.errors import WaitTimeoutError +from .._commons.constants import Settings +from ..errors import WaitTimeoutError class ChromiumBaseWaiter(object): diff --git a/DrissionPage/_units/waiter.pyi b/DrissionPage/_units/waiter.pyi index a05a921..d9d4441 100644 --- a/DrissionPage/_units/waiter.pyi +++ b/DrissionPage/_units/waiter.pyi @@ -5,11 +5,11 @@ """ from typing import Union -from DrissionPage._elements.chromium_element import ChromiumElement -from DrissionPage._pages.chromium_base import ChromiumBase -from DrissionPage._pages.chromium_frame import ChromiumFrame -from DrissionPage._pages.chromium_page import ChromiumPage from .browser_download_manager import DownloadMission +from .._elements.chromium_element import ChromiumElement +from .._pages.chromium_base import ChromiumBase +from .._pages.chromium_frame import ChromiumFrame +from .._pages.chromium_page import ChromiumPage class ChromiumBaseWaiter(object):