File tree Expand file tree Collapse file tree
Investoscope Updater.app/Contents/Resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,8 +100,14 @@ def ticker_known(ticker):
100100 if 'itemCount' in data and data ['itemCount' ] == 0 :
101101 return None
102102
103+ # Get max score
104+ max_score = max ([item ['score' ] for item in data ['items' ][:]])
105+
106+ if max_score == 0 :
107+ return None
108+
103109 # Exact match is a score of 1000
104- if data ['items' ][0 ]['score' ] != 1000 :
110+ if data ['items' ][0 ]['score' ] != max_score :
105111 return None
106112
107113 return ticker
Original file line number Diff line number Diff line change @@ -19,3 +19,5 @@ if hash $PYTHON 2>/dev/null; then
1919else
2020 echo " ALERT:Error|You don't have python3 in folder /usr/local/bin!"
2121fi
22+
23+ sleep 3
Original file line number Diff line number Diff line change @@ -30,11 +30,18 @@ def get_quote(item):
3030 while provider_idx < len (providers ):
3131 provider = providers [provider_idx ]
3232 try :
33- data = provider .gen_historical_data_csv (item )
33+ # Permit the update scripts to modify the item
34+ item_copy = copy .deepcopy (item )
35+ data = provider .gen_historical_data_csv (item_copy )
3436
3537 # Errors associated with other non-specific problems
3638 except IndexError :
3739 pass
40+
41+ except Exception as ex :
42+ template = "An exception of type {0} occurred. Arguments:\n {1!r}"
43+ message = template .format (type (ex ).__name__ , ex .args )
44+ print (message )
3845
3946 if data is not None :
4047 return data
You can’t perform that action at this time.
0 commit comments