-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor by removing the need for find_page_object_overrides()
- Loading branch information
Showing
8 changed files
with
122 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""This package is being used by tests/po_lib to validate some behaviors on | ||
external depedencies. | ||
""" | ||
from typing import Dict, Any, Callable | ||
|
||
from url_matcher import Patterns | ||
|
||
from web_poet import handle_urls | ||
|
||
|
||
class POBase: | ||
expected_overrides: Callable | ||
expected_patterns: Patterns | ||
expected_meta: Dict[str, Any] | ||
|
||
|
||
class POSubLibOverriden: | ||
... | ||
|
||
|
||
@handle_urls("sub_example.com", POSubLibOverriden) | ||
class POSubLib(POBase): | ||
expected_overrides = POSubLibOverriden | ||
expected_patterns = Patterns(["sub_example.com"]) | ||
expected_meta = {} # type: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .pages import WebPage, ItemPage, ItemWebPage, Injectable | ||
from .page_inputs import ResponseData | ||
from .overrides import handle_urls, find_page_object_overrides, PageObjectRegistry | ||
from .overrides import handle_urls, PageObjectRegistry, default_registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.