Skip to content

Commit

Permalink
stock fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BKN46 committed Nov 23, 2022
1 parent b7438de commit a2819a2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions toogle/plugins/compose/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ def get_search(text: str):
"北A": "BJ",
}

search_list = [
(classify_map[x["SecurityTypeName"]] + x["Code"], x["Name"])
for x in res.json()["QuotationCodeTable"]["Data"]
if x["SecurityTypeName"] in classify_map.keys()
]
try:
search_list = [
(classify_map[x["SecurityTypeName"]] + x["Code"], x["Name"])
for x in res.json()["QuotationCodeTable"]["Data"]
if x["SecurityTypeName"] in classify_map.keys()
]
except Exception as e:
return []

return search_list

Expand Down Expand Up @@ -197,7 +200,7 @@ def render_report(code: str):
general_report = get_general_info(code)
quarter_report = get_quarter_report(code)
bussiness_info, bussiness_report = get_bussiness(code)
report_range = len(quarter_report) if len(quarter_report) < 3 else 3
report_range = len(quarter_report) if len(quarter_report) < 4 else 4

divide = "-" * 70 + "\n"

Expand Down

0 comments on commit a2819a2

Please sign in to comment.