Skip to content

Commit

Permalink
style: format code with Black and isort
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in c65be30 according to the output
from Black and isort.

Details: #93
  • Loading branch information
deepsource-autofix[bot] authored Oct 10, 2023
1 parent c65be30 commit ad6401c
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions helperAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ def __init__(self, name):
self.__account_numbers: dict = (
{}
) # Dictionary of account names and numbers under parent
self.__logged_in_objects: dict = {} # Dictionary of logged in objects under parent
self.__logged_in_objects: dict = (
{}
) # Dictionary of logged in objects under parent
self.__holdings: dict = {} # Dictionary of holdings under parent
self.__account_totals: dict = {} # Dictionary of account totals
self.__account_types: dict = {} # Dictionary of account types
Expand All @@ -197,15 +199,24 @@ def set_account_number(self, parent_name: str, account_number: str):
self.__account_numbers[parent_name] = []
self.__account_numbers[parent_name].append(account_number)

def set_logged_in_object(self, parent_name: str, logged_in_object, account_name: str = None):
def set_logged_in_object(
self, parent_name: str, logged_in_object, account_name: str = None
):
if parent_name not in self.__logged_in_objects:
self.__logged_in_objects[parent_name] = {}
if account_name is None:
self.__logged_in_objects[parent_name] = logged_in_object
else:
self.__logged_in_objects[parent_name][account_name] = logged_in_object

def set_holdings(self, parent_name: str, account_name: str, stock: str, quantity: float, price: float):
def set_holdings(
self,
parent_name: str,
account_name: str,
stock: str,
quantity: float,
price: float,
):
quantity = 0 if quantity == "N/A" else quantity
price = 0 if price == "N/A" else price
if parent_name not in self.__holdings:
Expand Down Expand Up @@ -241,7 +252,9 @@ def get_account_numbers(self, parent_name: str = None) -> list or dict:
return self.__account_numbers
return self.__account_numbers.get(parent_name, [])

def get_logged_in_objects(self, parent_name: str = None, account_name: str = None) -> dict:
def get_logged_in_objects(
self, parent_name: str = None, account_name: str = None
) -> dict:
if parent_name is None:
return self.__logged_in_objects
if account_name is None:
Expand All @@ -255,7 +268,9 @@ def get_holdings(self, parent_name: str = None, account_name: str = None) -> dic
return self.__holdings.get(parent_name, {})
return self.__holdings.get(parent_name, {}).get(account_name, {})

def get_account_totals(self, parent_name: str = None, account_name: str = None) -> dict:
def get_account_totals(
self, parent_name: str = None, account_name: str = None
) -> dict:
if parent_name is None:
return self.__account_totals
if account_name is None:
Expand Down

0 comments on commit ad6401c

Please sign in to comment.