Porównaj commity

..

No commits in common. "07ad41960f8fbb63af4bad7998b100580357ad7b" and "1d48e6485359df24a9f52610d8b66565b54e869f" have entirely different histories.

3 zmienionych plików z 21 dodań i 9 usunięć

Wyświetl plik

@ -3,13 +3,28 @@ Helpers for testing.
"""
import time
from typing import Callable, TypeVar
from typing import Any, Callable
T = TypeVar("T")
class MockResponse:
def __init__(self, response_data={}, ok=True, is_redirect=False):
self.response_data = response_data
self.content = response_data
self.ok = ok
self.is_redirect = is_redirect
def raise_for_status(self):
pass
def json(self):
return self.response_data
def run_with_retries(fn: Callable[..., T]) -> T:
def retval(val):
return lambda *args, **kwargs: val
def run_with_retries(fn: Callable[..., Any]):
"""
Run the the given function repeatedly until it finishes without raising an
AssertionError. Sleep a bit between attempts. If the function doesn't
@ -26,4 +41,4 @@ def run_with_retries(fn: Callable[..., T]) -> T:
except AssertionError:
time.sleep(delay)
return fn()
fn()

Wyświetl plik

@ -111,10 +111,7 @@ def bookmarks(
@cli.command()
@click.option(
"--clear", is_flag=True,
help="Dismiss all notifications and exit"
)
@click.option("--clear", help="Dismiss all notifications and exit")
@click.option(
"--reverse", "-r", is_flag=True,
help="Reverse the order of the shown notifications (newest on top)"

Wyświetl plik

@ -219,7 +219,7 @@ def status_lines(status: Status) -> t.Generator[str, None, None]:
reply = f"↲ In reply to {yellow(in_reply_to_id)} " if in_reply_to_id else ""
boost = f"{blue(reblogged_by_acct)} boosted " if reblogged_by else ""
yield f"ID {yellow(status_id)} Visibility: {status.visibility} {reply} {boost}"
yield f"ID {yellow(status_id)} {reply} {boost}"
def html_lines(html: str, width: int) -> t.Generator[str, None, None]: