156 dbs.clientGone.connect(self.__initialise) |
156 dbs.clientGone.connect(self.__initialise) |
157 dbs.clientRawInput.connect(self.__raw_input) |
157 dbs.clientRawInput.connect(self.__raw_input) |
158 dbs.clientBanner.connect(self.__writeBanner) |
158 dbs.clientBanner.connect(self.__writeBanner) |
159 dbs.clientCompletionList.connect(self.__showCompletions) |
159 dbs.clientCompletionList.connect(self.__showCompletions) |
160 dbs.clientCapabilities.connect(self.__clientCapabilities) |
160 dbs.clientCapabilities.connect(self.__clientCapabilities) |
161 dbs.clientException.connect(self.__clientError) |
161 dbs.clientException.connect(self.__clientException) |
162 dbs.clientSyntaxError.connect(self.__clientError) |
162 dbs.clientSyntaxError.connect(self.__clientSyntaxError) |
163 self.dbs = dbs |
163 self.dbs = dbs |
164 |
164 |
165 # Initialize instance variables. |
165 # Initialize instance variables. |
166 self.__initialise() |
166 self.__initialise() |
167 self.prline = 0 |
167 self.prline = 0 |
654 """ |
654 """ |
655 if not self.inRawMode: |
655 if not self.inRawMode: |
656 self.inContinue = more |
656 self.inContinue = more |
657 self.__writePrompt() |
657 self.__writePrompt() |
658 self.inCommandExecution = False |
658 self.inCommandExecution = False |
|
659 |
|
660 def __clientException(self, exceptionType, exceptionMessage, stackTrace): |
|
661 """ |
|
662 Private method to handle an exception of the client. |
|
663 |
|
664 @param exceptionType type of exception raised (string) |
|
665 @param exceptionMessage message given by the exception (string) |
|
666 @param stackTrace list of stack entries (list of string) |
|
667 """ |
|
668 self .__clientError() |
|
669 |
|
670 if Preferences.getDebugger("ShowExceptionInShell"): |
|
671 if exceptionType is not None: |
|
672 if stackTrace: |
|
673 self.__write( |
|
674 self.tr('Exception "{0}"\n{1}\nFile: {2}, Line: {3}\n') |
|
675 .format( |
|
676 exceptionType, |
|
677 exceptionMessage, |
|
678 stackTrace[0][0], |
|
679 stackTrace[0][1] |
|
680 ) |
|
681 ) |
|
682 else: |
|
683 self.__write( |
|
684 self.tr('Exception "{0}"\n{1}\n') |
|
685 .format( |
|
686 exceptionType, |
|
687 exceptionMessage) |
|
688 ) |
|
689 |
|
690 def __clientSyntaxError(self, message, filename, lineNo, characterNo): |
|
691 """ |
|
692 Private method to handle a syntax error in the debugged program. |
|
693 |
|
694 @param message message of the syntax error (string) |
|
695 @param filename translated filename of the syntax error position |
|
696 (string) |
|
697 @param lineNo line number of the syntax error position (integer) |
|
698 @param characterNo character number of the syntax error position |
|
699 (integer) |
|
700 """ |
|
701 self .__clientError() |
|
702 |
|
703 if Preferences.getDebugger("ShowExceptionInShell"): |
|
704 if message is None: |
|
705 self.__write(self.tr("Unspecified syntax error.\n")) |
|
706 else: |
|
707 self.__write( |
|
708 self.tr('Syntax error "{1}" in file {0} at line {2},' |
|
709 ' character {3}.\n') |
|
710 .format(filename, message, lineNo, characterNo) |
|
711 ) |
659 |
712 |
660 def __clientError(self): |
713 def __clientError(self): |
661 """ |
714 """ |
662 Private method to handle an error in the client. |
715 Private method to handle an error in the client. |
663 """ |
716 """ |