fixed iperl stuff

--HG--
branch : pmacs2
This commit is contained in:
moculus 2009-03-16 15:18:48 +00:00
parent 551589644d
commit e2ef7c927f
2 changed files with 15 additions and 14 deletions

View File

@ -69,15 +69,11 @@ class Application(object):
except:
color.default_color = False
# this is how we can change color settings
if curses.can_change_color():
#curses.init_color(curses.COLOR_YELLOW, 222, 400, 900)
#curses.init_color(curses.COLOR_GREEN, 222, 400, 900)
#curses.init_color(curses.COLOR_RED, 222, 400, 222)
pass
else:
#raise Exception("urk")
self.set_error("Dynamic color not available")
## this is how we can change color settings
#if curses.can_change_color():
# pass
#else:
# self.set_error("Dynamic color not available")
color.init()
# initialize our modes

View File

@ -453,6 +453,7 @@ class InterpreterBuffer(Buffer):
env = dict(os.environ)
env.update(self.get_env())
f = open('/dev/null', 'w')
#f = open('pipe-errors', 'w')
self.pipe = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=f, env=env)
self.prompt = '***'
self.clear()
@ -496,10 +497,13 @@ class InterpreterBuffer(Buffer):
self.pipe_read()
return candidates
def pipe_read_completions(self):
try:
(typ_, value) = self.pipe_readline()
assert typ_ == 'COMPLETIONS', '%r %r' % (typ_, value)
candidates = [x for x in value.split('|') if x]
return candidates
except:
return []
def clear(self):
self.set_data('', force=True)
def changed(self):
@ -526,7 +530,8 @@ class IperlBuffer(InterpreterBuffer):
else:
return ('iperl', '-p')
def get_env(self):
return {'PERL5LIB': self.application.config.get('perl.lib', '.')}
lib = ':'.join(self.application.config.get('perl.libs', []))
return {'PERL5LIB': lib}
def readline_completions(self, x1, x2, line):
self.pipe.stdin.write("READLINE:%d:%d:%s\n" % (x1, x2, line))
self.pipe.stdin.flush()