Package org.python.core

Examples of org.python.core.PyDictionary


        }
        return map;
    }

    private PyDictionary getDictionary() {
        return new PyDictionary(getMap());
    }
View Full Code Here


        final private void load_empty_list() {
            push(new PyList(Py.EmptyObjects));
        }

        final private void load_empty_dictionary() {
            push(new PyDictionary());
        }
View Full Code Here

        }


        final private void load_dict() {
            int k = marker();
            PyDictionary d = new PyDictionary();
            for (int i = 0; i < k; i += 2) {
                PyObject value = pop();
                PyObject key = pop();
                d.__setitem__(key, value);
            }
            pop();
            push(d);
        }
View Full Code Here

        }

        final private void load_setitem() {
            PyObject value = pop();
            PyObject key   = pop();
            PyDictionary dict = (PyDictionary)peek();
            dict.__setitem__(key, value);
        }
View Full Code Here

        }


        final private void load_setitems() {
            int mark = marker();
            PyDictionary dict = (PyDictionary)peek(mark+1);
            for (int i = 0; i < mark; i += 2) {
                PyObject key   = peek(i+1);
                PyObject value = peek(i);
                dict.__setitem__(key, value);
            }
            pop(mark+1);
        }
View Full Code Here

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

        if (exclude != Py.None) {
            for (int i = 0; i < exclude.__len__(); i++) {
                PyObject lowered = Py.newString(((PyString) exclude.__getitem__(i)).lower());
View Full Code Here

        setAppName("test_echo_wsgi_env");
        createServlet();
        setQueryString(name);
        doGet();
        String output = getOutput();
        PyDictionary result = (PyDictionary)evalPythonString(output);
        return result.__finditem__(name);
    }
View Full Code Here

                                     PyType subtype,
                                     PyObject[] args,
                                     String[] keywords) {
                return new Instantiable(subtype);
            }
        }, PyType.TYPE, "subinst", new PyTuple(new PyObject[] {type}), new PyDictionary());
        Instantiable created = (Instantiable)instance.new_impl(true,
                                                               sub,
                                                               Py.EmptyObjects,
                                                               Py.NoKeywords);
        assertEquals("new's init isn't called when a subtype comes in", 0, created.timesCalled);
View Full Code Here

        if (readSize != 0) {
            setQueryString("readsize=" + String.valueOf(readSize));
        }
        doGet();
        String app_output = getOutput();
        PyDictionary result = (PyDictionary)evalPythonString(app_output);
        String instream_contents = ((PyString)result.__finditem__("data")).toString();
        assertEquals("Application output length != " + expectedLength + ", =='"
                + instream_contents.length() + "'", instream_contents.length(), expectedLength);
        assertEquals("Application output != '" + expectedContent + "', =='" + instream_contents
                + "'", instream_contents, expectedContent);
    }
View Full Code Here

     *
     * @param dict
     * @throws PyException
     */
    protected static void _addSqlTypes(PyObject dict) throws PyException {
        PyDictionary sqltype = new PyDictionary();

        dict.__setitem__("sqltype", sqltype);

        try {
            Class<?> c = Class.forName("java.sql.Types");
            Field[] fields = c.getFields();

            for (Field f : fields) {
                PyString name = Py.newString(f.getName());
                PyObject value = new DBApiType(f.getInt(c));
                dict.__setitem__(name, value);
                sqltype.__setitem__(value, name);
            }

            c = Class.forName("java.sql.ResultSet");
            fields = c.getFields();

View Full Code Here

TOP

Related Classes of org.python.core.PyDictionary

Copyright © 2018 www.massapicom. 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.