org.python.core
Class imp

java.lang.Object
  extended byorg.python.core.imp

public class imp
extends Object

Utility functions for "import" support.


Field Summary
static int APIVersion
           
 
Method Summary
static PyModule addModule(String name)
           
static byte[] compileSource(String name, File file)
           
static byte[] compileSource(String name, File file, String filename, String outFilename)
           
static ClassLoader getSyspathJavaLoader()
           
static PyObject import_name(String name, boolean top, PyObject modDict)
           
static void importAll(String mod, PyFrame frame)
          Called from jpython generated code when a statement like "from spam.eggs import *" is executed.
static PyObject[] importFrom(String mod, String[] names, PyFrame frame)
          Called from jpython generated code when a stamenet like "from spam.eggs import foo, bar" is executed.
static PyObject[] importFromAs(String mod, String[] names, String[] asnames, PyFrame frame)
          Called from jpython generated code when a stamenet like "from spam.eggs import foo as spam" is executed.
static PyObject importName(String name, boolean top)
           
static PyObject importName(String name, boolean top, PyObject modDict)
           
static PyObject importOne(String mod, PyFrame frame)
          Called from jpython generated code when a statement like "import spam" is executed.
static PyObject importOneAs(String mod, PyFrame frame)
          Called from jpython generated code when a statement like "import spam as foo" is executed.
static PyObject load(String name)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APIVersion

public static final int APIVersion
See Also:
Constant Field Values
Method Detail

addModule

public static PyModule addModule(String name)

compileSource

public static byte[] compileSource(String name,
                                   File file)

compileSource

public static byte[] compileSource(String name,
                                   File file,
                                   String filename,
                                   String outFilename)

getSyspathJavaLoader

public static ClassLoader getSyspathJavaLoader()

load

public static PyObject load(String name)

import_name

public static PyObject import_name(String name,
                                   boolean top,
                                   PyObject modDict)

importName

public static PyObject importName(String name,
                                  boolean top)

importName

public static PyObject importName(String name,
                                  boolean top,
                                  PyObject modDict)

importOne

public static PyObject importOne(String mod,
                                 PyFrame frame)
Called from jpython generated code when a statement like "import spam" is executed.


importOneAs

public static PyObject importOneAs(String mod,
                                   PyFrame frame)
Called from jpython generated code when a statement like "import spam as foo" is executed.


importFrom

public static PyObject[] importFrom(String mod,
                                    String[] names,
                                    PyFrame frame)
Called from jpython generated code when a stamenet like "from spam.eggs import foo, bar" is executed.


importFromAs

public static PyObject[] importFromAs(String mod,
                                      String[] names,
                                      String[] asnames,
                                      PyFrame frame)
Called from jpython generated code when a stamenet like "from spam.eggs import foo as spam" is executed.


importAll

public static void importAll(String mod,
                             PyFrame frame)
Called from jpython generated code when a statement like "from spam.eggs import *" is executed.