Browse Source

tweaking the printer settings, hoping that is will function again

master
manetta 5 years ago
parent
commit
8de33d0f24
  1. 11
      printer.py
  2. 2
      readings.py
  3. 6
      start.py

11
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)
if __name__ == '__main__':
query = 'noise'
results, _, _ = readings.request_results(query)
printNow(query, results)

2
readings.py

@ -169,4 +169,4 @@ def request_results(query):
return results, filenames, analytics
if __name__ == '__main__':
request_results('personal')
request_results('personal')

6
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()
Loading…
Cancel
Save