Examples of PySequence


Examples of org.python.core.PySequence

            if (obj.__len__() != 9) {
                throw Py.TypeError("time.struct_time() takes a 9-sequence (1-sequence given)");
            }
            return new PyTimeTuple((PyTuple) obj);
        } else if (obj instanceof PySequence) {
            PySequence seq = (PySequence) obj;
            if (seq.__len__() != 9) {
                throw Py.TypeError("time.struct_time() takes a 9-sequence (1-sequence given)");
            }
            return new PyTimeTuple((PyObject[]) seq.__tojava__(PyObject[].class));

        }
        throw Py.TypeError("constructor requires a sequence");
    }
View Full Code Here

Examples of org.python.core.PySequence


        final private void save_inst(PyInstance object) {
            PyClass cls = object.instclass;

            PySequence args = null;
            PyObject getinitargs = object.__findattr__("__getinitargs__");
            if (getinitargs != null) {
                args = (PySequence)getinitargs.__call__();
                // XXX Assert it's a sequence
                keep_alive(args);
            }

            file.write(MARK);
            if (protocol > 0)
                save(cls);

            if (args != null) {
                int len = args.__len__();
                for (int i = 0; i < len; i++)
                    save(args.__finditem__(i));
            }

            int mid = putMemo(get_id(object), object);
            if (protocol > 0) {
                file.write(OBJ);
View Full Code Here

Examples of org.python.core.PySequence

        PyObject obj = function(name);
        PythonInterpreter pi = py.interpreter();
        pi.exec("from inspect import getargspec");
       
        PyFunction getargspec = (PyFunction) pi.get("getargspec");
        PySequence argspec =
            (PySequence) getargspec.__call__(obj.__getattr__("wrapped")).__getitem__(0);
       
        List<String> list = new ArrayList();
        int i = 0;
        for (Object item : (Collection) argspec) {
View Full Code Here

Examples of org.python.core.PySequence

        pi.exec("from inspect import getargspec");
       
        PyFunction getargspec = (PyFunction) pi.get("getargspec");
        PyObject init =  type.__getattr__("__init__");
       
        PySequence argspec =
            (PySequence) getargspec.__call__(init.__getattr__("wrapped")).__getitem__(0);
        PyDictionary params = (PyDictionary) init.__getattr__("params");
       
        List<Param> list = new ArrayList();
        for (Object item : (Collection) argspec) {
            String pname = item.toString();
            if ("self".equals(pname)) continue;
           
            PySequence pinfo = (PySequence) params.get(pname);
           
            String pdesc = pinfo != null ? pinfo.__getitem__(0).toString() : pname;
            Object ptype = null;
            try {
                ptype = pinfo != null ? pinfo.__getitem__(1) : null;
            }
            catch(PyException e) {}
            
            Class clazz = null;
            if (ptype != null && ptype instanceof PyType) {
View Full Code Here

Examples of org.python.core.PySequence

        PyObject obj = function(name);
        PythonInterpreter pi = py.interpreter();
        pi.exec("from inspect import getargspec");
       
        PyFunction getargspec = (PyFunction) pi.get("getargspec");
        PySequence argspec =
            (PySequence) getargspec.__call__(obj.__getattr__("wrapped")).__getitem__(0);
       
        List<String> list = new ArrayList();
        int i = 0;
        for (Object item : (Collection) argspec) {
View Full Code Here

Examples of org.python.core.PySequence

        pi.exec("from inspect import getargspec");
       
        PyFunction getargspec = (PyFunction) pi.get("getargspec");
        PyObject init =  type.__getattr__("__init__");
       
        PySequence argspec =
            (PySequence) getargspec.__call__(init.__getattr__("wrapped")).__getitem__(0);
        PyDictionary params = (PyDictionary) init.__getattr__("params");
       
        List<Param> list = new ArrayList();
        for (Object item : (Collection) argspec) {
            String pname = item.toString();
            if ("self".equals(pname)) continue;
           
            PySequence pinfo = (PySequence) params.get(pname);
           
            String pdesc = pinfo != null ? pinfo.__getitem__(0).toString() : pname;
            Object ptype = null;
            try {
                ptype = pinfo != null ? pinfo.__getitem__(1) : null;
            }
            catch(PyException e) {}
            
            Class clazz = null;
            if (ptype != null && ptype instanceof PyType) {
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.