Examples of PyList


Examples of org.python.core.PyList

        this.restype = restype;
    }

    @ExposedGet(name = "argtypes")
    public PyObject getArgTypes() {
        return new PyList(argtypes != null ? argtypes : new PyObject[0]);
    }
View Full Code Here

Examples of org.python.core.PyList

        if (!(ap.getPyObject(0) instanceof PyList)) {
            throw Py.TypeError("expected list of jffi.StructLayout.Field");
        }

        PyList pyFields = (PyList) ap.getPyObject(0);
        Field[] fields = new Field[pyFields.size()];

        for (int i = 0; i < fields.length; ++i) {
            PyObject pyField = pyFields.pyget(i);
            if (!(pyField instanceof Field)) {
                throw Py.TypeError(String.format("element %d of field list is not an instance of jffi.StructLayout.Field", i));
            }
           
            fields[i] = (Field) pyField;
View Full Code Here

Examples of org.python.core.PyList

                references.remove(i);
            } else {
                list.add(r);
            }
        }
        return new PyList(list);
    }
View Full Code Here

Examples of org.python.core.PyList

     * @param object a PyObject
     * @return a PyList of references. may be empty
     */
    public static PyList getRefs(PyObject object) {
        GlobalRef ref = objects.get(new GlobalRef(object));
        return ref == null ? new PyList() : ref.refs();
    }
View Full Code Here

Examples of org.python.core.PyList

         * normally not be used unless someone tries to deepcopy
         * the memo itself...
         */
        final private void keep_alive(PyObject obj) {
            int id = System.identityHashCode(memo);
            PyList list = (PyList) memo.findValue(id, memo);
            if (list == null) {
                list = new PyList();
                memo.put(id, -1, list);
            }
            list.append(obj);
        }
View Full Code Here

Examples of org.python.core.PyList

        return Py.java2py(engine);
    }

    @ExposedMethod
    public PyObject scope_keys() {
        PyList members = new PyList();
        List<Integer> scopes = context.getScopes();
        for (int scope : scopes) {
            Bindings bindings = context.getBindings(scope);
            if (bindings == null)
                continue;
            for (String key : bindings.keySet())
                members.append(new PyString(key));
        }
        members.sort();
        return members;
    }
View Full Code Here

Examples of org.python.core.PyList

            }
            push(new PyTuple(data));
        }

        final private void load_empty_list() {
            push(new PyList(Py.EmptyObjects));
        }
View Full Code Here

Examples of org.python.core.PyList

        final private void load_list() {
            PyObject[] arr = new PyObject[marker()];
            pop(arr);
            pop();
            push(new PyList(arr));
        }
View Full Code Here

Examples of org.python.core.PyList

    public DBSink(PyConnection connection, Class dataHandler, String tableName, PyObject exclude, PyObject bindings, int batchsize) {

        super(connection, dataHandler, tableName);

        this.sql = Py.None;
        this.rows = new PyList();
        this.bindings = bindings;
        this.batchsize = batchsize;
        this.exclude = new HashSet();
        this.indexedBindings = new PyDictionary();
View Full Code Here

Examples of org.python.core.PyList

                if (len % this.batchsize == 0) {
                    this.cursor.execute(this.sql, this.rows, this.indexedBindings, Py.None);
                    this.connection.commit();

                    this.rows = new PyList();
                }
            }
        } else {
            this.createSql(row);
        }
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.