Skip to content

Commit

Permalink
Merge pull request #95 from NelsonDane/deepsource-transform-3adb24c4
Browse files Browse the repository at this point in the history
style: format code with Black and isort
  • Loading branch information
NelsonDane authored Oct 10, 2023
2 parents c65be30 + ad6401c commit 7878482
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 7878482

Please sign in to comment.