Give an interactive shell to the user Return True if Ok, otherwise return False
(self)
| 181 | if isinstance(data,Exception) == False : return data |
| 182 | |
| 183 | def getInteractiveShell(self): |
| 184 | ''' |
| 185 | Give an interactive shell to the user |
| 186 | Return True if Ok, otherwise return False |
| 187 | ''' |
| 188 | exit, needCreateClassFunctions = False, True |
| 189 | while exit == False: |
| 190 | try: |
| 191 | if needCreateClassFunctions == True : |
| 192 | status = self.createClassAndFunctionToExecOsCmd() |
| 193 | if status == False: |
| 194 | self.args['print'].badNews("Impossible to use the JAVA library to execute a system command: {0}".format(str(status))) |
| 195 | return False |
| 196 | needCreateClassFunctions = False |
| 197 | else : |
| 198 | cmd = input('{0}$ '.format(self.args['server'])) |
| 199 | output = self.execOSCommand(cmd=cmd ,printResponse=True, needCreateClassAndFunction = False, needDeleteClassAndFunction = False) |
| 200 | except KeyboardInterrupt: |
| 201 | status = self.deleteClassAndFunctionToExecOsCmd() |
| 202 | if status != True: |
| 203 | self.args['print'].badNews("Impossible to delete functions created: {0}".format(self.cleanError(status))) |
| 204 | return True |
| 205 | return False |
| 206 | |
| 207 | def __runListenNC__ (self,port=None): |
| 208 | ''' |
no test coverage detected