comparison cmd2.py @ 56:f844b6c78192 0.3.4.1

fixing (hopefully) broken pipe error for headless systems
author catherine.devlin@gmail.com
date Fri, 27 Jun 2008 09:50:38 -0400
parents a791d615545c
children f583663c610f 683ed678b636
comparison
equal deleted inserted replaced
55:698710e88d1b 56:f844b6c78192
107 xclipproc.stdin.write(teststring) 107 xclipproc.stdin.write(teststring)
108 xclipproc.stdin.close() 108 xclipproc.stdin.close()
109 xclipproc = subprocess.Popen('xclip -o -sel clip', shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE) 109 xclipproc = subprocess.Popen('xclip -o -sel clip', shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
110 if xclipproc.stdout.read() == teststring: 110 if xclipproc.stdout.read() == teststring:
111 can_clip = True 111 can_clip = True
112 except (subprocess.CalledProcessError, OSError): 112 except (subprocess.CalledProcessError, OSError, IOError):
113 pass 113 pass
114 if can_clip: 114 if can_clip:
115 def getPasteBuffer(): 115 def getPasteBuffer():
116 xclipproc = subprocess.Popen('xclip -o -sel clip', shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE) 116 xclipproc = subprocess.Popen('xclip -o -sel clip', shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
117 return xclipproc.stdout.read() 117 return xclipproc.stdout.read()