comparison cmd2.py @ 197:770c77152051

clean out debugging comment
author catherine@dellzilla
date Wed, 25 Feb 2009 14:07:45 -0500
parents 455ebe415d5e
children 12c2d23caf19
comparison
equal deleted inserted replaced
196:f73cde93ce73 197:770c77152051
25 flagReader.py options are still supported for backward compatibility 25 flagReader.py options are still supported for backward compatibility
26 """ 26 """
27 import cmd, re, os, sys, optparse, subprocess, tempfile, pyparsing, doctest 27 import cmd, re, os, sys, optparse, subprocess, tempfile, pyparsing, doctest
28 import unittest, string, datetime 28 import unittest, string, datetime
29 from optparse import make_option 29 from optparse import make_option
30 __version__ = '0.4.5' 30 __version__ = '0.4.6'
31 31
32 class OptionParser(optparse.OptionParser): 32 class OptionParser(optparse.OptionParser):
33 def exit(self, status=0, msg=None): 33 def exit(self, status=0, msg=None):
34 self.values._exit = True 34 self.values._exit = True
35 if msg: 35 if msg:
368 - args: command ends 368 - args: command ends
369 - multilineCommand: multiline 369 - multilineCommand: multiline
370 - terminator: ['\n', '\n'] 370 - terminator: ['\n', '\n']
371 - terminator: ['\n', '\n'] 371 - terminator: ['\n', '\n']
372 ''' 372 '''
373 #outputParser = pyparsing.oneOf(['>>','>'])('output')
374 outputParser = (pyparsing.Literal('>>') | (pyparsing.WordStart() + '>') | pyparsing.Regex('[^=]>'))('output') 373 outputParser = (pyparsing.Literal('>>') | (pyparsing.WordStart() + '>') | pyparsing.Regex('[^=]>'))('output')
375 374
376 terminatorParser = pyparsing.Or([(hasattr(t, 'parseString') and t) or pyparsing.Literal(t) for t in self.terminators])('terminator') 375 terminatorParser = pyparsing.Or([(hasattr(t, 'parseString') and t) or pyparsing.Literal(t) for t in self.terminators])('terminator')
377 stringEnd = pyparsing.stringEnd ^ '\nEOF' 376 stringEnd = pyparsing.stringEnd ^ '\nEOF'
378 self.multilineCommand = pyparsing.Or([pyparsing.Keyword(c, caseless=self.caseInsensitive) for c in self.multilineCommands])('multilineCommand') 377 self.multilineCommand = pyparsing.Or([pyparsing.Keyword(c, caseless=self.caseInsensitive) for c in self.multilineCommands])('multilineCommand')