Package org.python.core

Examples of org.python.core.PyList


           
            if (ret instanceof PyString) {
                getResponse().setEntity(ret.toString(), mediaType);
            }
            else if (ret instanceof PyList) {
                final PyList list = (PyList) ret;
                getResponse().setEntity(new OutputRepresentation(mediaType) {
                   
                    @Override
                    public void write(OutputStream outputStream) throws IOException {
                        for (Iterator i = list.iterator(); i.hasNext();) {
                            outputStream.write(i.next().toString().getBytes());
                            outputStream.write('\n');
                        }
                    }
                });
View Full Code Here


 
  private PyObject getKnownClass(String callChain) {
    PyObject result = null;
   
    PyStringMap map = (PyStringMap) myInterpreter.getLocals();
    PyList keys = (PyList) map.keys();
    PyObject iter = keys.__iter__();

    for (PyObject item; (item = iter.__iternext__()) != null && result == null; ) {
      if (item.toString().equals(callChain) && (map.get(item) instanceof PyJavaType || map.get(item) instanceof PyClass)) {
        result = (PyObject) map.get(item);
      }
View Full Code Here

  /**
   * @return List of variable names known to the interpreter.
   */
  public List<String> getVariables() {
    PyStringMap map = (PyStringMap) myInterpreter.getLocals();
    PyList keys = (PyList) map.keys();
    PyObject iter = keys.__iter__();

    List<String> result = new ArrayList<String>(50);
    myDocumentation = new ArrayList<String>(50);
    for (PyObject item; (item = iter.__iternext__()) != null; ) {
      result.add(item.toString());
View Full Code Here

  }
 
  private PyObject getObject(PyStringMap map, String key) {
    PyObject result = null;
   
    PyList keys = (PyList) map.keys();
    PyObject iter = keys.__iter__();
    for (PyObject item; (item = iter.__iternext__()) != null && result == null; ) {
      if (item.toString().equals(key)) {
        result = map.get(item);
      }
    }
View Full Code Here

TOP

Related Classes of org.python.core.PyList

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.