comparison cmd2.py @ 397:50acba85cf9e

no xclip >>> output got lost
author catherine.devlin@gmail.com
date Fri, 17 Sep 2010 11:32:36 -0400
parents e60e2c15f026
children 7812e00ff5b1
comparison
equal deleted inserted replaced
396:e60e2c15f026 397:50acba85cf9e
785 self.kept_state = Statekeeper(self, ('stdout',)) 785 self.kept_state = Statekeeper(self, ('stdout',))
786 self.kept_sys = Statekeeper(sys, ('stdout',)) 786 self.kept_sys = Statekeeper(sys, ('stdout',))
787 self.redirect = subprocess.Popen(statement.parsed.pipeTo, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE) 787 self.redirect = subprocess.Popen(statement.parsed.pipeTo, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
788 sys.stdout = self.stdout = self.redirect.stdin 788 sys.stdout = self.stdout = self.redirect.stdin
789 elif statement.parsed.output: 789 elif statement.parsed.output:
790 if (not statement.parsed.outputTo) and (not can_clip):
791 self.perror('Cannot redirect to paste buffer; install ``xclip`` and re-run to enable')
792 return
790 self.kept_state = Statekeeper(self, ('stdout',)) 793 self.kept_state = Statekeeper(self, ('stdout',))
791 self.kept_sys = Statekeeper(sys, ('stdout',)) 794 self.kept_sys = Statekeeper(sys, ('stdout',))
792 if statement.parsed.outputTo: 795 if statement.parsed.outputTo:
793 mode = 'w' 796 mode = 'w'
794 if statement.parsed.output == '>>': 797 if statement.parsed.output == '>>':