@@ -172,7 +172,11 @@ def handle_execute_output(self, content):
172172 output = content ['data' ]
173173 execution_count = content ['execution_count' ]
174174 self ._vs_backend .execution_count = execution_count + 1
175- self ._vs_backend .send_prompt ('\r \n In [%d]: ' % (execution_count + 1 ), ' ' + ('.' * (len (str (execution_count + 1 )) + 2 )) + ': ' , False )
175+ self ._vs_backend .send_prompt (
176+ '\r \n In [%d]: ' % (execution_count + 1 ),
177+ ' ' + ('.' * (len (str (execution_count + 1 )) + 2 )) + ': ' ,
178+ allow_multiple_statements = True
179+ )
176180 self .write_data (output , execution_count )
177181
178182 def write_data (self , data , execution_count = None ):
@@ -220,7 +224,11 @@ def handle_error(self, content):
220224 def handle_execute_input (self , content ):
221225 # just a rebroadcast of the command to be executed, can be ignored
222226 self ._vs_backend .execution_count += 1
223- self ._vs_backend .send_prompt ('\r \n In [%d]: ' % (self ._vs_backend .execution_count ), ' ' + ('.' * (len (str (self ._vs_backend .execution_count )) + 2 )) + ': ' , False )
227+ self ._vs_backend .send_prompt (
228+ '\r \n In [%d]: ' % (self ._vs_backend .execution_count ),
229+ ' ' + ('.' * (len (str (self ._vs_backend .execution_count )) + 2 )) + ': ' ,
230+ allow_multiple_statements = True
231+ )
224232 pass
225233
226234 def handle_status (self , content ):
@@ -309,13 +317,9 @@ def execute_file_as_main(self, filename, arg_string):
309317 self .run_command (code , True )
310318
311319 def execution_loop (self ):
312- # launch the startup script if one has been specified
313- if self .launch_file :
314- self .execute_file_as_main (self .launch_file , None )
315-
316320 # we've got a bunch of threads setup for communication, we just block
317321 # here until we're requested to exit.
318- self .send_prompt ('\r \n In [1]: ' , ' ...: ' , False )
322+ self .send_prompt ('\r \n In [1]: ' , ' ...: ' , allow_multiple_statements = True )
319323 self .exit_lock .acquire ()
320324
321325 def run_command (self , command , silent = False ):
@@ -324,14 +328,17 @@ def run_command(self, command, silent = False):
324328 else :
325329 self .km .shell_channel .execute (command , silent )
326330
327- def execute_file (self , filename , args ):
328- self .execute_file_as_main (filename , args )
331+ def execute_file_ex (self , filetype , filename , args ):
332+ if filetype == 'script' :
333+ self .execute_file_as_main (filename , args )
334+ else :
335+ raise NotImplementedError ("Cannot execute %s file" % filetype )
329336
330337 def exit_process (self ):
331338 self .exit_lock .release ()
332339
333340 def get_members (self , expression ):
334- """returns a tuple of the type name, instance members, and type members"""
341+ """returns a tuple of the type name, instance members, and type members"""
335342 text = expression + '.'
336343 if is_ipython_versionorgreater (3 , 0 ):
337344 self .km .complete (text )
@@ -420,4 +427,4 @@ def do_detach():
420427
421428class IPythonBackendWithoutPyLab (IPythonBackend ):
422429 def get_extra_arguments (self ):
423- return []
430+ return []
0 commit comments