Package org.python.util

Examples of org.python.util.PythonInterpreter.cleanup()


            try {
                StringWriter output = new StringWriter();
                PythonInterpreter interp = new PythonInterpreter(new org.python.core.PyStringMap(), new org.python.core.PySystemState());
                interp.setOut(output);
                interp.setErr(output);
                interp.cleanup();
                String args = "import sys;sys.argv[1:]= [r'" + selectedCampaign.getFileName() + "']";
                interp.exec(args);
                interp.exec("__name__ = '__main__'");
                String s =   "execfile(r'tools/TestProcedureDoc/generateTestCampaignDoc.py')";
                interp.exec(s);
View Full Code Here


                String args = "import sys;sys.argv[1:]= [r'" + selectedCampaign.getFileName() + "']";
                interp.exec(args);
                interp.exec("__name__ = '__main__'");
                String s =   "execfile(r'tools/TestProcedureDoc/generateTestCampaignDoc.py')";
                interp.exec(s);
                interp.cleanup();
                interp = null;
                File campaingFile = new File(selectedCampaign.getFileName());
                if (campaingFile.exists()) {
                  File resultsFile = new File(campaingFile.getParentFile().getCanonicalPath() + "/" + selectedCampaign.getCampaignName() + "-doc.html");
                  if (resultsFile.exists()) {
View Full Code Here

      result = function.__call__(Py.javas2pys(args)).__tojava__(
          Object.class);
    } catch (Throwable e) {
      throw new UserException(HttpException.getStackTraceString(e));
    } finally {
      interp.cleanup();
    }
    return result;
  }

  public static Contract getContract(Long id) throws HttpException {
View Full Code Here

      interp.exec(script);
    } catch (Throwable e) {
      throw new UserException(e.getMessage() + " "
          + HttpException.getStackTraceString(e));
    } finally {
      interp.cleanup();
    }
  }

  public MonadUri getEditUri() throws HttpException {
    return Chellow.REPORTS_INSTANCE.getEditUri().resolve(getId())
View Full Code Here

            pathToReport = reporter.execute();

        } catch (Throwable t) {
            ROOT_LOGGER.pythonExceptionEncountered(t);
        } finally {
            interpreter.cleanup();
        }

        Date endTime = new Date();
        ROOT_LOGGER.endingCollection();
View Full Code Here

            pathToReport = reporter.execute();

        } catch (Throwable t) {
            ROOT_LOGGER.pythonExceptionEncountered(t);
        } finally {
            interpreter.cleanup();
        }

        Date endTime = new Date();
        ROOT_LOGGER.endingCollection();
View Full Code Here

            interpreter.exec("from sos.sosreport import main");
            interpreter.exec("args = shlex.split('-k eap6.home=\"" + homeDir + "\" --tmp-dir=\"" + locationDir + "\" -o eap6 --batch --report --compression-type=zip --silent')");
            interpreter.exec("reportLocation = main(args)");
            report = interpreter.get("reportLocation");
            interpreter.cleanup();
        } catch (Throwable t) {
            interpreter.cleanup();
            ROOT_LOGGER.pythonExceptionEncountered(t);
        }
View Full Code Here

            interpreter.exec("args = shlex.split('-k eap6.home=\"" + homeDir + "\" --tmp-dir=\"" + locationDir + "\" -o eap6 --batch --report --compression-type=zip --silent')");
            interpreter.exec("reportLocation = main(args)");
            report = interpreter.get("reportLocation");
            interpreter.cleanup();
        } catch (Throwable t) {
            interpreter.cleanup();
            ROOT_LOGGER.pythonExceptionEncountered(t);
        }

        Date endTime = new Date();
        ROOT_LOGGER.endingCollection();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.