diff --git a/qhp-download-list.py b/qhp-download-list.py index 8ff2e5d..50360e3 100644 --- a/qhp-download-list.py +++ b/qhp-download-list.py @@ -41,7 +41,7 @@ def main(): s = rawdata.decode('utf-8') tickers = s.split(',') for ticker in tickers: - print(ticker) + print(ticker.strip()) if __name__ == '__main__': main() diff --git a/qhp-hap-transfer.py b/qhp-hap-transfer.py index 2f405d8..5d0cf60 100644 --- a/qhp-hap-transfer.py +++ b/qhp-hap-transfer.py @@ -124,8 +124,10 @@ def upload_data(hap, data, ticker, period): raw_data = serialized_bars.getvalue() + print('Request: ', rq) hap.send_multipart([bytes(json.dumps(rq), "utf-8"), raw_data]) parts = hap.recv_multipart() + print('Response: ', parts[0]) if parts[0] != b'OK': return False return True @@ -140,9 +142,9 @@ def convert_ticker(s, data): current_mon = last_ts.date().month mon = get_month_by_code(s[-2]) if year >= current_year_in_dec: - return s[:-2] + ".{}-{}".format(mon, current_dec + year) + return s[:-2] + "-{}.{}".format(mon, current_dec + year) else: - return s[:-2] + ".{}-{}".format(mon, current_dec + 10 + year) + return s[:-2] + "-{}.{}".format(mon, current_dec + 10 + year) else: return s @@ -205,6 +207,8 @@ def main(): max_retries = 3 for ticker in tickers: + if ticker == "": + continue for trynum in range(0, max_retries): if allow_ticker(blacklist, ticker): print("Requesting ticker from QHP: {}".format(ticker))