Skip to content

Fixed missing docstring & already defined error #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__/
.env
.venv/
.venv/
.env.local
4 changes: 1 addition & 3 deletions computers/base_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
self._playwright.stop()

def get_current_url(self) -> str:
"""Return the current URL of the page."""
return self._page.url

# --- Common "Computer" actions ---
Expand Down Expand Up @@ -130,9 +131,6 @@ def drag(self, path: List[Dict[str, int]]) -> None:
self._page.mouse.move(point["x"], point["y"])
self._page.mouse.up()

def get_current_url(self) -> str:
return self._page.url

# --- Extra browser-oriented actions ---
def goto(self, url: str) -> None:
try:
Expand Down
4 changes: 3 additions & 1 deletion computers/computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ def keypress(self, keys: List[str]) -> None: ...

def drag(self, path: List[Dict[str, int]]) -> None: ...

def get_current_url() -> str: ...
def get_current_url(self) -> str:
"""Return the current URL of the computer."""
...
2 changes: 1 addition & 1 deletion computers/scrapybara.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from playwright.sync_api import sync_playwright, Browser, Page
from utils import BLOCKED_DOMAINS

load_dotenv()
load_dotenv(dotenv_path=".env.local")

CUA_KEY_TO_SCRAPYBARA_KEY = {
"/": "slash",
Expand Down