changeset 84:416ea36af789 0.3.5

fixed bug in setting parameters
author catherine@Elli.myhome.westell.com
date Wed, 30 Jul 2008 11:06:22 -0400
parents 2176ce847939
children b04845faae0c
files cmd2.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: