ajaxtermをUTF8対応にするパッチ[Python]
どういう意味で この改変を行ったか覚えていませんが
(たしかどこぞのblogに書いてありました)
メモしておきます
*************** *** 87,95 **** if i==0x0a or (i>32 and i<127) or i>160: self.trhtml+=chr(i) elif i<=32: ! self.trhtml+="\xa0" else: ! self.trhtml+="?" def reset(self,s=""): self.scr=array.array('i',[0x000700]*(self.width*self.height)) self.st=0 --- 87,95 ---- if i==0x0a or (i>32 and i<127) or i>160: self.trhtml+=chr(i) elif i<=32: ! self.trhtml+=" " else: ! self.trhtml+=chr(i) def reset(self,s=""): self.scr=array.array('i',[0x000700]*(self.width*self.height)) self.st=0 *************** *** 342,348 **** span+=chr(c) if i%w==w-1: span+='\n' ! r='<?xml version="1.0" encoding="ISO-8859-1"?><pre class="term">%s</pre>'%r if self.last_html==r: return '<?xml version="1.0"?><idem></idem>' else: --- 342,348 ---- span+=chr(c) if i%w==w-1: span+='\n' ! r='<?xml version="1.0" encoding="UTF-8"?><pre class="term">%s</pre>'%r if self.last_html==r: return '<?xml version="1.0"?><idem></idem>' else: *************** *** 398,404 **** else: sys.stdout.write("Login: ") login=sys.stdin.readline().strip() ! if re.match('^[0-9A-Za-z-_.]+$',login): cmd=['ssh'] cmd+=['-oPreferredAuthentications=keyboard-interactive,password'] cmd+=['-oNoHostAuthenticationForLocalhost=yes'] --- 398,404 ---- else: sys.stdout.write("Login: ") login=sys.stdin.readline().strip() ! if re.match('^[0-9A-Za-z-_. ]+$',login): cmd=['ssh'] cmd+=['-oPreferredAuthentications=keyboard-interactive,password'] cmd+=['-oNoHostAuthenticationForLocalhost=yes'] *************** *** 555,561 **** print 'AjaxTerm at http://localhost:%s/' % o.port at=AjaxTerm(o.cmd,o.index_file) # f=lambda:os.system('firefox http://localhost:%s/&'%o.port) ! qweb.qweb_wsgi_autorun(at,ip='localhost',port=int(o.port),threaded=0,log=o.log,callback_ready=None) at.multi.die() if __name__ == '__main__': --- 555,565 ---- print 'AjaxTerm at http://localhost:%s/' % o.port at=AjaxTerm(o.cmd,o.index_file) # f=lambda:os.system('firefox http://localhost:%s/&'%o.port) ! # qweb.qweb_wsgi_autorun(at,ip='localhost',port=int(o.port),threaded=0,log=o.log,callback_ready=None) ! try: ! qweb.QWebWSGIServer(at,ip='localhost',port=int(o.port),threaded=0,log=o.log).serve_forever() ! except KeyboardInterrupt,e: ! sys.excepthook(*sys.exc_info()) at.multi.die() if __name__ == '__main__':