Examples of PyString


Examples of org.python.core.PyString

    }

    public PyObject __findattr__(String name) {
        PyType self_type = getType();
        PyObject getattribute = self_type.lookup("__getattribute__");
        PyString py_name = null;
        try {
            if (getattribute != null) {
                return getattribute.__get__(this, self_type).__call__(py_name = new PyString(name));
            } else {
                return super.__findattr__(name);
            }
        } catch (PyException e) {
            if (Py.matchException(e, Py.AttributeError)) {
                PyObject getattr = self_type.lookup("__getattr__");
                if (getattr != null)
                    try {
                        return getattr.__get__(this, self_type)
                                .__call__(py_name != null ? py_name : new PyString(name));
                    } catch (PyException e1) {
                        if (!Py.matchException(e1, Py.AttributeError))
                            throw e1;
                    }
                return null;
View Full Code Here

Examples of org.python.core.PyString

    public void __setattr__(String name, PyObject value) {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__setattr__");
        if (impl != null) {
            impl.__get__(this, self_type).__call__(new PyString(name), value);
            return;
        }
        super.__setattr__(name, value);
    }
View Full Code Here

Examples of org.python.core.PyString

    public void __delattr__(String name) {
        PyType self_type = getType();
        PyObject impl = self_type.lookup("__delattr__");
        if (impl != null) {
            impl.__get__(this, self_type).__call__(new PyString(name));
            return;
        }
        super.__delattr__(name);
    }
View Full Code Here

Examples of org.python.core.PyString

        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.PyString

        }
        return time() - __initialclock__;
    }

    private static void throwValueError(String msg) {
        throw new PyException(Py.ValueError, new PyString(msg));
    }
View Full Code Here

Examples of org.python.core.PyString

            public PyBuiltinFunction bind(PyObject self) {
                return new exposed___repr__(self, info);
            }

            public PyObject __call__() {
                return new PyString(((PySet) self).baseset_toString());
            }
View Full Code Here

Examples of org.python.core.PyString

            public PyBuiltinFunction bind(PyObject self) {
                return new exposed___repr__(self, info);
            }

            public PyObject __call__() {
                return new PyString(((PySet) self).baseset_toString());
            }

        }
        dict.__setitem__("__repr__", new PyMethodDescr("__repr__", PySet.class, 0, 0, new exposed___repr__(null, null)));
        class exposed_add extends PyBuiltinMethodNarrow {
View Full Code Here

Examples of org.python.core.PyString

        });

        add(new ClassAdapter(String.class) {

            public PyObject adapt(Object o) {
                return new PyString((String) o);
            }

        });
        add(new ClassAdapter(Character.class) {
View Full Code Here

Examples of org.python.core.PyString

            public PyBuiltinFunction bind(PyObject self) {
                return new exposed___repr__(self, info);
            }

            public PyObject __call__() {
                return new PyString(((PyImmutableSet) self).baseset_toString());
            }
View Full Code Here

Examples of org.python.core.PyString

            public PyBuiltinFunction bind(PyObject self) {
                return new exposed___repr__(self, info);
            }

            public PyObject __call__() {
                return new PyString(((PyImmutableSet) self).baseset_toString());
            }

        }
        dict.__setitem__("__repr__", new PyMethodDescr("__repr__", PyImmutableSet.class, 0, 0, new exposed___repr__(
                null, 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.