8000 The all-new, pyscript.web (ignore the branch name :) ) by mchilvers · Pull Request #2129 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

The all-new, pyscript.web (ignore the branch name :) ) #2129

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

Merged
merged 39 commits into from
Aug 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d456b37
Minor cleanups: move all Element classes to bottom of module.
mchilvers Jul 24, 2024
73feddd
Commenting.
mchilvers Jul 24, 2024
d09963a
Commenting.
mchilvers Jul 24, 2024
0d3472f
Commenting.
mchilvers Jul 24, 2024
18a2f2b
Group dunder methods.
mchilvers Jul 24, 2024
035e2e1
Don't cache the element's parent.
mchilvers Jul 26, 2024
3714711
Remove style type check until we decide whether or not to add for cla…
mchilvers Jul 29, 2024
7d6f1e9
Add ability to register/unregister element classes.
mchilvers Jul 29, 2024
9e6f65a
Implement __iter__ for container elements.
mchilvers Jul 29, 2024
e2c0b88
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 29, 2024
8110fd7
Minor renaming to make it clear when we have an Element instance vs a…
mchilvers Jul 29, 2024
bef0a90
Merge branch 'mc/pyscript-web-minor-cleanup' of github.com:pyscript/p…
mchilvers Jul 29, 2024
7a066ec
remove duplication: added Element.get_tag_name
mchilvers Jul 29, 2024
24c1e37
Commenting.
mchilvers Jul 29, 2024
ab1178f
Allow Element.append to 1) use *args, 2) accept iterables
mchilvers Jul 29, 2024
52779ba
Remove iterable check - inteferes with js proxies.
mchilvers Jul 29, 2024
73ab702
Don't use *args, so it quacks more like a list ;)
mchilvers Jul 29, 2024
395c785
Element.append take 2 :)
mchilvers Jul 29, 2024
3725f0c
Remove unused code.
mchilvers Jul 29, 2024 < 8000 /span>
fe7f70f
Move to web.py with a page object!
mchilvers Jul 31, 2024
bbee95a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
6e02a84
Added 'page.title' too :)
mchilvers Jul 31, 2024
38d147b
Merge branch 'mc/pyscript-web-minor-cleanup' of github.com:pyscript/p…
mchilvers Jul 31, 2024
ef94e29
Add __getitem__ as a shortcut for page.find
mchilvers Jul 31, 2024
b9b239b
Add Element.__getitem__ to be consistent
mchilvers Jul 31, 2024
ef4a185
Make __getitem__ consistent for Page, Element and ElementCollection.
mchilvers Jul 31, 2024
0d9b1fb
Docstringing.
mchilvers Jul 31, 2024
1eed03a
Docstringing.
mchilvers Jul 31, 2024
47bbf32
Docstringing/commenting.
mchilvers Jul 31, 2024
fb63c6c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
e5a84b9
fix select.add (revert InnerHTML->html)
mchilvers Jul 31, 2024
61c14fb
Merge branch 'mc/pyscript-web-minor-cleanup' of github.com:pyscript/p…
mchilvers Jul 31, 2024
2efbd8f
Commenting.
mchilvers Jul 31, 2024
d879cea
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 31, 2024
73b32e5
Hand-edit some of the AI :)
mchilvers Jul 31, 2024
2c759e8
Merge branch 'mc/pyscript-web-minor-cleanup' of github.com:pyscript/p…
mchilvers Jul 31, 2024
d4e7d39
Rename ElementCollection.children -> ElementCollection.elements
mchilvers Jul 31, 2024
19ac775
Merge branch 'main' into mc/pyscript-web-minor-cleanup
mchilvers Jul 31, 2024
bd025ec
Remove unnecessary guard.
mchilvers Jul 31, 2024
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
Prev Previous commit
Next Next commit
Add __getitem__ as a shortcut for page.find
  • Loading branch information
mchilvers committed Jul 31, 2024
commit ef94e298577ef63c4633ce9624485d366d342e8f
4 changes: 4 additions & 0 deletions pyscript.core/src/stdlib/pyscript/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,10 @@ def __init__(self):
self.body = Element.wrap_dom_element(document.body)
self.head = Element.wrap_dom_element(document.head)

def __getitem__(self, selector):
"""Shortcut for `page.find`."""
return self.find(selector)

@property
def title(self):
"""Return the page title."""
Expand Down
0