Examples of PyStringMap


Examples of org.python.core.PyStringMap

        }
        return null;
    }
   
    PyFunction createStartResponse() {
        return new PyFunction(new PyStringMap(), new PyObject[]{}, Py.newJavaCode(getClass(), "start_response"));
    }
View Full Code Here

Examples of org.python.core.PyStringMap

            @Override
            protected PyType parseFileContents(InputStream in) throws IOException {
                PythonInterpreter pi = PythonDataStoreAdapter.this.py.interpreter();
                pi.execfile(in);
               
                PyStringMap locals = (PyStringMap) pi.getLocals();
                for (Object obj : locals.values()) {
                    if (obj instanceof PyType) {
                        PyType pobj = (PyType) obj;
                        try {
                            PyObject init = pobj.__getattr__("__init__");
                            if (init != null) {
View Full Code Here

Examples of org.python.core.PyStringMap

  }
 
  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);
      }
    }
   
    return result;
  }
View Full Code Here

Examples of org.python.core.PyStringMap

 
  /**
   * @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; ) {
View Full Code Here

Examples of org.python.core.PyStringMap

   *     so this method can't return anything given a call chain.  
   * @return A list of completion options including methods (with args)
   *     and fields on the named variable. 
   */
  public List<String> getMembers(String base) {
    PyStringMap map = (PyStringMap) myInterpreter.getLocals();

    StringTokenizer varTok = new StringTokenizer(base, ".", false);
    String rootVariable = varTok.nextToken();
   
    PyObject po = getObject(map, rootVariable);
View Full Code Here

Examples of org.python.core.PyStringMap

 
  /**
   * Returns names of all variables in the local workspace.
   */
  public String[] getVariables() {
    PyStringMap dict = (PyStringMap)myInterpreter.getLocals();
    return (String[])dict.keys().toArray(new String[0]);
  }
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.