From b21e506fe39b5c2f036d33691fdaf11093c08f7a Mon Sep 17 00:00:00 2001 From: manetta Date: Thu, 14 Mar 2019 17:29:35 +0100 Subject: [PATCH] debug --- printer.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/printer.py b/printer.py index 084bc99..83100b2 100755 --- a/printer.py +++ b/printer.py @@ -61,7 +61,7 @@ def printNow(query, results): results_count = 0 for x, document in results.items(): for n, sentence in enumerate(document['matches']): - if results_count < 4: + if results_count <= 4: results_count += 1 sentence = str(sentence) # Turn Flask Markup object back to normal python string sentence = char_swap(sentence) @@ -102,8 +102,6 @@ def printNow(query, results): print('\n | \n', file=print_pointer, flush=True) sleep(3) - current_count += 1 - end_line = insert_linebreaks('These are the first 5 results that the algorithm selected.', 35) print("\n\n{}\n".format(end_line), file=print_pointer, flush=True) print(escpos['paperfeed_1l'], file=print_pointer, flush=True) @@ -113,16 +111,13 @@ def printNow(query, results): print(escpos['papercut'], file=print_pointer, flush=True) print(escpos['reset'], file=print_pointer, flush=True) - # reset when all results are printed - if printed == False: - results_count = 0 - # printNow(query, results, results_count) except: + # print('test') e = sys.exc_info()[0] print("Could not print: {}".format(e)) # query = 'noise' # results, _, _ = readings.request_results(query) # pprint(results) -# printNow(query, results, 0) \ No newline at end of file +# printNow(query, results) \ No newline at end of file