]> git.llucax.com Git - software/pymin.git/blobdiff - dispatcher.py
Make Host iterable so it can be used as a sequence when serializing.
[software/pymin.git] / dispatcher.py
index addd45f716a3446b5fa0078875328eb2cdf37d5c..0284da5c499b03805babd97caec2dda8fa99c5ab 100644 (file)
@@ -27,7 +27,7 @@ class Error(RuntimeError):
         self.command = command
 
     def __str__(self):
         self.command = command
 
     def __str__(self):
-        return ' '.join(self.command)
+        return 'Command not found: "%s"' % ' '.join(self.command)
 
 class CommandNotFoundError(Error):
     r"""
 
 class CommandNotFoundError(Error):
     r"""
@@ -108,7 +108,7 @@ class Dispatcher:
                 raise CommandNotFoundError(command)
             handler = getattr(handler, route[0])
             route = route[1:]
                 raise CommandNotFoundError(command)
             handler = getattr(handler, route[0])
             route = route[1:]
-        handler(*route)
+        return handler(*route)
 
 
 if __name__ == '__main__':
 
 
 if __name__ == '__main__':