Run a OS command
(self,cmd, printResponse=True, needCreateClassAndFunction=True, needDeleteClassAndFunction=True)
| 162 | return data[0][0] |
| 163 | |
| 164 | def execOSCommand(self,cmd, printResponse=True, needCreateClassAndFunction=True, needDeleteClassAndFunction=True): |
| 165 | ''' |
| 166 | Run a OS command |
| 167 | ''' |
| 168 | if needCreateClassAndFunction == False : |
| 169 | data = self.__runOSCmd__ (cmd=cmd, printResponse=printResponse) |
| 170 | else : |
| 171 | status = self.createClassAndFunctionToExecOsCmd() |
| 172 | if status != True: |
| 173 | self.args['print'].badNews("Impossible to use the JAVA library to execute a system command: {0}".format(str(status))) |
| 174 | return status |
| 175 | else: |
| 176 | data = self.__runOSCmd__ (cmd=cmd,printResponse=printResponse) |
| 177 | if needDeleteClassAndFunction == True : |
| 178 | status = self.deleteClassAndFunctionToExecOsCmd() |
| 179 | if status != True: |
| 180 | self.args['print'].goodNews("Impossible to delete functions created: {0}".format(self.cleanError(status))) |
| 181 | if isinstance(data,Exception) == False : return data |
| 182 | |
| 183 | def getInteractiveShell(self): |
| 184 | ''' |
no test coverage detected