Commits

Jason R. Coombs committed 04b0b7b

Fixed superclass reference so that PeriodicCommandFixedDelay will be treated as a periodic command.

Comments (0)

Files changed (2)

+7.1.1
+=====
+
+* Fixed regression created in 7.0 where PeriodicCommandFixedDelay would only
+  cause the first command to be scheduled, but not subsequent ones.
+
 7.1
 ===
 
                 if not command.due():
                     break
                 command.function(*command.arguments)
-                if isinstance(command, schedule.PeriodicCommand):
+                if isinstance(command, schedule.PeriodicCommandBase):
                     self._schedule_command(command.next())
                 del self.delayed_commands[0]
 
 
     def _dispatcher(self, connection, event):
         """
-        Dispatch event from connection.
+        Dispatch events to on_<event.type> method, if present.
         """
         log.debug("_dispatcher: %s", event.type)
 
-        m = "on_" + event.type
-        if hasattr(self, m):
-            getattr(self, m)(connection, event)
+        do_nothing = lambda c, e: None
+        method = getattr(self, "on_" + event.type, do_nothing)
+        method(connection, event)
 
     def _dcc_disconnect(self, c, e):
         self.dcc_connections.remove(c)