Removed unused code from the Dispatcher
This commit is contained in:
parent
620d102ac5
commit
0a1ef72c0d
|
@ -186,8 +186,8 @@ class Dispatcher(type):
|
||||||
hosted = {}
|
hosted = {}
|
||||||
|
|
||||||
def __init__(cls, name, bases, dct):
|
def __init__(cls, name, bases, dct):
|
||||||
dispatchable = Dispatcher.check_if_dispatchable(bases, dct)
|
Dispatcher.check_if_dispatchable(bases, dct)
|
||||||
hostable = Dispatcher.check_if_hostable(bases, dct)
|
Dispatcher.check_if_hostable(bases, dct)
|
||||||
|
|
||||||
if Dispatcher.is_suitable(cls, dct):
|
if Dispatcher.is_suitable(cls, dct):
|
||||||
Dispatcher.register_processor(cls)
|
Dispatcher.register_processor(cls)
|
||||||
|
@ -208,22 +208,20 @@ class Dispatcher(type):
|
||||||
def check_if_dispatchable(cls, bases, dct):
|
def check_if_dispatchable(cls, bases, dct):
|
||||||
dispatcher = dct.get('DISPATCHED_BY')
|
dispatcher = dct.get('DISPATCHED_BY')
|
||||||
if not dispatcher:
|
if not dispatcher:
|
||||||
return False
|
return
|
||||||
if dispatcher not in bases:
|
if dispatcher not in bases:
|
||||||
raise CommandInternalError("Should be dispatched by the same processor it inherits from")
|
raise CommandInternalError("Should be dispatched by the same processor it inherits from")
|
||||||
return True
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def check_if_hostable(cls, bases, dct):
|
def check_if_hostable(cls, bases, dct):
|
||||||
hosters = dct.get('HOSTED_BY')
|
hosters = dct.get('HOSTED_BY')
|
||||||
if not hosters:
|
if not hosters:
|
||||||
return False
|
return
|
||||||
if not isinstance(hosters, (TupleType, ListType)):
|
if not isinstance(hosters, (TupleType, ListType)):
|
||||||
hosters = (hosters,)
|
hosters = (hosters,)
|
||||||
for hoster in hosters:
|
for hoster in hosters:
|
||||||
if hoster not in bases:
|
if hoster not in bases:
|
||||||
raise CommandInternalError("Should be hosted by the same processors it inherits from")
|
raise CommandInternalError("Should be hosted by the same processors it inherits from")
|
||||||
return True
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def check_if_conformed(cls, dispatchable, hostable):
|
def check_if_conformed(cls, dispatchable, hostable):
|
||||||
|
|
Loading…
Reference in New Issue