##// END OF EJS Templates
Backport PR #11044: Add shell.check_complete() method
Min RK -
Show More
@@ -2900,6 +2900,26 b' class InteractiveShell(SingletonConfigurable):'
2900 # For backwards compatibility
2900 # For backwards compatibility
2901 runcode = run_code
2901 runcode = run_code
2902
2902
2903 def check_complete(self, code):
2904 """Return whether a block of code is ready to execute, or should be continued
2905
2906 Parameters
2907 ----------
2908 source : string
2909 Python input code, which can be multiline.
2910
2911 Returns
2912 -------
2913 status : str
2914 One of 'complete', 'incomplete', or 'invalid' if source is not a
2915 prefix of valid code.
2916 indent : str
2917 When status is 'incomplete', this is some whitespace to insert on
2918 the next line of the prompt.
2919 """
2920 status, nspaces = self.input_splitter.check_complete(code)
2921 return status, ' ' * (nspaces or 0)
2922
2903 #-------------------------------------------------------------------------
2923 #-------------------------------------------------------------------------
2904 # Things related to GUI support and pylab
2924 # Things related to GUI support and pylab
2905 #-------------------------------------------------------------------------
2925 #-------------------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now