Examples of execfile()


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

    public PythonProcessAdapter(File module, final Python py){
        fw = new FileWatcher<Map<String,PyObject>>(module) {
            @Override
            protected Map<String,PyObject> parseFileContents(InputStream in) throws IOException {
                PythonInterpreter pi = py.interpreter();
                pi.execfile(in);

                Map<String,PyObject> processes = new LinkedHashMap();
                PyStringMap locals = (PyStringMap) pi.getLocals();
                for (Object o : locals.keys()) {
                    String key = (String) o;
View Full Code Here

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

        this.py = py;
        this.fw = new FileWatcher<Map<String,PyObject>>(module) {
            @Override
            protected Map<String,PyObject> parseFileContents(InputStream in) throws IOException {
                PythonInterpreter pi = PythonFilterFunctionAdapter.this.py.interpreter();
                pi.execfile(in);
               
                Map<String,PyObject> functions = new LinkedHashMap();
                PyStringMap locals = (PyStringMap) pi.getLocals();
                for (Object o : locals.keys()) {
                    String key = (String) o;
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()

    public static Object getJythonObject(String interfaceName, String pathToJythonModule)
    {
        Object jyObject = null;

        PythonInterpreter interpreter = new PythonInterpreter();
        interpreter.execfile(pathToJythonModule);

        String tempName = pathToJythonModule.substring(pathToJythonModule.lastIndexOf("/") + 1);
        tempName = tempName.substring(0, tempName.indexOf("."));

        String instanceName = tempName.toLowerCase();
View Full Code Here

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

       
        // deprecated
        interp.set("ssh", conn);
        interp.set("conn", conn);
        interp.set("args", args);
        interp.execfile(filePath);
       

    }

}
View Full Code Here

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

                // However, we need to know the load paths before we can do anything, so this is necessary.
                PythonUtils.initializePython();
                Py.getSystemState().path.append(new PyString(file.getParentFile().getCanonicalPath()));
                PythonInterpreter interpreter = new PythonInterpreter();
                try {
                    interpreter.execfile(file.getCanonicalPath());
                } catch (IOException e) {
                    throw new LoadException(file, e);
                } catch (PyException e) {
                    throw new LoadException(file, e);
                }
View Full Code Here

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

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

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

    public PythonProcessAdapter(File module, final Python py){
        fw = new FileWatcher<Map<String,PyObject>>(module) {
            @Override
            protected Map<String,PyObject> parseFileContents(InputStream in) throws IOException {
                PythonInterpreter pi = py.interpreter();
                pi.execfile(in);

                Map<String,PyObject> processes = new LinkedHashMap();
                PyStringMap locals = (PyStringMap) pi.getLocals();
                for (Object o : locals.keys()) {
                    String key = (String) o;
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
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.