Skip to content

Commit

Permalink
enable ruff specific rules
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyheppell committed Jul 10, 2024
1 parent b9fe3ee commit 3b84fdb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ select = [
"PT",
"B",
"UP",
"RUF"
]

ignore = [
Expand Down
16 changes: 9 additions & 7 deletions src/wpextract/dl/requestsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import random
import time
from http.cookies import SimpleCookie
from typing import Union
from typing import Optional, Union

import requests
from requests.adapters import HTTPAdapter
Expand Down Expand Up @@ -163,7 +163,9 @@ def _handle_status(url, status_code, n_tries=None):
class RequestWait:
"""Manages waiting between requests."""

def __init__(self, wait: float = None, random_wait: bool = False):
def __init__(
self, wait: Optional[float] = None, random_wait: Optional[bool] = False
):
"""Create a new waiting instance.
Args:
Expand Down Expand Up @@ -193,11 +195,11 @@ class RequestSession:

def __init__(
self,
proxy: str = None,
cookies: str = None,
authorization: AuthorizationType = None,
timeout: float = 30,
wait: float = None,
proxy: Optional[str] = None,
cookies: Optional[str] = None,
authorization: Optional[AuthorizationType] = None,
timeout: Optional[float] = 30,
wait: Optional[float] = None,
random_wait: bool = False,
max_retries: int = 10,
backoff_factor: float = 0.1,
Expand Down

0 comments on commit 3b84fdb

Please sign in to comment.