From eb4b4016a9bbf9fa9595ae1571ddaa906dffd3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Wed, 27 Dec 2017 12:00:20 +0100 Subject: [PATCH] formatting --- gex/TinyFrame.py | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/gex/TinyFrame.py b/gex/TinyFrame.py index caab40b..53aa3b3 100644 --- a/gex/TinyFrame.py +++ b/gex/TinyFrame.py @@ -1,18 +1,3 @@ -class TF_Msg: - def __init__(self, id=0, type=0, data=None): - self.data = data if data is not None else bytearray() - self.type = type - self.id = id - - def __str__(self): - return f"ID {self.id:X}h, type {self.type:X}h, body: {self.data}" - -class TF: - STAY = 'STAY' - RENEW = 'RENEW' - CLOSE = 'CLOSE' - NEXT = 'NEXT' - class TinyFrame: def __init__(self, peer=1): self.write = None # the writer function should be attached here @@ -348,19 +333,18 @@ class TinyFrame: 'fn': lst, } +class TF_Msg: + def __init__(self): + self.data = bytearray() + self.len = 0 + self.type = 0 + self.id = 0 + def __str__(self): + return f"ID {self.id:X}h, type {self.type:X}h, len {self.len:d}, body: {self.data}" - - - - - - - - - - - - - - +class TF: + STAY = 'STAY' + RENEW = 'RENEW' + CLOSE = 'CLOSE' + NEXT = 'NEXT'