@@ -2305,43 +2305,21 @@ def size(self):
23052305 return self ._ptr .size
23062306
23072307
2308- def _make_statusbase ():
2309- """Create base class for Status."""
2310- import numbers
2311-
2312- def redirect (name ):
2313-
2314- def redirected (self , * args ):
2315- return getattr (self ._code , name )(* args )
2316-
2317- return redirected
2318-
2319- names = set (['__gt__' , '__ge__' ])
2320- names .update (numbers .Integral .__abstractmethods__ )
2321- namespace = dict ((name , redirect (name )) for name in names )
2322- namespace .update ({
2323- '__slots__' : '_code' ,
2324- '__init__' : lambda self , code : setattr (self , '_code' , code ),
2325- '__eq__' : lambda self , other : int (self ) == other ,
2326- })
2327- return type ("_StatusBase" , (), namespace )
2328-
2329- _StatusBase = _make_statusbase ()
2330- del _make_statusbase
2331-
2332-
2333- class Status (_StatusBase ):
2308+ class Status (object ):
23342309
23352310 """Representation of the JACK status bits."""
23362311
2337- __slots__ = ()
2312+ __slots__ = '_code'
2313+
2314+ def __init__ (self , code ):
2315+ self ._code = code
23382316
23392317 def __repr__ (self ):
23402318 flags = ", " .join (name for name in dir (self )
23412319 if not name .startswith ('_' ) and getattr (self , name ))
23422320 if not flags :
23432321 flags = "no flags set"
2344- return "<jack.Status 0x{0:X}: {1}>" .format (int ( self ) , flags )
2322+ return "<jack.Status 0x{0:X}: {1}>" .format (self . _code , flags )
23452323
23462324 @property
23472325 def failure (self ):
@@ -2424,10 +2402,10 @@ def client_zombie(self):
24242402
24252403 def _hasflag (self , flag ):
24262404 """Helper function for Status properties."""
2427- return bool (self & flag )
2405+ return bool (self . _code & flag )
24282406
24292407
2430- class TransportState (_StatusBase ):
2408+ class TransportState (object ):
24312409
24322410 """Representation of the JACK transport state.
24332411
@@ -2437,15 +2415,21 @@ class TransportState(_StatusBase):
24372415
24382416 """
24392417
2440- __slots__ = ()
2418+ __slots__ = '_code'
2419+
2420+ def __init__ (self , code ):
2421+ self ._code = code
2422+
2423+ def __eq__ (self , other ):
2424+ return self ._code == other
24412425
24422426 def __repr__ (self ):
24432427 return "jack." + {
24442428 _lib .JackTransportStopped : 'STOPPED' ,
24452429 _lib .JackTransportRolling : 'ROLLING' ,
24462430 _lib .JackTransportStarting : 'STARTING' ,
24472431 _lib .JackTransportNetStarting : 'NETSTARTING' ,
2448- }[int ( self ) ]
2432+ }[self . _code ]
24492433
24502434
24512435class JackError (Exception ):
0 commit comments