[1] I see that you're runing gpg: do we need to add a dependency for it?
[2] + def __init__(self): + self._package_store = None
It should still upcall init for future use. You can also remove the init completely here and set a class attribute.
[3] + def handle_message(self, message): + """Queue C{message} as a task, and spawn the proper handler.""" + if message["type"] == "change-packages": + cls = PackageChanger + if message["type"] == "release-upgrade": + cls = ReleaseUpgrader
I think you should create 2 different methods for not having to do an if, and use that in register_message. Something like that:
def handle_changer return _handle(PackageChanger, message) def handle_upgrade return _handle(ReleaseUpgrader, message)
[4] + if cls == PackageChanger: + return find_changer_command() + if cls == ReleaseUpgrader: + return find_release_upgrader_command()
In the same spirit, what about adding a find_command on those classes?
+1!
[1] I see that you're runing gpg: do we need to add a dependency for it?
[2]
+ def __init__(self):
+ self._package_store = None
It should still upcall init for future use. You can also remove the init completely here and set a class attribute.
[3] message( self, message):
+ def handle_
+ """Queue C{message} as a task, and spawn the proper handler."""
+ if message["type"] == "change-packages":
+ cls = PackageChanger
+ if message["type"] == "release-upgrade":
+ cls = ReleaseUpgrader
I think you should create 2 different methods for not having to do an if, and use that in register_message. Something like that:
def handle_changer PackageChanger, message) ReleaseUpgrader , message)
return _handle(
def handle_upgrade
return _handle(
[4] command( ) upgrader_ command( )
+ if cls == PackageChanger:
+ return find_changer_
+ if cls == ReleaseUpgrader:
+ return find_release_
In the same spirit, what about adding a find_command on those classes?
+1!