From 1a1f080a847102877651270d319e844ee54b0ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henryk=20Pl=C3=B6tz?= Date: Fri, 14 Dec 2018 02:59:32 +0100 Subject: [PATCH] Add listener parameter to ECR.end_of_day() --- ecrterm/ecr.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ecrterm/ecr.py b/ecrterm/ecr.py index 2a0886e..b4e8ba9 100644 --- a/ecrterm/ecr.py +++ b/ecrterm/ecr.py @@ -228,7 +228,7 @@ class ECR(object): eod_info['terminal-id'] = self.terminal_id return eod_info - def end_of_day(self): + def end_of_day(self, listener=None): """ - sends an end of day packet. - saves the log in `daylog` @@ -238,7 +238,10 @@ class ECR(object): # old_histoire = self.transmitter.history # self.transmitter.history = [] # we send the packet - result = self.transmit(EndOfDay(self.password)) + packet = EndOfDay(self.password) + if listener: + packet.register_response_listener(listener) + result = self.transmit(packet=packet) # now save the log self.daylog = self.last_printout()