From f68ffa67332992a6424338a8ff4a160eef192ab9 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 9 Aug 2019 11:17:02 +1000 Subject: [PATCH] wacom: pass the timestamp in seconds down parse_pen_data We don't carea about the struct time here Signed-off-by: Peter Hutterer --- tuhi/wacom.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tuhi/wacom.py b/tuhi/wacom.py index d1bcd91..07c5e8c 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -864,13 +864,11 @@ class WacomProtocolBase(WacomProtocolLowLevelComm): def parse_pen_data(self, data, timestamp): ''' - :param timestamp: a tuple with 9 entries, corresponding to the - local time + :param timestamp: seconds since UNIX epoch ''' x, y, p = 0, 0, 0 dx, dy, dp = 0, 0, 0 - timestamp = int(calendar.timegm(timestamp)) stroke = None success, offset = self.parse_pen_data_prefix(data) @@ -926,13 +924,12 @@ class WacomProtocolBase(WacomProtocolLowLevelComm): transaction_count = 0 while self.is_data_available(): count, timestamp = self.get_stroke_data() - t = time.gmtime(timestamp) - logger.info(f'receiving {count} bytes drawn on UTC {time.strftime("%y%m%d%H%M%S", t)}') + logger.info(f'receiving {count} bytes drawn on UTC {time.strftime("%y%m%d%H%M%S", time.gmtime(timestamp))}') self.start_reading() pen_data = self.wait_for_end_read() str_pen = binascii.hexlify(bytes(pen_data)) logger.info(f'received {str_pen}') - drawing = self.parse_pen_data(pen_data, t) + drawing = self.parse_pen_data(pen_data, timestamp) if drawing: self.emit('drawing', drawing) self.ack_transaction()