Commit 5af9dd65 authored by liuzheng712's avatar liuzheng712

delete_require_chardet

parent 3ccf7ada
...@@ -15,4 +15,3 @@ pyinotify==0.9.6 ...@@ -15,4 +15,3 @@ pyinotify==0.9.6
passlib==1.6.5 passlib==1.6.5
argparse==1.4.0 argparse==1.4.0
django_crontab==0.6.0 django_crontab==0.6.0
chardet==2.3.0
\ No newline at end of file
...@@ -10,7 +10,6 @@ import os.path ...@@ -10,7 +10,6 @@ import os.path
import threading import threading
import re import re
import functools import functools
import chardet
from django.core.signals import request_started, request_finished from django.core.signals import request_started, request_finished
import tornado.ioloop import tornado.ioloop
...@@ -412,9 +411,6 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler): ...@@ -412,9 +411,6 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
if self.term.vim_flag: if self.term.vim_flag:
self.term.vim_data += recv self.term.vim_data += recv
try: try:
# print chardet.detect(data)
# if chardet.detect(data)['encoding'] == 'GB2312':
# data = data.decode('gb2312').encode('utf8')
self.write_message(data.decode('utf-8', 'replace')) self.write_message(data.decode('utf-8', 'replace'))
now_timestamp = time.time() now_timestamp = time.time()
self.log_time_f.write('%s %s\n' % (round(now_timestamp-pre_timestamp, 4), len(data))) self.log_time_f.write('%s %s\n' % (round(now_timestamp-pre_timestamp, 4), len(data)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment