Examples of PyTuple


Examples of org.python.core.PyTuple

        if (leftbits != 0 && !done) {
            throw new PyException(Incomplete, "String has incomplete number of bytes");
        }

        return new PyTuple(new PyObject[] { Py.java2py(bin_data.toString()), Py.newInteger(done ? 1 : 0) });
    }
View Full Code Here

Examples of org.python.core.PyTuple

        for (PyObject p = null; (p = iter.__iternext__()) != null;) {
            ModuleInfo mi = findFromSource(name, p, false);
            if (mi == null) {
                continue;
            }
            return new PyTuple(
                    new PyObject[] {
                            mi.file,
                            new PyString(mi.filename),
                            new PyTuple(new PyObject[] { new PyString(mi.suffix), new PyString(mi.mode),
                                    Py.newInteger(mi.type) }), });
        }
        throw Py.ImportError("No module named " + name);
    }
View Full Code Here

Examples of org.python.core.PyTuple

    }

    public static PyObject get_suffixes() {
        return new PyList(
                new PyObject[] {
                        new PyTuple(
                                new PyObject[] { new PyString(".py"), new PyString("r"), Py.newInteger(PY_SOURCE), }),
                        new PyTuple(new PyObject[] { new PyString(".class"), new PyString("rb"),
                                Py.newInteger(PY_COMPILED), }), });
    }
View Full Code Here

Examples of org.python.core.PyTuple

        dict.__setitem__("struct_time", PyType.fromClass(PyTimeTuple.class));

        // calculate the static variables tzname, timezone, altzone, daylight
        TimeZone tz = TimeZone.getDefault();

        tzname = new PyTuple(new PyObject[] { new PyString(getDisplayName(tz, false, 0)),
                new PyString(getDisplayName(tz, true, 0)) });

        daylight = tz.useDaylightTime() ? 1 : 0;
        timezone = -tz.getRawOffset() / 1000;
        altzone = timezone - getDSTSavings(tz) / 1000;
View Full Code Here

Examples of org.python.core.PyTuple

    public PyObject __reduce__() {
        return struct_time___reduce__();
    }

    final PyObject struct_time___reduce__() {
        PyTuple newargs = __getnewargs__();
        return new PyTuple(new PyObject[] { getType(), newargs });
    }
View Full Code Here

Examples of org.python.core.PyTuple

        PyTuple newargs = __getnewargs__();
        return new PyTuple(new PyObject[] { getType(), newargs });
    }

    public PyTuple __getnewargs__() {
        return new PyTuple(new PyObject[] { new PyList(getArray()) });
    }
View Full Code Here

Examples of org.python.core.PyTuple

                return getslice(args[0], Py.None);
            default:
                PyObject[] result = new PyObject[args.length];
                for (int i = 0; i < args.length; i++)
                    result[i] = getslice(args[i], Py.None);
                return new PyTuple(result);
        }
    }
View Full Code Here

Examples of org.python.core.PyTuple

        PyObject[] result = new PyObject[groups - 1];
        for (int i = 1; i < groups; i++) {
            result[i - 1] = getslice_by_index(i, def);
        }
        return new PyTuple(result);
    }
View Full Code Here

Examples of org.python.core.PyTuple

        for (int index = 0; index < groups; index++) {
            regs[index] = _pair(mark[index * 2], mark[index * 2 + 1]);
        }

        return new PyTuple(regs);
    }
View Full Code Here

Examples of org.python.core.PyTuple

        return new PyTuple(regs);
    }

    PyTuple _pair(int i1, int i2) {
        return new PyTuple(new PyObject[] { Py.newInteger(i1), Py.newInteger(i2) });
    }
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.