Examples of execfile()


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

                // do stuff like loading java package org.apache.turbine.services.assemblerbroker.util.python;
                interp.exec("import sys");

                // Now we try to load the script file
                interp.execfile (confName);
                interp.execfile (fName);

                try
                {
                    // We create an instance of the screen class from the python script
                    interp.exec("scr = "+name+"()");
View Full Code Here

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

        try
        {
            in = new FileInputStream(scriptFile);
            PythonInterpreter interp = new PythonInterpreter();
            initEnvironment(interp);
            interp.execfile(in);
        }
        catch (FileNotFoundException ex)
        {
            Logger.getLogger(ScriptRunner.class.getName()).log(Level.SEVERE, null, ex);
        }
View Full Code Here

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

                // do stuff like loading java package
                // org.apache.turbine.services.assemblerbroker.util.python;
                interp.exec("import sys");

                // Now we try to load the script file
                interp.execfile(confName);
                interp.execfile(fName.toString());

                try
                {
                    // We create an instance of the screen class from the
View Full Code Here

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

                // org.apache.turbine.services.assemblerbroker.util.python;
                interp.exec("import sys");

                // Now we try to load the script file
                interp.execfile(confName);
                interp.execfile(fName.toString());

                try
                {
                    // We create an instance of the screen class from the
                    // python script
View Full Code Here

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

     */
    public static PyObject getFromFile(String fileName, String objectName)
    {
        System.out.println("jythools: get "+objectName+" from file "+fileName);
        PythonInterpreter interp = new PythonInterpreter();
        interp.execfile(fileName);
        return interp.get(objectName);
    }
}
View Full Code Here

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

      }

      System.setOut( new PrintStream( out ) );
      System.setErr( new PrintStream( err ) );

      pi.execfile( cwp );
     
      String jythonexec
        = "cw = "+cw+"()\n"
        + (null!=context?"cw._setContext( context )\n":"")
        + "cw.main( sys.argv )\n"
View Full Code Here

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

      }

      System.setOut( new PrintStream( out ) );
      System.setErr( new PrintStream( err ) );

      pi.execfile( cwp );
     
      String jythonexec
        = "cw = "+cw+"()\n"
        + (null!=context?"cw._setContext( context )\n":"")
        + "cw.main( sys.argv )\n"
View Full Code Here

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

        );

        try
        {
            String protonTestPyPath = protonScriptFile.getAbsolutePath();
            interp.execfile(protonTestPyPath);
        }
        catch (PyException e)
        {
            if( e.type.toString().equals("<type 'exceptions.SystemExit'>") && e.value.toString().equals("0") )
            {
View Full Code Here

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

    }

    public void execute(File file, Map vars) throws BuildException {
        PythonInterpreter pi = createInterpreter(vars);
        try {
            pi.execfile(file.getCanonicalPath());
        } catch (IOException e) {
            throw new BuildException(e);
        }
    }
   
View Full Code Here

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

        "sys.path.insert(0,\""+testDir.getCanonicalPath()+"\")\n"
        );

        try
        {
            interp.execfile(new File(testDir, "proton-test").getCanonicalPath());
        }
        catch (PyException e)
        {
            if( e.type.toString().equals("<type 'exceptions.SystemExit'>") && e.value.toString().equals("0") )
            {
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.