forked from Trygve/otime
Bedre variabelnavn
This commit is contained in:
parent
c717f723b6
commit
6df94a2f0d
14
mtrlog.py
14
mtrlog.py
@ -23,13 +23,13 @@ class MtrLogFormatter:
|
||||
'"%s"' % datetime_extracted.strftime('%d.%m.%y %H:%M:%S.000'))
|
||||
log_line.append(
|
||||
'"%02d.%02d.%02d %02d:%02d:%02d.%03d"' % (
|
||||
msg.timestamp_day(),
|
||||
msg.timestamp_month(),
|
||||
msg.timestamp_year(),
|
||||
msg.timestamp_hours(),
|
||||
msg.timestamp_minutes(),
|
||||
msg.timestamp_seconds(),
|
||||
msg.timestamp_milliseconds()))
|
||||
msg.day(),
|
||||
msg.month(),
|
||||
msg.year(),
|
||||
msg.hours(),
|
||||
msg.minutes(),
|
||||
msg.seconds(),
|
||||
msg.milliseconds()))
|
||||
log_line.append('%06d' % msg.card_id())
|
||||
log_line.append('%04d' % 0) # skipped product week
|
||||
log_line.append('%04d' % 0) # skipped product year
|
||||
|
28
mtrreader.py
28
mtrreader.py
@ -170,25 +170,25 @@ class MtrStatusMessage:
|
||||
def mtr_id(self):
|
||||
return int.from_bytes(self.message_bytes[6:8], 'little')
|
||||
|
||||
def timestamp_year(self):
|
||||
def year(self):
|
||||
return int.from_bytes(self.message_bytes[8:9], 'little')
|
||||
|
||||
def timestamp_month(self):
|
||||
def month(self):
|
||||
return int.from_bytes(self.message_bytes[9:10], 'little')
|
||||
|
||||
def timestamp_day(self):
|
||||
def day(self):
|
||||
return int.from_bytes(self.message_bytes[10:11], 'little')
|
||||
|
||||
def timestamp_hours(self):
|
||||
def hours(self):
|
||||
return int.from_bytes(self.message_bytes[11:12], 'little')
|
||||
|
||||
def timestamp_minutes(self):
|
||||
def minutes(self):
|
||||
return int.from_bytes(self.message_bytes[12:13], 'little')
|
||||
|
||||
def timestamp_seconds(self):
|
||||
def seconds(self):
|
||||
return int.from_bytes(self.message_bytes[13:14], 'little')
|
||||
|
||||
def timestamp_milliseconds(self):
|
||||
def milliseconds(self):
|
||||
return int.from_bytes(self.message_bytes[14:16], 'little')
|
||||
|
||||
def battery_status(self):
|
||||
@ -214,25 +214,25 @@ class MtrDataMessage:
|
||||
def mtr_id(self):
|
||||
return int.from_bytes(self.message_bytes[6:8], 'little')
|
||||
|
||||
def timestamp_year(self):
|
||||
def year(self):
|
||||
return int.from_bytes(self.message_bytes[8:9], 'little')
|
||||
|
||||
def timestamp_month(self):
|
||||
def month(self):
|
||||
return int.from_bytes(self.message_bytes[9:10], 'little')
|
||||
|
||||
def timestamp_day(self):
|
||||
def day(self):
|
||||
return int.from_bytes(self.message_bytes[10:11], 'little')
|
||||
|
||||
def timestamp_hours(self):
|
||||
def hours(self):
|
||||
return int.from_bytes(self.message_bytes[11:12], 'little')
|
||||
|
||||
def timestamp_minutes(self):
|
||||
def minutes(self):
|
||||
return int.from_bytes(self.message_bytes[12:13], 'little')
|
||||
|
||||
def timestamp_seconds(self):
|
||||
def seconds(self):
|
||||
return int.from_bytes(self.message_bytes[13:14], 'little')
|
||||
|
||||
def timestamp_milliseconds(self):
|
||||
def milliseconds(self):
|
||||
return int.from_bytes(self.message_bytes[14:16], 'little')
|
||||
|
||||
def packet_num(self):
|
||||
|
Loading…
Reference in New Issue
Block a user