Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
einfachIrgendwer0815 committed Jul 21, 2023
1 parent 3d146d0 commit d36b882
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/pyotp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def parse_uri(uri: str) -> OTP:
# Encoder (to be filled in later)
encoder = None

# Digits (to be filled in later)
digits = None

# Data we'll parse to the correct constructor
otp_data: Dict[str, Any] = {}

Expand Down Expand Up @@ -90,7 +93,6 @@ def parse_uri(uri: str) -> OTP:
raise ValueError("{} is not a valid parameter".format(key))

if encoder != "steam":
digits = otp_data.get("digits")
if digits is not None and digits not in [6, 7, 8]:
raise ValueError("Digits may only be 6, 7, or 8")

Expand Down
9 changes: 8 additions & 1 deletion src/pyotp/contrib/steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ class Steam(TOTP):
Steam's custom TOTP. Subclass of `pyotp.totp.TOTP`.
"""

def __init__(self, s: str, name: Optional[str] = None, issuer: Optional[str] = None, interval: int = 30, digits: int = 5) -> None:
def __init__(
self,
s: str,
name: Optional[str] = None,
issuer: Optional[str] = None,
interval: int = 30,
digits: int = 5
) -> None:
"""
:param s: secret in base32 format
:param interval: the time interval in seconds for OTP. This defaults to 30.
Expand Down

0 comments on commit d36b882

Please sign in to comment.