@@ -172,7 +172,11 @@ def handle_execute_output(self, content): |
172 | 172 | output = content['data'] |
173 | 173 | execution_count = content['execution_count'] |
174 | 174 | self._vs_backend.execution_count = execution_count + 1 |
175 | | - self._vs_backend.send_prompt('\r\nIn [%d]: ' % (execution_count + 1), ' ' + ('.' * (len(str(execution_count + 1)) + 2)) + ': ', False) |
| 175 | + self._vs_backend.send_prompt( |
| 176 | + '\r\nIn [%d]: ' % (execution_count + 1), |
| 177 | + ' ' + ('.' * (len(str(execution_count + 1)) + 2)) + ': ', |
| 178 | + allow_multiple_statements=True |
| 179 | + ) |
176 | 180 | self.write_data(output, execution_count) |
177 | 181 |
|
178 | 182 | def write_data(self, data, execution_count = None): |
@@ -220,7 +224,11 @@ def handle_error(self, content): |
220 | 224 | def handle_execute_input(self, content): |
221 | 225 | # just a rebroadcast of the command to be executed, can be ignored |
222 | 226 | self._vs_backend.execution_count += 1 |
223 | | - self._vs_backend.send_prompt('\r\nIn [%d]: ' % (self._vs_backend.execution_count), ' ' + ('.' * (len(str(self._vs_backend.execution_count)) + 2)) + ': ', False) |
| 227 | + self._vs_backend.send_prompt( |
| 228 | + '\r\nIn [%d]: ' % (self._vs_backend.execution_count), |
| 229 | + ' ' + ('.' * (len(str(self._vs_backend.execution_count)) + 2)) + ': ', |
| 230 | + allow_multiple_statements=True |
| 231 | + ) |
224 | 232 | pass |
225 | 233 |
|
226 | 234 | def handle_status(self, content): |
@@ -309,13 +317,9 @@ def execute_file_as_main(self, filename, arg_string): |
309 | 317 | self.run_command(code, True) |
310 | 318 |
|
311 | 319 | 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 | | - |
316 | 320 | # we've got a bunch of threads setup for communication, we just block |
317 | 321 | # here until we're requested to exit. |
318 | | - self.send_prompt('\r\nIn [1]: ', ' ...: ', False) |
| 322 | + self.send_prompt('\r\nIn [1]: ', ' ...: ', allow_multiple_statements=True) |
319 | 323 | self.exit_lock.acquire() |
320 | 324 |
|
321 | 325 | def run_command(self, command, silent = False): |
@@ -324,14 +328,17 @@ def run_command(self, command, silent = False): |
324 | 328 | else: |
325 | 329 | self.km.shell_channel.execute(command, silent) |
326 | 330 |
|
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) |
329 | 336 |
|
330 | 337 | def exit_process(self): |
331 | 338 | self.exit_lock.release() |
332 | 339 |
|
333 | 340 | 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""" |
335 | 342 | text = expression + '.' |
336 | 343 | if is_ipython_versionorgreater(3, 0): |
337 | 344 | self.km.complete(text) |
@@ -420,4 +427,4 @@ def do_detach(): |
420 | 427 |
|
421 | 428 | class IPythonBackendWithoutPyLab(IPythonBackend): |
422 | 429 | def get_extra_arguments(self): |
423 | | - return [] |
| 430 | + return [] |