Skip to content
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

Docs and examples update for new API #2659

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

texodus
Copy link
Member

@texodus texodus commented Jul 4, 2024

No description provided.

texodus and others added 4 commits July 9, 2024 00:18
Signed-off-by: Andrew Stein <[email protected]>

# Conflicts:
#	examples/python-tornado/server.py
#	rust/perspective-python/Cargo.toml
#	rust/perspective-python/perspective/__init__.py
Signed-off-by: Andrew Stein <[email protected]>
@texodus texodus force-pushed the psp3-docs-and-examples branch 9 times, most recently from 36af4df to bf7aa8e Compare July 9, 2024 05:18
... await handler.run()
... app.add_api_websocket_route('/websocket', endpoint)
"""

def __init__(self, **kwargs):
self._server = kwargs.pop("perspective_server")
self._websocket = kwargs.pop("websocket")
super().__init__(**kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, also don't need to use kwargs (no inheritance anymore)

... await handler.run()
>>> app = web.Application()
>>> app.router.add_get("/websocket", websocket_handler)
"""

def __init__(self, **kwargs):
self.server = kwargs.pop("perspective_server")
self._request = kwargs.pop("request")
super().__init__(**kwargs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, also don't need to use kwargs (no inheritance anymore)

server = Server()
client = Client.from_server(
server,
loop_callback=lambda fn, *args: TestAsync.loop.add_callback(fn, *args),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these blocks don't need lambdas anymore

# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛


class PerspectiveError(Exception):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #2663 is better overall, allows us to differentiate engine errors from non-engine errors while still catching both

@texodus texodus force-pushed the psp3-docs-and-examples branch 12 times, most recently from df73639 to 7f7a539 Compare July 10, 2024 03:12
Signed-off-by: Andrew Stein <[email protected]>
@texodus texodus force-pushed the psp3-docs-and-examples branch 3 times, most recently from 8d399f4 to 60a2a02 Compare July 10, 2024 03:43
Signed-off-by: Andrew Stein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants