Skip to content

Commit 365319b

Browse files
authored
chore: generate async api (#95)
1 parent ef1f9ce commit 365319b

22 files changed

+3810
-1041
lines changed

buildbots/test-sync-generation.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
newfile="sync.py"
4-
oldfile="playwright/sync.py"
3+
newfile="sync_api.py"
4+
oldfile="playwright/sync_api.py"
55

66
python scripts/generate_sync_api.py > $newfile
77

client.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

playwright/__init__.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,23 @@
1414

1515
import playwright.helper as helper
1616
from playwright._repo_version import version as __version__ # noqa:F401
17-
from playwright.main import playwright_async
18-
from playwright.sync import Playwright
17+
from playwright.async_api import Playwright as AsyncPlaywright
18+
from playwright.main import playwright_impl
19+
from playwright.sync_api import Playwright as SyncPlaywright
1920

20-
playwright = Playwright(playwright_async)
21-
chromium = playwright.chromium
22-
firefox = playwright.firefox
23-
webkit = playwright.webkit
24-
devices = playwright.devices
25-
selectors = playwright.selectors
21+
playwright_sync = SyncPlaywright(playwright_impl)
22+
playwright_async = AsyncPlaywright(playwright_impl)
23+
24+
chromium = playwright_async.chromium
25+
firefox = playwright_async.firefox
26+
webkit = playwright_async.webkit
27+
devices = playwright_async.devices
28+
selectors = playwright_async.selectors
2629
Error = helper.Error
2730
TimeoutError = helper.TimeoutError
2831

2932
__all__ = [
30-
"playwright",
31-
"chromium",
33+
"playwright_sync",
3234
"firefox",
3335
"webkit",
3436
"devices",

playwright/accessibility.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def _ax_node_from_protocol(axNode: Dict[str, Any]) -> Dict[str, Any]:
5555
class Accessibility:
5656
def __init__(self, channel: Channel) -> None:
5757
self._channel = channel
58-
self._sync_owner: Any = None
5958

6059
async def snapshot(
6160
self, interestingOnly: bool = True, root: ElementHandle = None

0 commit comments

Comments
 (0)