File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 22from ctypes import *
33import struct
44import numpy as np
5+
6+
7+ class classproperty (object ):
8+ def __init__ (self , f ):
9+ self .f = f
10+
11+ def __get__ (self , obj , owner ):
12+ return self .f (owner )
13+
514import numpy .typing
615from .common import (
716 CBPacketType ,
Original file line number Diff line number Diff line change 11from ctypes import *
22
33
4+ from ..abstract import classproperty
5+
6+
47class CBPacketHeader (Structure ):
58 _pack_ = 1
69 _fields_ = [
@@ -13,7 +16,6 @@ class CBPacketHeader(Structure):
1316 ), # Number of 32-bit elements in packet body. * 4 to get number of bytes.
1417 ]
1518
16- @classmethod
17- @property
19+ @classproperty
1820 def HEADER_FORMAT (cls ):
1921 return "<LHBB"
Original file line number Diff line number Diff line change 11from ctypes import *
2+ from ..abstract import classproperty
23
34
45class CBPacketHeader (Structure ):
@@ -15,7 +16,6 @@ class CBPacketHeader(Structure):
1516 ("reserved" , 2 * c_uint8 ),
1617 ]
1718
18- @classmethod
19- @property
19+ @classproperty
2020 def HEADER_FORMAT (cls ):
2121 return "<QHBHBH"
Original file line number Diff line number Diff line change 11from ctypes import *
2+ from ..abstract import classproperty
23from ..common import print_pretty
34
45
@@ -17,7 +18,6 @@ class CBPacketHeader(Structure):
1718 ("reserved" , c_uint8 ), # Changed in this version; used to be 2 * c_uint8
1819 ]
1920
20- @classmethod
21- @property
21+ @classproperty
2222 def HEADER_FORMAT (cls ):
2323 return "<QHHHBB"
You can’t perform that action at this time.
0 commit comments