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 c8a3321 according to the output
from Black and isort.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Nov 23, 2024
1 parent c8a3321 commit f8923b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions autoRSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ def fun_run(orderObj: stockOrder, command, botObj=None, loop=None):
)
# Add to total sum
totalValue += sum(
account["total"] for account in orderObj.get_logged_in(broker).get_account_totals().values()
account["total"]
for account in orderObj.get_logged_in(broker)
.get_account_totals()
.values()
)
except Exception as ex:
print(traceback.format_exc())
Expand All @@ -208,7 +211,9 @@ def fun_run(orderObj: stockOrder, command, botObj=None, loop=None):

# Print final total value and closing message
if "_holdings" in command:
printAndDiscord(f"Total Value of All Accounts: ${format(totalValue, '0.2f')}", loop)
printAndDiscord(
f"Total Value of All Accounts: ${format(totalValue, '0.2f')}", loop
)
printAndDiscord("All commands complete in all brokers", loop)
else:
print(f"Error: {command} is not a valid command")
Expand Down
4 changes: 3 additions & 1 deletion helperAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ def set_account_totals(self, parent_name: str, account_name: str, total: float):
self.__account_totals[parent_name] = {}
self.__account_totals[parent_name][account_name] = round(float(total), 2)
self.__account_totals[parent_name]["total"] = sum(
value for key, value in self.__account_totals[parent_name].items() if key != "total"
value
for key, value in self.__account_totals[parent_name].items()
if key != "total"
)

def set_account_type(self, parent_name: str, account_name: str, account_type: str):
Expand Down

0 comments on commit f8923b6

Please sign in to comment.