From 8de33d0f2466c87bd934069faa60603eb1cce732 Mon Sep 17 00:00:00 2001 From: manetta Date: Mon, 22 Jul 2019 23:36:42 +0200 Subject: [PATCH] tweaking the printer settings, hoping that is will function again --- printer.py | 11 +++++------ readings.py | 2 +- start.py | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/printer.py b/printer.py index c7c721b..e954a6a 100755 --- a/printer.py +++ b/printer.py @@ -102,7 +102,7 @@ def printNow(query, results): print('\n | \n', file=print_pointer, flush=True) sleep(3) - end_line = insert_linebreaks('These are the first 5 results that the algorithm selected.', 35) + end_line = insert_linebreaks('These are the first {} results that the algorithm selected.'.format(results_count), 35) print("\n***\n{}\n***".format(end_line), file=print_pointer, flush=True) print(escpos['paperfeed_1l'], file=print_pointer, flush=True) print(escpos['paperfeed_1l'], file=print_pointer, flush=True) @@ -113,11 +113,10 @@ def printNow(query, results): 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) \ No newline at end of file +if __name__ == '__main__': + query = 'noise' + results, _, _ = readings.request_results(query) + printNow(query, results) \ No newline at end of file diff --git a/readings.py b/readings.py index 7e5f3ca..3172fcf 100644 --- a/readings.py +++ b/readings.py @@ -169,4 +169,4 @@ def request_results(query): return results, filenames, analytics if __name__ == '__main__': - request_results('personal') \ No newline at end of file + request_results('personal') \ No newline at end of file diff --git a/start.py b/start.py index 382b2d7..4eeab08 100644 --- a/start.py +++ b/start.py @@ -8,7 +8,7 @@ import tfidf import readings import printer from manifestos import manifestos -from time import sleep + # Create the application. APP = flask.Flask(__name__) @@ -40,7 +40,7 @@ def index_(): if printer.connected == True: connection = 'connected' else: - connection = 'connected' + connection = 'connected' # hack for the moment if request.args.get('q', ''): results, filenames, analytics = readings.request_results(query) @@ -109,5 +109,5 @@ def favicon(): if __name__ == '__main__': if not 'index.json' in os.listdir('.'): tfidf.create_index() - # APP.debug=True + APP.debug=True APP.run() \ No newline at end of file