Examples of PyInteger


Examples of org.python.core.PyInteger

    public NumberToPyInteger(Class c) {
      super(c);
    }

    public PyObject adapt(Object o) {
      return new PyInteger(((Number) o).intValue());
    }
View Full Code Here

Examples of org.python.core.PyInteger

    public static void classDictInit(PyObject dict) {
        dict.__setitem__("__doc__", Py.None);
        dict.__setitem__("__name__", new PyString("_ast"));
        dict.__setitem__("__version__", new PyString("62047"));
        dict.__setitem__("PyCF_ONLY_AST", new PyInteger(CompilerFlags.PyCF_ONLY_AST));

        dict.__setitem__("astlist", AstList.TYPE);

        dict.__setitem__("AST", AST.TYPE);
        dict.__setitem__("Module", Module.TYPE);
View Full Code Here

Examples of org.python.core.PyInteger

*/
public class JythonEngine extends com.scratchdisk.script.jython.JythonEngine {
  public JythonEngine() {
    // TODO: why is this needed? It is added in the classloader already!
    PySystemState.add_classdir(ScriptographerEngine.getPluginDirectory() + "/java/classes");
    globals.__setitem__(new PyString("test"), new PyInteger(100));
    PyTuple all = new PyTuple(new PyString[] { Py.newString('*') });
    __builtin__.__import__("com.scriptographer.ai", globals, globals, all);
    __builtin__.__import__("com.scriptographer.ui", globals, globals, all);
//    __builtin__.eval(new PyString("from com.scriptographer.ai import *"), globals);
//    __builtin__.eval(new PyString("from com.scriptographer.ui import *"), globals);
View Full Code Here

Examples of org.python.core.PyInteger

        environ.put("PATH_INFO", StringUtils.join(seg.toArray(), "/"));
        //environ.put("PATH_INFO", );
       
        environ.put("QUERY_STRING", request.getResourceRef().getQuery());

        environ.put("wsgi.version", new PyTuple(new PyInteger(0), new PyInteger(1)));
        environ.put("wsgi.url_scheme", ref.getScheme());
        environ.put("wsgi.input", new PyFile(request.getEntity().getStream()));
        environ.put("wsgi.errors", new PyFile(System.err));
        environ.put("wsgi.multithread", true);
        environ.put("wsgi.multitprocess", false);
View Full Code Here

Examples of org.python.core.PyInteger

        ConcretePyMatrixHandler.FUNC_SET));
    this.interp.execfile(ConcretePyMatrixHandler.FILE);
  }

  public String addColumns(int col1, int col2) {
    this.interp.set("col1", new PyInteger(col1));
    this.interp.set("col2", new PyInteger(col2));
    this.interp.set("operation", new PyInteger(2));
    this.interp.execfile(ConcretePyMatrixHandler.FILE);

    return this.interp.get("matrix").toString();
  }
View Full Code Here

Examples of org.python.core.PyInteger

    return "division: q: " + this.interp.get("q").toString() + "   r: "
        + this.interp.get("r").toString();
  }

  public String getSmallest(int lvl, int rng) {
    this.interp.set("lvl", new PyInteger(lvl));
    this.interp.set("rng", new PyInteger(rng));
    this.interp.set("operation", new PyString(
        ConcretePyMatrixHandler.FUNC_GET_SMALLEST));
    this.interp.execfile(ConcretePyMatrixHandler.FILE);

    return "smallest: i: " + this.interp.get("smallest_i").toString()
View Full Code Here

Examples of org.python.core.PyInteger

    return "smallest: i: " + this.interp.get("smallest_i").toString()
        + " j: " + this.interp.get("smallest_j").toString();
  }

  public String moveSmallestToStart(int lvl, int rng) {
    this.interp.set("lvl", new PyInteger(lvl));
    this.interp.set("rng", new PyInteger(rng));
    this.interp.set("operation", new PyString(
        ConcretePyMatrixHandler.FUNC_MOVE_SMALLEST_TO_START));
    this.interp.execfile(ConcretePyMatrixHandler.FILE);

    return this.interp.get("matrix").toString();
View Full Code Here

Examples of org.python.core.PyInteger

    return this.interp.get("matrix").toString();
  }

  public String moveSmallestToStartInColumn(int lvl, int rng) {
    this.interp.set("lvl", new PyInteger(lvl));
    this.interp.set("rng", new PyInteger(rng));
    this.interp.set("operation", new PyString(
        ConcretePyMatrixHandler.FUNC_MOVE_SMALLEST_TO_START_IN_COLUMN));
    this.interp.execfile(ConcretePyMatrixHandler.FILE);

    return this.interp.get("matrix").toString();
View Full Code Here

Examples of org.python.core.PyInteger

    return this.interp.get("matrix").toString();
  }

  public String processRows(int row1, int row2, int column, int rng) {
    this.interp.set("row1", new PyInteger(row1));
    this.interp.set("row2", new PyInteger(row2));
    this.interp.set("column", new PyInteger(column));
    this.interp.set("rng", new PyInteger(rng));
    this.interp.set("operation", new PyString(
        ConcretePyMatrixHandler.FUNC_PROCESS_ROWS));
    this.interp.execfile(ConcretePyMatrixHandler.FILE);

    return this.interp.get("matrix").toString();
View Full Code Here

Examples of org.python.core.PyInteger

    return this.interp.get("matrix").toString();
  }

  public String processColumns(int column1, int column2, int row, int rng) {
    this.interp.set("column1", new PyInteger(column1));
    this.interp.set("column2", new PyInteger(column2));
    this.interp.set("row", new PyInteger(row));
    this.interp.set("rng", new PyInteger(rng));
    this.interp.set("operation", new PyString(
        ConcretePyMatrixHandler.FUNC_PROCESS_COLUMNS));
    this.interp.execfile(ConcretePyMatrixHandler.FILE);

    return this.interp.get("matrix").toString();
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.