Skip to content

Commit

Permalink
Fix code block formatting in docs
Browse files Browse the repository at this point in the history
Fix broken code-block directives in method docs.
  • Loading branch information
tylertian123 committed Oct 8, 2020
1 parent e5cdccb commit 57db85a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pyryver/ryver.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ async def get_object(self, obj_type: typing.Union[str, type], obj_id: int = None
With this method, you can get objects by properties other than ID. The following
example gets one or more objects by display name:
.. code-block:: python
# Note that this will return an array, even if there is only 1 result
user = await ryver.get_object(pyryver.User, filter=f"displayName eq '{name}'")
Expand Down
5 changes: 4 additions & 1 deletion pyryver/ryver_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,9 @@ def on_connection_loss(self, func: typing.Callable[[], typing.Awaitable]):
A simple but typical implementation is shown below for applications that do not
wish to recover:
.. code-block:: python
async with ryver.get_live_session() as session:
@session.on_connection_loss
async def on_connection_loss():
Expand Down Expand Up @@ -572,7 +574,8 @@ def typing(self, to_chat: Chat) -> RyverWSTyping:
Useful for wrapping long running operations to make sure the typing indicator
is kept, like:
.. code:: python3
.. code-block:: python
async with session.typing(chat):
print("do something silly")
await asyncio.sleep(4)
Expand Down
2 changes: 2 additions & 0 deletions pyryver/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ async def retry_until_available(action: typing.Callable[..., typing.Awaitable[_T
For example, this snippet will try to get a message from a chat by ID with a timeout
of 5 seconds, retrying after 1 second if a 404 occurs:
.. code-block:: python
message = await pyryver.retry_until_available(chat.get_message, message_id, timeout=5.0, retry_delay=1.0)
.. note::
Expand Down

0 comments on commit 57db85a

Please sign in to comment.