diff cmd2.py @ 401:3397b9c199f5

added postparse
author catherine.devlin@gmail.com
date Tue, 21 Sep 2010 15:25:56 -0400
parents 2fccf9c87fe7
children be18c88a0fc8
line wrap: on
line diff
--- a/cmd2.py	Mon Sep 20 00:59:39 2010 -0400
+++ b/cmd2.py	Tue Sep 21 15:25:56 2010 -0400
@@ -702,7 +702,9 @@
     
     def preparse(self, raw, **kwargs):
         return raw
-    
+    def postparse(self, parseResult):
+        return parseResult
+   
     def parsed(self, raw, **kwargs):
         if isinstance(raw, ParsedString):
             p = raw
@@ -718,6 +720,7 @@
             result = self.parser.parseString(s)
             result['raw'] = raw            
             result['command'] = result.multilineCommand or result.command        
+            result = self.postparse(result)
             p = ParsedString(result.args)
             p.parsed = result
             p.parser = self.parsed