Skip to content

Commit

Permalink
#83 HTML rendering and key --html were implemented for reports crea…
Browse files Browse the repository at this point in the history
…ted by `--account` key
  • Loading branch information
Tim55667757 committed Nov 21, 2022
1 parent 59cd271 commit 5b9485a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tksbrokerapi/TKSBrokerAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -4510,6 +4510,13 @@ def OverviewAccounts(self, show: bool = False) -> dict:

uLogger.info("User accounts were saved to file: [{}]".format(os.path.abspath(self.userAccountsFile)))

if self.useHTMLReports:
htmlFilePath = self.userAccountsFile.replace(".md", ".html") if self.userAccountsFile.endswith(".md") else self.userAccountsFile + ".html"
with open(htmlFilePath, "w", encoding="UTF-8") as fH:
fH.write(Template(text=MAIN_INFO_TEMPLATE).render(mainTitle="User accounts", commonCSS=COMMON_CSS, markdown=infoText))

uLogger.info("The report has also been converted to an HTML file: [{}]".format(os.path.abspath(htmlFilePath)))

return view

def OverviewUserInfo(self, show: bool = False) -> dict:
Expand Down

0 comments on commit 5b9485a

Please sign in to comment.