Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
Importer Class Reference
Inheritance diagram for Importer:
_FilesystemImporter BuiltinImporter

Public Member Functions

def import_top
 
def get_code
 METHODS TO OVERRIDE. More...
 

Detailed Description

Definition at line 211 of file imputil.py.

Member Function Documentation

def get_code (   self,
  parent,
  modname,
  fqname 
)

METHODS TO OVERRIDE.

Find and retrieve the code for the given module.

parent specifies a parent module to define a context for importing. It
may be None, indicating no particular context for the search.

modname specifies a single module (not dotted) within the parent.

fqname specifies the fully-qualified module name. This is a
(potentially) dotted name from the "root" of the module namespace
down to the modname.
If there is no parent, then modname==fqname.

This method should return None, or a 3-tuple.

* If the module was not found, then None should be returned.

* The first item of the 2- or 3-tuple should be the integer 0 or 1,
    specifying whether the module that was found is a package or not.

* The second item is the code object for the module (it will be
    executed within the new module's namespace). This item can also
    be a fully-loaded module object (e.g. loaded from a shared lib).

* The third item is a dictionary of name/value pairs that will be
    inserted into new module before the code object is executed. This
    is provided in case the module's code expects certain values (such
    as where the module was found). When the second item is a module
    object, then these names/values will be inserted *after* the module
    has been loaded/initialized.

Definition at line 358 of file imputil.py.

359  def get_code(self, parent, modname, fqname):
360  """Find and retrieve the code for the given module.
361 
362  parent specifies a parent module to define a context for importing. It
363  may be None, indicating no particular context for the search.
364 
365  modname specifies a single module (not dotted) within the parent.
366 
367  fqname specifies the fully-qualified module name. This is a
368  (potentially) dotted name from the "root" of the module namespace
369  down to the modname.
370  If there is no parent, then modname==fqname.
371 
372  This method should return None, or a 3-tuple.
373 
374  * If the module was not found, then None should be returned.
375 
376  * The first item of the 2- or 3-tuple should be the integer 0 or 1,
377  specifying whether the module that was found is a package or not.
378 
379  * The second item is the code object for the module (it will be
380  executed within the new module's namespace). This item can also
381  be a fully-loaded module object (e.g. loaded from a shared lib).
382 
383  * The third item is a dictionary of name/value pairs that will be
384  inserted into new module before the code object is executed. This
385  is provided in case the module's code expects certain values (such
386  as where the module was found). When the second item is a module
387  object, then these names/values will be inserted *after* the module
388  has been loaded/initialized.
389  """
390  raise RuntimeError, "get_code not implemented"
391 
def import_top (   self,
  name 
)

Definition at line 214 of file imputil.py.

References Importer._finish_import(), Importer._import_fromlist(), Importer._import_one(), Importer._load_tail(), Importer._process_result(), and Importer.get_code().

215  def import_top(self, name):
216  "Import a top-level module."
217  return self._import_one(None, name, name)

The documentation for this class was generated from the following file: