X-Git-Url: http://git.tremily.us/?p=hooke.git;a=blobdiff_plain;f=hooke%2Fcommand_stack.py;h=1307a01f8a011bae83020ab2fe4e66f4c21176fc;hp=d9817be8a72a66328952e4e19efd1b2614a5bc98;hb=877f4a54e497c7052c661bc771065ea545fe61bb;hpb=23bcfd05915a61e3a41d01babd291fd3089ba329 diff --git a/hooke/command_stack.py b/hooke/command_stack.py index d9817be..1307a01 100644 --- a/hooke/command_stack.py +++ b/hooke/command_stack.py @@ -51,7 +51,7 @@ class CommandStack (list): >>> def execute_cmd(hooke, command_message, stack=None): ... cm = command_message - ... print 'EXECUTE', cm.command, cm.arguments + ... print('EXECUTE {} {}'.format(cm.command, cm.arguments)) >>> c.execute_command = execute_cmd >>> c.execute(hooke=None) # doctest: +ELLIPSIS @@ -81,7 +81,7 @@ class CommandStack (list): >>> c.execute_command(hooke=None, command_message=cm) EXECUTE CommandC {'param': 'E'} >>> c.append(cm) - >>> print [repr(cm) for cm in c] # doctest: +NORMALIZE_WHITESPACE + >>> print([repr(cm) for cm in c]) # doctest: +NORMALIZE_WHITESPACE ['', '', '', @@ -113,8 +113,8 @@ class CommandStack (list): >>> import pickle >>> s = pickle.dumps(c) >>> z = pickle.loads(s) - >>> print '\\n'.join([repr(cm) for cm in c] - ... ) # doctest: +NORMALIZE_WHITESPACE, + >>> print('\\n'.join([repr(cm) for cm in c])) + ... # doctest: +NORMALIZE_WHITESPACE @@ -127,7 +127,7 @@ class CommandStack (list): , ]}> >>> import yaml - >>> print yaml.dump(c) # doctest: +REPORT_UDIFF + >>> print(yaml.dump(c)) # doctest: +REPORT_UDIFF !!python/object/new:hooke.command_stack.CommandStack listitems: - !!python/object:hooke.engine.CommandMessage @@ -181,14 +181,14 @@ class CommandStack (list): There is also a convenience function for clearing the stack. >>> c.clear() - >>> print [repr(cm) for cm in c] + >>> print([repr(cm) for cm in c]) [] YAMLize a curve argument. >>> from .curve import Curve >>> c.append(CommandMessage('curve info', {'curve': Curve(path=None)})) - >>> print yaml.dump(c) # doctest: +REPORT_UDIFF + >>> print(yaml.dump(c)) # doctest: +REPORT_UDIFF !!python/object/new:hooke.command_stack.CommandStack listitems: - !!python/object:hooke.engine.CommandMessage @@ -306,7 +306,7 @@ class FileCommandStack (CommandStack): >>> c.append(CommandMessage('CommandB', {'param':'B'})) >>> c.append(CommandMessage('CommandA', {'param':'C'})) >>> c.append(CommandMessage('CommandB', {'param':'D'})) - >>> print c.flatten() + >>> print(c.flatten()) - arguments: {param: A} command: CommandA - arguments: {param: B} @@ -339,7 +339,7 @@ class FileCommandStack (CommandStack): ... ''' >>> c = FileCommandStack() >>> c.from_string(string) - >>> print [repr(cm) for cm in c] # doctest: +NORMALIZE_WHITESPACE + >>> print([repr(cm) for cm in c]) # doctest: +NORMALIZE_WHITESPACE ['', '', '',