Convert from "print ..." to "print(...)"
[hooke.git] / hooke / engine.py
index 4687431356073c9d0c10c6a9f75dc42ea4db4708..f2ab92c0b14723a92e621b9a4e0be6d61871738d 100644 (file)
@@ -1,20 +1,19 @@
-# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
 #
 # This file is part of Hooke.
 #
-# Hooke is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# Hooke is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
-# Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
+# details.
 #
-# You should have received a copy of the GNU Lesser General Public
-# License along with Hooke.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
 
 """The `engine` module provides :class:`CommandEngine` for executing
 :class:`hooke.command.Command`\s.
@@ -46,6 +45,12 @@ class CommandMessage (QueueMessage):
         if arguments == None:
             arguments = {}
         self.arguments = arguments
+        self.explicit_user_call = True
+        """Message is explicitly user-executed.  This is useful for
+        distinguishing auto-generated calls (for which
+        `explicit_user_call` should be `False` such as the GUIs
+        current status requests.
+        """
 
     def __str__(self):
         return str(self.__unicode__())
@@ -57,17 +62,17 @@ class CommandMessage (QueueMessage):
         --------
         >>> from .compat.odict import odict
         >>> cm = CommandMessage('command A')
-        >>> print unicode(cm)
+        >>> print(unicode(cm))
         <CommandMessage command A>
         >>> cm.arguments = odict([('param a','value a'), ('param b', 'value b')])
-        >>> print unicode(cm)
+        >>> print(unicode(cm))
         <CommandMessage command A {param a: value a, param b: value b}>
 
         The parameters are sorted by name, so you won't be surprised
         in any doctests, etc.
 
         >>> cm.arguments = odict([('param b','value b'), ('param a', 'value a')])
-        >>> print unicode(cm)
+        >>> print(unicode(cm))
         <CommandMessage command A {param a: value a, param b: value b}>
         """
         if len(self.arguments) > 0: