Esempio n. 1
0
  public static PythonBridge getInstance(int timeoutMs) {
    if (blockPython) {
      // this occurs if the user programatically called setBlockPython(true), and then tries to call
      // getInstance()
      // for example, if we're unit testing we may want to check that we're correctly checking if
      // python
      // exists before calling getInstance(). If not, this exception may be thrown. Use hasPython()
      // to check.
      throw new AutomatonExportException(
          "PythonBridge.getInstance() was called, but blockPython was set to true.");
    }

    if (instance == null) instance = new PythonBridge(timeoutMs);
    else instance.setTimeout(timeoutMs);

    return instance;
  }
Esempio n. 2
0
 public ModelParserTest(boolean block) {
   PythonBridge.setBlockPython(block);
 }