Examples of PyCode


Examples of org.python.core.PyCode

    // Go through all nodes collected for the column with given hNodeId

    interpreter.set("workspaceid", workspace.getId());
    interpreter.set("command", this);
    interpreter.set("selectionName", selection.getName());
    PyCode py = repo.getTransformCode();

    int numRowsWithErrors = 0;

    for (Node node : nodes) {
      Row row = node.getBelongsToRow();
View Full Code Here

Examples of org.python.core.PyCode

    compileAndAddToRepository(interpreter, PythonTransformationHelper.getTransformStatement());
  }

  public PyCode compileAndAddToRepositoryAndExec(PythonInterpreter interpreter, String statement)
  {
    PyCode py = compileAndAddToRepository(interpreter,statement);
    interpreter.exec(py);
    return py;
  }
View Full Code Here

Examples of org.python.core.PyCode

    interpreter.exec(py);
    return py;
  }
  public PyCode compileAndAddToRepository(PythonInterpreter interpreter,
      String statement) {
    PyCode py  = null;
    if(!scripts.containsKey(statement))
    {
      py = compile(interpreter, statement);
      scripts.putIfAbsent(statement, py);
    }
View Full Code Here

Examples of org.python.core.PyCode

          Long lastTimeRead = fileNameTolastTimeRead.get(fileName);
          File s = new File(fileName);
          if(lastTimeRead == null || s.lastModified() > lastTimeRead)
          {
            String statement = FileUtils.readFileToString(s);
            PyCode py = compile(interpreter, statement);
            libraryScripts.put(fileName, py);
            fileNameTolastTimeRead.put(fileName, System.currentTimeMillis());
          }
          interpreter.exec(libraryScripts.get(fileName));
          //TODO prune scripts no longer present
View Full Code Here

Examples of org.python.core.PyCode

  private void populateSelection() {
    List<Table> tables = new ArrayList<Table>();
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    CloneTableUtils.getDatatable(worksheet.getDataTable(), workspace.getFactory().getHTable(hTableId), tables, SuperSelectionManager.DEFAULT_SELECTION);
    PythonInterpreter interpreter = new PythonInterpreter();
    PyCode code = null;
    try {
      code = getCompiledCode(pythonCode, interpreter);
    } catch(Exception e) {
     
    }
View Full Code Here

Examples of org.python.core.PyCode

            locals.__setitem__("__name__", new PyString(filename));
            locals.__setitem__("zipfile", Py.java2py(zip));

            InputStream file = zip.getInputStream(runit);
            PyCode code;
            try {
                code = Py.compile(FileUtil.readBytes(file), "__run__", "exec");
            } finally {
                file.close();
            }
View Full Code Here

Examples of org.python.core.PyCode

            locals.__setitem__("__name__", new PyString(filename));
            locals.__setitem__("zipfile", Py.java2py(zip));

            InputStream file = zip.getInputStream(runit);
            PyCode code;
            try {
                code = Py.compile(file, "__run__", CompileMode.exec);
            } finally {
                file.close();
            }
View Full Code Here

Examples of org.python.core.PyCode

                }
            } finally {
                bundle.close();
            }

            PyCode code = BytecodeLoader.makeCode(fullname + "$py", codeBytes, fullSearchPath);
            return new ModuleCodeData(code, isPackage, fullSearchPath);
        }
        return null;
    }
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.