Skip to content
Open
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
38 changes: 0 additions & 38 deletions pywebpush/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,9 @@ def __init__(

:param subscription_info: a dict containing the subscription_info from
the client.
:type subscription_info: dict

:param requests_session: a requests.Session object to optimize requests
to the same client.
:type requests_session: requests.Session

:param verbose: provide verbose feedback
:type verbose: bool

"""

self.verbose = verbose
Expand Down Expand Up @@ -202,7 +196,6 @@ def encode(
:param data: A serialized block of byte data (String, JSON, bit array,
etc.) Make sure that whatever you send, your client knows how
to understand it.
:type data: str
:param content_encoding: The content_encoding type to use to encrypt
the data. Defaults to RFC8188 "aes128gcm". The previous draft-01 is
"aesgcm", however this format is now deprecated.
Expand Down Expand Up @@ -273,13 +266,8 @@ def as_curl(self, endpoint: str, encoded_data: bytes, headers: Dict[str, str]) -
file named `encrypted.data`

:param endpoint: Push service endpoint URL
:type endpoint: basestring
:param encoded_data: byte array of encoded data
:type encoded_data: bytearray
:param headers: Additional headers for the send
:type headers: dict
:returns string

"""
header_list = [
f'-H "{key.lower()}: {val}" \\ \n' for key, val in headers.items()
Expand Down Expand Up @@ -310,13 +298,10 @@ def _prepare_send_data(
:param data: A serialized block of data (see encode() ).
:type data: str
:param headers: A dictionary containing any additional HTTP headers.
:type headers: dict
:param ttl: The Time To Live in seconds for this message if the
recipient is not online. (Defaults to "0", which discards the
message immediately if the recipient is unavailable.)
:type ttl: int
:param content_encoding: ECE content encoding (defaults to "aes128gcm")
:type content_encoding: str
"""
# Encode the data.
if headers is None:
Expand Down Expand Up @@ -453,28 +438,17 @@ def webpush(
`WebPushException`.

:param subscription_info: Provided by the client call
:type subscription_info: dict
:param data: Serialized data to send
:type data: str
:param vapid_private_key: Vapid instance or path to vapid private key PEM \
or encoded str
:type vapid_private_key: Union[Vapid, str]
:param vapid_claims: Dictionary of claims ('sub' required)
:type vapid_claims: dict
:param content_encoding: Optional content type string
:type content_encoding: str
:param curl: Return as "curl" string instead of sending
:type curl: bool
:param timeout: POST requests timeout
:type timeout: float
:param ttl: Time To Live
:type ttl: int
:param verbose: Provide verbose feedback
:type verbose: bool
:return requests.Response or string
:param headers: Dictionary of extra HTTP headers to include
:type headers: dict

"""
if headers is None:
headers = dict()
Expand Down Expand Up @@ -588,30 +562,18 @@ async def send_notification():
`WebPushException`.

:param subscription_info: Provided by the client call
:type subscription_info: dict
:param data: Serialized data to send
:type data: str
:param vapid_private_key: Vapid instance or path to vapid private key PEM \
or encoded str
:type vapid_private_key: Union[Vapid, str]
:param vapid_claims: Dictionary of claims ('sub' required)
:type vapid_claims: dict
:param content_encoding: Optional content type string
:type content_encoding: str
:param curl: Return as "curl" string instead of sending
:type curl: bool
:param timeout: POST requests timeout
:type timeout: float
:param ttl: Time To Live
:type ttl: int
:param verbose: Provide verbose feedback
:type verbose: bool
:param headers: Dictionary of extra HTTP headers to include
:type headers: dict
:param aiohttp_session: Optional aiohttp ClientSession for connection reuse
:type aiohttp_session: aiohttp.ClientSession
:return aiohttp.ClientResponse or string

"""
if headers is None:
headers = dict()
Expand Down
Loading