##// END OF EJS Templates
Tweak magics.
Gael Varoquaux -
Show More
@@ -38,6 +38,13 b' def xterm_system(command):'
38 # """echo \\"\x1b]0;%s (finished -- press enter to close)\x07\\" ;
38 # """echo \\"\x1b]0;%s (finished -- press enter to close)\x07\\" ;
39 """read foo;"\' """) % (command, command) )
39 """read foo;"\' """) % (command, command) )
40
40
41 def system_call(command):
42 """ Temporary hack for aliases
43 """
44 def my_system_call(args):
45 os.system("%s %s" % (command, args))
46 return my_system_call
47
41 #-------------------------------------------------------------------------------
48 #-------------------------------------------------------------------------------
42 # Frontend class using ipython0 to do the prefiltering.
49 # Frontend class using ipython0 to do the prefiltering.
43 #-------------------------------------------------------------------------------
50 #-------------------------------------------------------------------------------
@@ -59,6 +66,9 b' class PrefilterFrontEnd(LineFrontEndBase):'
59 # Make sure the raw system call doesn't get called, as we don't
66 # Make sure the raw system call doesn't get called, as we don't
60 # have a stdin accessible.
67 # have a stdin accessible.
61 self._ip.system = xterm_system
68 self._ip.system = xterm_system
69 # XXX: Muck around with magics so that they work better
70 # in our environment
71 self.ipython0.magic_ls = system_call('ls -CF')
62 self.shell.output_trap = RedirectorOutputTrap(
72 self.shell.output_trap = RedirectorOutputTrap(
63 out_callback=self.write,
73 out_callback=self.write,
64 err_callback=self.write,
74 err_callback=self.write,
@@ -201,8 +201,6 b' class ConsoleWidget(editwindow.EditWindow):'
201 # an infinit loop
201 # an infinit loop
202 title = self.title_pat.split(text)
202 title = self.title_pat.split(text)
203 if len(title)>1:
203 if len(title)>1:
204 import sys
205 print >>sys.__stderr__, "title :", title
206 self.title = title[-2]
204 self.title = title[-2]
207
205
208 text = self.title_pat.sub('', text)
206 text = self.title_pat.sub('', text)
@@ -216,7 +214,7 b' class ConsoleWidget(editwindow.EditWindow):'
216 self.StartStyling(self.GetLength(), 0xFF)
214 self.StartStyling(self.GetLength(), 0xFF)
217 self.AppendText(text)
215 self.AppendText(text)
218
216
219 if ansi_tag == '0':
217 if ansi_tag not in self.ANSI_STYLES:
220 style = 0
218 style = 0
221 else:
219 else:
222 style = self.ANSI_STYLES[ansi_tag][0]
220 style = self.ANSI_STYLES[ansi_tag][0]
General Comments 0
You need to be logged in to leave comments. Login now