MCPcopy Create free account
hub / github.com/quentinhardy/odat / getInteractiveShell

Method getInteractiveShell

Java.py:183–205  ·  view source on GitHub ↗

Give an interactive shell to the user Return True if Ok, otherwise return False

(self)

Source from the content-addressed store, hash-verified

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 '''

Callers 1

runjavaModuleFunction · 0.95

Calls 5

execOSCommandMethod · 0.95
badNewsMethod · 0.80
cleanErrorMethod · 0.80

Tested by

no test coverage detected