Package org.python.core

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


        return new PyTuple(regs);
    }


    PyTuple _pair(int i1, int i2) {
        return new PyTuple(Py.newInteger(i1), Py.newInteger(i2));
    }
View Full Code Here

            byte b[]=bout.toByteArray();
            PyInteger retarr[]=new PyInteger[b.length];
            for (int i=0;i<b.length;i++) {
                retarr[i]=new PyInteger(b[i]);
            }
            PyTuple ret=new PyTuple(retarr);
            return ret;
        } catch (IOException e) {
            throw Py.SystemError("creation of state vector failed: "+
                    e.getMessage());
        }
View Full Code Here

        } else {
            int argc = args.length - keywords.length;
            justArgs = new PyObject[argc];
            System.arraycopy(args, 0, justArgs, 0, argc);
        }
        return new PyTuple(justArgs);
    }
View Full Code Here

        dict.__setitem__("__name__", Py.newString("time"));

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

        tzname = new PyTuple(new PyString(tz.getDisplayName(false, 0)),
                             new PyString(tz.getDisplayName(true, 0)));

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

        return struct_time___reduce__();
    }

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

        PyTuple newargs = __getnewargs__();
        return new PyTuple(getType(), newargs);
    }

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

        PyObject[] newlines = new PyObject[size];
        int i = 0;
        for (Newline newline : newlineTypes) {
            newlines[i++] = new PyString(newline.getValue());
        }
        return new PyTuple(newlines);
    }
View Full Code Here

                    .append(metricName)
                    .append(".")
                    .append(valueName)
                    .toString();
            }
            PyTuple tuple = new PyTuple(new PyString(metricName),
                new PyTuple(new PyLong(timestamp), new PyString(value)));
            metrics.add(tuple);
            if(metrics.size() >= batchSize) {
                writeMetrics();
            }
        }
View Full Code Here

public class JythonEngine extends com.scratchdisk.script.jython.JythonEngine {
  public JythonEngine() {
    // TODO: why is this needed? It is added in the classloader already!
    PySystemState.add_classdir(ScriptographerEngine.getPluginDirectory() + "/java/classes");
    globals.__setitem__(new PyString("test"), new PyInteger(100));
    PyTuple all = new PyTuple(new PyString[] { Py.newString('*') });
    __builtin__.__import__("com.scriptographer.ai", globals, globals, all);
    __builtin__.__import__("com.scriptographer.ui", globals, globals, all);
//    __builtin__.eval(new PyString("from com.scriptographer.ai import *"), globals);
//    __builtin__.eval(new PyString("from com.scriptographer.ui import *"), globals);
  }
View Full Code Here

TOP

Related Classes of org.python.core.PyTuple

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.