# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1217430382 14400 # Node ID 416ea36af7891542ecf409959c9a2a80ff09f6f5 # Parent 2176ce84793984b1e0c77f783f5ccd48947b5f85 fixed bug in setting parameters diff -r 2176ce847939 -r 416ea36af789 cmd2.py --- a/cmd2.py Sun Jul 13 07:51:02 2008 -0400 +++ b/cmd2.py Wed Jul 30 11:06:22 2008 -0400 @@ -12,6 +12,10 @@ Parsing commands with `optparse` options (flags) Redirection to file with >, >>; input from file with < +Note that redirection with > and | will only work if `self.stdout.write()` +is used in place of `print`. The standard library's `cmd` module is +written to use `self.stdout.write()`, + - Catherine Devlin, Jan 03 2008 - catherinedevlin.blogspot.com CHANGES: @@ -427,7 +431,7 @@ if paramName not in self.settable: raise NotSettableError currentVal = getattr(self, paramName) - val = cast(currentVal, val.strip(self.terminators)) + val = cast(currentVal, self.parsed(val).unterminated) setattr(self, paramName, val) self.stdout.write('%s - was: %s\nnow: %s\n' % (paramName, currentVal, val)) except (ValueError, AttributeError, NotSettableError), e: