branch : pmacs2
This commit is contained in:
moculus 2008-09-20 02:11:57 +00:00
parent c44b9d7488
commit b83e0049e0
1 changed files with 8 additions and 12 deletions

View File

@ -6,8 +6,6 @@ from point import Point
from method import Method from method import Method
from subprocess import Popen, PIPE, STDOUT from subprocess import Popen, PIPE, STDOUT
#PAD = ' '
PAD = ''
LIMIT = 79 LIMIT = 79
class ShellExec(Method): class ShellExec(Method):
@ -54,10 +52,9 @@ class ShellExec(Method):
if escaped: if escaped:
escaped.append(c) escaped.append(c)
if c == 'm': if c == 'm':
seq = ''.join(escaped) #seq = ''.join(escaped)
if seq in self.sequences: #if seq in self.sequences:
#output2.append(self.sequences[seq]) # output2.append(self.sequences[seq])
pass
escaped = [] escaped = []
elif c == '\x1b': elif c == '\x1b':
escaped.append(c) escaped.append(c)
@ -84,7 +81,6 @@ class ShellExec(Method):
limit = min(w.width, limit) limit = min(w.width, limit)
if limit == 1000: if limit == 1000:
limit = LIMIT limit = LIMIT
limit -= len(PAD)
if output: if output:
newlines = [] newlines = []
@ -93,19 +89,19 @@ class ShellExec(Method):
line = line.replace('\x1b[01;34m', "[blue:default]") line = line.replace('\x1b[01;34m', "[blue:default]")
line = line.replace('\x1b[01;36m', "[cyan:default]") line = line.replace('\x1b[01;36m', "[cyan:default]")
line = line.replace('\x1b[0m', "[default:default]") line = line.replace('\x1b[0m', "[default:default]")
#line = repr(line)
i = 0 i = 0
while i + limit < len(line): while i + limit < len(line):
j = limit j = limit
while j > 0 and line[i + j] != ' ': while j > 0 and line[i + j] != ' ':
j -= 1 j -= 1
if j == 0: if j == 0:
newlines.append(PAD + line[i:i + limit]) newlines.append(line[i:i + limit])
i += j i += limit
else: else:
newlines.append(PAD + line[i:i + j]) newlines.append(line[i:i + j])
i += j + 1 i += j + 1
newlines.append(PAD + line[i:]) newlines.append(line[i:])
newlines[-1] = '' newlines[-1] = ''
b.insert_lines(b.get_buffer_end(), newlines, force=True) b.insert_lines(b.get_buffer_end(), newlines, force=True)
for w2 in b.windows: for w2 in b.windows: