Add listener parameter to ECR.end_of_day()
This commit is contained in:
parent
c8c5be2c6d
commit
1a1f080a84
1 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue