##// END OF EJS Templates
A few small fixes so ipythonx works, and PEP-8 cleanups I found along the way.
Fernando Perez -
Show More
@@ -382,6 +382,7 b' class InteractiveShell(Component, Magic):'
382 self.hooks.late_startup_hook()
382 self.hooks.late_startup_hook()
383
383
384 def get_ipython(self):
384 def get_ipython(self):
385 """Return the currently running IPython instance."""
385 return self
386 return self
386
387
387 #-------------------------------------------------------------------------
388 #-------------------------------------------------------------------------
@@ -263,7 +263,7 b' def _fixed_getinnerframes(etb, context=1,tb_offset=0):'
263
263
264 _parser = PyColorize.Parser()
264 _parser = PyColorize.Parser()
265
265
266 def _formatTracebackLines(lnum, index, lines, Colors, lvals=None,scheme=None):
266 def _format_traceback_lines(lnum, index, lines, Colors, lvals=None,scheme=None):
267 numbers_width = INDENT_SIZE - 1
267 numbers_width = INDENT_SIZE - 1
268 res = []
268 res = []
269 i = lnum - index
269 i = lnum - index
@@ -781,8 +781,8 b' class VerboseTB(TBTools):'
781 frames.append(level)
781 frames.append(level)
782 else:
782 else:
783 frames.append('%s%s' % (level,''.join(
783 frames.append('%s%s' % (level,''.join(
784 _formatTracebackLines(lnum,index,lines,Colors,lvals,
784 _format_traceback_lines(lnum,index,lines,Colors,lvals,
785 col_scheme))))
785 col_scheme))))
786
786
787 # Get (safely) a string form of the exception info
787 # Get (safely) a string form of the exception info
788 try:
788 try:
@@ -130,7 +130,7 b' class PrefilterFrontEnd(LineFrontEndBase):'
130
130
131
131
132 if not 'banner' in kwargs and self.banner is None:
132 if not 'banner' in kwargs and self.banner is None:
133 self.banner = self.ipython0.BANNER
133 self.banner = self.ipython0.banner
134
134
135 # FIXME: __init__ and start should be two different steps
135 # FIXME: __init__ and start should be two different steps
136 self.start()
136 self.start()
@@ -211,7 +211,7 b' class Interpreter(object):'
211
211
212 #### Public 'Interpreter' interface ########################################
212 #### Public 'Interpreter' interface ########################################
213
213
214 def formatTraceback(self, et, ev, tb, message=''):
214 def format_traceback(self, et, ev, tb, message=''):
215 """Put a formatted version of the traceback into value and reraise.
215 """Put a formatted version of the traceback into value and reraise.
216
216
217 When exceptions have to be sent over the network, the traceback
217 When exceptions have to be sent over the network, the traceback
@@ -375,7 +375,6 b' class Interpreter(object):'
375 exec code in self.user_ns
375 exec code in self.user_ns
376 outflag = 0
376 outflag = 0
377 except SystemExit:
377 except SystemExit:
378 self.resetbuffer()
379 self.traceback_trap.args = sys.exc_info()
378 self.traceback_trap.args = sys.exc_info()
380 except:
379 except:
381 self.traceback_trap.args = sys.exc_info()
380 self.traceback_trap.args = sys.exc_info()
@@ -395,7 +394,7 b' class Interpreter(object):'
395 python = self.translator(python)
394 python = self.translator(python)
396 self.execute_python(python)
395 self.execute_python(python)
397
396
398 def getCommand(self, i=None):
397 def get_command(self, i=None):
399 """Gets the ith message in the message_cache.
398 """Gets the ith message in the message_cache.
400
399
401 This is implemented here for compatibility with the old ipython1 shell
400 This is implemented here for compatibility with the old ipython1 shell
@@ -387,7 +387,7 b' class EngineService(object, service.Service):'
387 # tb=traceback object
387 # tb=traceback object
388 et,ev,tb = sys.exc_info()
388 et,ev,tb = sys.exc_info()
389 # This call adds attributes to the exception value
389 # This call adds attributes to the exception value
390 et,ev,tb = self.shell.formatTraceback(et,ev,tb,msg)
390 et,ev,tb = self.shell.format_traceback(et,ev,tb,msg)
391 # Add another attribute
391 # Add another attribute
392 ev._ipython_engine_info = msg
392 ev._ipython_engine_info = msg
393 f = failure.Failure(ev,et,None)
393 f = failure.Failure(ev,et,None)
@@ -444,7 +444,7 b' class EngineService(object, service.Service):'
444 msg = {'engineid':self.id,
444 msg = {'engineid':self.id,
445 'method':'get_result',
445 'method':'get_result',
446 'args':[repr(i)]}
446 'args':[repr(i)]}
447 d = self.executeAndRaise(msg, self.shell.getCommand, i)
447 d = self.executeAndRaise(msg, self.shell.get_command, i)
448 d.addCallback(self.addIDToResult)
448 d.addCallback(self.addIDToResult)
449 return d
449 return d
450
450
@@ -877,7 +877,7 b' class ThreadedEngineService(EngineService):'
877 # tb=traceback object
877 # tb=traceback object
878 et,ev,tb = sys.exc_info()
878 et,ev,tb = sys.exc_info()
879 # This call adds attributes to the exception value
879 # This call adds attributes to the exception value
880 et,ev,tb = self.shell.formatTraceback(et,ev,tb,msg)
880 et,ev,tb = self.shell.format_traceback(et,ev,tb,msg)
881 # Add another attribute
881 # Add another attribute
882
882
883 # Create a new exception with the new attributes
883 # Create a new exception with the new attributes
@@ -228,9 +228,8 b' class IPTester(object):'
228 except OSError:
228 except OSError:
229 # This is just a best effort, if we fail or the process was
229 # This is just a best effort, if we fail or the process was
230 # really gone, ignore it.
230 # really gone, ignore it.
231 pass
231 pass
232
232
233
234
233
235 def make_runners():
234 def make_runners():
236 """Define the top-level packages that need to be tested.
235 """Define the top-level packages that need to be tested.
General Comments 0
You need to be logged in to leave comments. Login now