Examples of PySystemState


Examples of org.python.core.PySystemState

      Properties jythonProps = new Properties();
      jythonProps.put( "python.home", tmps.get("jython.home") );
      PythonInterpreter.initialize( System.getProperties(), jythonProps, args );

      PyStringMap       dict  = new PyStringMap();
      PySystemState     pysys = new PySystemState();
      PythonInterpreter pi    = new PythonInterpreter( dict, pysys );


      // DO NOT use CommandLineUserMessageHandler here - causes infinite recursion
      MessageHandlerOutputStream  out  = new MessageHandlerOutputStream( UserMessageHandler.INFO,  rumh );
View Full Code Here

Examples of org.python.core.PySystemState

        }
    }

    private PythonInterpreter createInterpreterWithArgs(String xmlReportFile)
    {
        PySystemState systemState = new PySystemState();
        String testPattern = System.getProperty(TEST_PATTERN_SYSTEM_PROPERTY);

        if (xmlReportFile != null)
        {
            systemState.argv.append(new PyString("--xml"));
View Full Code Here

Examples of org.python.core.PySystemState

                              pigContext.getProperties().getProperty(PigContext.PIG_CMD_ARGS_REMAINDERS));
                  } catch (IOException e) {
                      throw new ExecException("Cannot deserialize command line arguments", e);
                  }
                  if( argv != null ) {
                    PySystemState  state = Py.getSystemState();
                    state.argv.clear();
                    for (String str : argv ) {
                      state.argv.append(new PyString(str));
                    }
                  } else {
View Full Code Here

Examples of org.python.core.PySystemState

     * module even if the file which defines it has changed.
     */
    private void clearModuleDefinitions() {
        interpreterExec("import sys");
        interpreterExec("from java.awt import Color");
        PySystemState system = (PySystemState) interpreter.get("sys");
        PyStringMap modules = (PyStringMap) system.__getattr__("modules");
        PyObject builtin = modules.get(new PyString("__builtin__"));
        modules.clear();
        modules.__setitem__("__builtin__", builtin);
    }
View Full Code Here

Examples of org.python.core.PySystemState

    {
        // this setting supposedly allows GCing of jython-generated classes but I'm
        // not sure if this setting has any effect on newer jython versions anymore
        System.setProperty("python.options.internalTablesImpl", "weak");

        PySystemState engineSys = new PySystemState();
        String sphinxSourceDirectory = null;
        List<String> sphinxArgs = new ArrayList<String>(Arrays.asList(args));

        for (Iterator<String> it = sphinxArgs.iterator(); it.hasNext();) {
            String arg = it.next();
View Full Code Here

Examples of org.python.core.PySystemState

    */

    String strScript = scriptSourceLocator.getScriptAsString();
    if (scriptInterfaces.length > 0) {
      try {
        PySystemState state = new PySystemState();
        if (!"".equals(basePath)) {
          // Add webapp paths that can contain classes and .jar files to python search path
          state.path.insert(0, Py.newString(basePath + "classes"));
          File jarRoot = new File(basePath + "lib");
          if (jarRoot.exists()) {
View Full Code Here

Examples of org.python.core.PySystemState

                      argv = (String[])ObjectSerializer.deserialize(
                              pigContext.getProperties().getProperty(PigContext.PIG_CMD_ARGS_REMAINDERS));
                  } catch (IOException e) {
                      throw new ExecException("Cannot deserialize command line arguments", e);
                  }
                  PySystemState  state = Py.getSystemState();
                  state.argv.clear();
                  if( argv != null ) {
                    for (String str : argv ) {
                      state.argv.append(new PyString(str));
                    }
View Full Code Here

Examples of org.python.core.PySystemState

        }
    }

    private PythonInterpreter createInterpreterWithArgs(String xmlReportFile, String ignoreFile)
    {
        PySystemState systemState = new PySystemState();

        if (xmlReportFile != null)
        {
            systemState.argv.append(new PyString("--xml"));
            systemState.argv.append(new PyString(xmlReportFile));
View Full Code Here

Examples of org.python.core.PySystemState

      }
     
    String strScript = scriptSourceLocator.getScriptAsString();
    if (scriptInterfaces.length > 0) {  
      try {
        PySystemState state = new PySystemState();
        if (!"".equals(basePath)) {
          // Add webapp paths that can contain classes and .jar files to python search path
          state.path.insert(0, Py.newString(basePath + "classes"));
          File jarRoot = new File(basePath + "lib");
          if (jarRoot.exists()) {
View Full Code Here

Examples of org.python.core.PySystemState

        super(null, createPySystemState());
    }

    public static PySystemState createPySystemState() {
        try {
            return new PySystemState();
        } catch (IllegalStateException e) {
            //happens when running tests.
            PySystemState.initialize();
            return new PySystemState();
        }
    }
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.