diff cmd2.py @ 295:f5593299fc2a

debugged snarl in saving .parser
author catherine@bothari
date Sun, 24 Jan 2010 06:59:36 -0500
parents e7c89e34b39b
children ae476b714190
line wrap: on
line diff
--- a/cmd2.py	Fri Jan 22 04:46:15 2010 -0500
+++ b/cmd2.py	Sun Jan 24 06:59:36 2010 -0500
@@ -128,7 +128,7 @@
                 return
             if hasattr(opts, '_exit'):
                 return None
-            if hasattr(arg, 'parser'):
+            if hasattr(arg, 'parsed'):
                 terminator = arg.parsed.terminator
                 try:
                     if arg.parsed.terminator[0] == '\n':
@@ -323,7 +323,7 @@
     reserved_words = []
     feedback_to_output = False          # Do include nonessentials in >, | output
     quiet = False                       # Do not suppress nonessential output
-    debug = False
+    debug = True
     settable = '''
         prompt
         continuation_prompt
@@ -642,6 +642,7 @@
             result['expanded'] = s        
             p = ParsedString(result.clean)
             p.parsed = result
+            p.parser = self.parsed
         for (key, val) in kwargs.items():
             p.parsed[key] = val
         return p
@@ -730,6 +731,7 @@
                 funcname = self.func_named(statement.parsed.command)
                 full_statement = ParsedString(statement.parsed.raw)
                 full_statement.parsed = statement.parsed
+                full_statement.parser = statement.parser
                 if not funcname:
                     return self.postparsing_postcmd(self.default(full_statement))  
                 try: