Show More
@@ -2985,6 +2985,26 b' class InteractiveShell(SingletonConfigurable):' | |||||
2985 | # For backwards compatibility |
|
2985 | # For backwards compatibility | |
2986 | runcode = run_code |
|
2986 | runcode = run_code | |
2987 |
|
2987 | |||
|
2988 | def check_complete(self, code): | |||
|
2989 | """Return whether a block of code is ready to execute, or should be continued | |||
|
2990 | ||||
|
2991 | Parameters | |||
|
2992 | ---------- | |||
|
2993 | source : string | |||
|
2994 | Python input code, which can be multiline. | |||
|
2995 | ||||
|
2996 | Returns | |||
|
2997 | ------- | |||
|
2998 | status : str | |||
|
2999 | One of 'complete', 'incomplete', or 'invalid' if source is not a | |||
|
3000 | prefix of valid code. | |||
|
3001 | indent : str | |||
|
3002 | When status is 'incomplete', this is some whitespace to insert on | |||
|
3003 | the next line of the prompt. | |||
|
3004 | """ | |||
|
3005 | status, nspaces = self.input_splitter.check_complete(code) | |||
|
3006 | return status, ' ' * (nspaces or 0) | |||
|
3007 | ||||
2988 | #------------------------------------------------------------------------- |
|
3008 | #------------------------------------------------------------------------- | |
2989 | # Things related to GUI support and pylab |
|
3009 | # Things related to GUI support and pylab | |
2990 | #------------------------------------------------------------------------- |
|
3010 | #------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now