1 package org.python.core; 2 3 6 public class JavaImporter extends PyObject { 7 8 public JavaImporter() { 9 super(); 10 } 11 12 17 public PyObject find_module(String name) { 18 return find_module(name, Py.None); 19 } 20 21 27 public PyObject find_module(String name, PyObject path) { 28 Py.writeDebug("import", "trying " + name + " in packagemanager for path " + path); 29 PyObject ret = PySystemState.packageManager.lookupName(name.intern()); 30 if (ret != null) { 31 Py.writeComment("import", "'" + name + "' as java package"); 32 return this; 33 } 34 return Py.None; 35 } 36 37 public PyObject load_module(String name) { 38 return PySystemState.packageManager.lookupName(name.intern()); 39 } 40 41 46 public String toString() { 47 return this.getType().toString(); 48 } 49 } 50 | Popular Tags |