fix: pylint fixes
All checks were successful
Pylint / Pylint (3.12) (push) Successful in 38s

This commit is contained in:
Seaswimmer 2023-12-21 08:49:31 -05:00
parent a8ef29422d
commit adfe6de1cf
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE
4 changed files with 15 additions and 10 deletions

View file

@ -4,4 +4,6 @@
invalid-name,
too-few-public-methods,
too-many-instance-attributes,
too-many-arguments
too-many-arguments,
too-many-local-variables,
too-many-locals

View file

@ -172,8 +172,8 @@ class User:
embed (Embed): Embed object of the user's embed
totpSecret (Optional[str]): String of the user's TOTP secret
domains (List[str]): List of Strings of the user's domains
oauth (Optional[List[OAuth]] = None): (optional) List of OAuth objects
ratelimit (Optional[datetime] = None): (optional) Datetime object of when the user's ratelimit expires
oauth (Optional[List[OAuth]] = None): List of [OAuth](.#pyzipline.models.OAuth) objects
ratelimit (Optional[datetime] = None): Datetime object of when the user's ratelimit expires
"""
def __init__(
self,
@ -188,7 +188,7 @@ class User:
embed: Embed,
totpSecret: Optional[str],
domains: List[str],
oauth: Optional[List['OAuth']] = [],
oauth: Optional[List['OAuth']] = None,
ratelimit: Optional[datetime] = None,
**kwargs
):
@ -206,6 +206,8 @@ class User:
self.oauth = oauth
self.ratelimit = ratelimit
self.__dict__.update(kwargs)
if self.oauth is not None:
for oauth_entry in self.oauth:
OAuth(**oauth_entry)
self.oauth.append(oauth_entry)
self.oauth.remove(oauth_entry)
o = OAuth(**oauth_entry)
self.oauth.append(o)

View file

@ -1,12 +1,13 @@
"""This is a list of various utility functions used in PyZipline."""
from datetime import datetime
def convert_str_to_datetime(date_string: str) -> datetime:
"""Converts a Zipline date string to a datetime object
Args:
date_string (str): String to convert
date_string: String to convert
Returns:
datetime (datetime): Datetime object
datetime: Datetime object
"""
return datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S.%fZ')

View file

@ -89,7 +89,7 @@ class ZiplineApi:
bool: True if user exists, False if not
"""
data = {'username': username} if invite is None else {'username': username, 'code': invite}
result: Result = self._rest_adapter.post(endpoint=f"user/check", data=data)
result: Result = self._rest_adapter.post(endpoint="user/check", data=data)
if result.status_code == 200:
return False
if result.message == 'username already exists':