# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1234430983 18000 # Node ID 9d9e9ea88daf3202e033eb3894b97a67edbafa39 # Parent 51c15fe803a4e239619197039cb1544b5a53af40 drop unused code diff -r 51c15fe803a4 -r 9d9e9ea88daf cmd2.py --- a/cmd2.py Thu Feb 12 04:27:39 2009 -0500 +++ b/cmd2.py Thu Feb 12 04:29:43 2009 -0500 @@ -153,36 +153,6 @@ writeToPasteBuffer = getPasteBuffer pyparsing.ParserElement.setDefaultWhitespaceChars(' \t') -''' -def parseSearchResults(pattern, s): - generator = pattern.scanString(s) - try: - result, start, stop = generator.next() - result['before'], result['after'] = s[:start], s[stop:] - result['upToIncluding'] = s[:stop] - except StopIteration: - result = pyparsing.ParseResults('') - result['before'] = s - return result -''' - -def replaceInput(source): - if source: - newinput = open(source[0], 'r').read() - else: - newinput = getPasteBuffer() - - try: - if statement.inputFrom: - newinput = open(statement.inputFrom, 'r').read() - else: - newinput = getPasteBuffer() - except (OSError,), e: - print e - return 0 - start, end = self.redirectInPattern.scanString(statement.fullStatement).next()[1:] - return self.onecmd('%s%s%s' % (statement.fullStatement[:start], - newinput, statement.fullStatement[end:])) class ParsedString(str): pass