Examples of execfile()


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

            for (String name : query.getNames()) {
                pi.set(name, query.getFirstValue(name));
            }
           
            pi.setOut(out);
            pi.execfile(new FileInputStream(script));
           
            getResponse().setEntity(new OutputRepresentation(MediaType.TEXT_PLAIN) {
                @Override
                public void write(OutputStream output) throws IOException {
                    output.write(out.toByteArray());
View Full Code Here

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

    }
   
    @Override
    public void handleGet() {
        PythonInterpreter pi = python.interpreter();
        pi.execfile(appFile.getAbsolutePath());
       
        PyObject app = pi.get("app");
        if (app == null) {
            throw new RestletException("'app' function not found", Status.SERVER_ERROR_INTERNAL);
        }
View Full Code Here

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

        this.py = py;
        fw = new FileWatcher<PyType>(file) {
            @Override
            protected PyType parseFileContents(InputStream in) throws IOException {
                PythonInterpreter pi = PythonDataStoreAdapter.this.py.interpreter();
                pi.execfile(in);
               
                PyStringMap locals = (PyStringMap) pi.getLocals();
                for (Object obj : locals.values()) {
                    if (obj instanceof PyType) {
                        PyType pobj = (PyType) obj;
View Full Code Here

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

     * @param args the command line arguments
     */
     public static void main(String[] args) throws PyException
     {
        PythonInterpreter interp = new PythonInterpreter();
        interp.execfile("src/python/server.py");
    }
}
View Full Code Here

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

                // explicitely in the scrypt.  We always use the sys module to
                // 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
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);

                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()

        interpreter.exec("import sys");
        String path = Matcher.quoteReplacement(script.getParent());
        interpreter.exec("sys.path.append('" + path + "')");

        // Execute the script and create an instance of the desired class.
        interpreter.execfile(script.getAbsolutePath());
        interpreter.exec("obj = " + className + "()");
        T obj = interpreter.get("obj", interfaceClass);

        // Remove the directory where the Python script resides from the Python
        // module search path.
View Full Code Here

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

   
    interp.exec("import sys");
    interp.exec("sys.path.append(\"" + currentDir + "\")");
    interp.exec("sys.path.append(\"" + currentDir + File.separator + "lib\")");
   
    interp.execfile(stream1, JYTHON_FILE_NAME);
  }
   
  /**
   * @return the absolute path of unjar directory
   */
 
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.