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

            String[] post_plugin_scripts = {"meta_loader.py"};
           
            // Run scripts designed to be run before plugin creation
            for (String script : pre_plugin_scripts) {
              InputStream metastream = this.getClass().getClassLoader().getResourceAsStream("scripts/"+script);
              interp.execfile(metastream);
              metastream.close();
            }

            interp.execfile(instream);
View Full Code Here

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

              InputStream metastream = this.getClass().getClassLoader().getResourceAsStream("scripts/"+script);
              interp.execfile(metastream);
              metastream.close();
            }

            interp.execfile(instream);

            instream.close();

            try {
                if (!hasyml) {
View Full Code Here

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

            result.interp = interp;
           
            // Run scripts designed to be run after plugin creation
            for (String script : post_plugin_scripts) {
              InputStream metastream = this.getClass().getClassLoader().getResourceAsStream("scripts/"+script);
              interp.execfile(metastream);
              metastream.close();
            }
           
            result.initialize(this, server, description, dataFolder, file);
            result.setDataFile(data);
View Full Code Here

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

      pycascadingDir = System.getProperty("pycascading.root") + "/";
      sourceDir = "";
      modulePaths = new String[] { pycascadingDir, sourceDir };
    }
    PythonInterpreter interpreter = Main.getInterpreter();
    interpreter.execfile(pycascadingDir + "python/pycascading/init_module.py");
    interpreter.set("module_paths", modulePaths);
    interpreter.eval("setup_paths(module_paths)");

    // We set the Python variable "map_input_file" to the path to the mapper
    // input file
View Full Code Here

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

    // function in the variable flow_process
    interpreter.set("flow_process", flowProcess);

    // We need to run the main file first so that imports etc. are defined,
    // and nested functions can also be used
    interpreter.execfile(sourceDir + (String) jobConf.get("pycascading.main_file"));
    return interpreter;
  }

  // We need to delay the deserialization of the Python functions up to this
  // point, since the sources are in the distributed cache, whose location is in
View Full Code Here

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

        this.py = py;
        this.fw = new FileWatcher<PyObject>(module) {
            @Override
            protected PyObject parseFileContents(InputStream in) throws IOException {
                PythonInterpreter pi = PythonFormatAdapter.this.py.interpreter();
                pi.execfile(in);
               
                PyStringMap locals = (PyStringMap) pi.getLocals();
                for (Object o : locals.keys()) {
                    String key = (String) o;
                    PyObject obj = locals.__getitem__(key);
View Full Code Here

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
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.