seq  4.0.0-pre3
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
lib.module_loader.ModuleLoader Class Reference

Loads a python module. More...

Public Member Functions

def __attrs_post_init__ (self)
 
def load_file (self)
 Load a module from file. More...
 
def load_module (self)
 Loads a python module. More...
 
def reload (self)
 reloads the module More...
 
def desc (self)
 module description More...
 

Static Public Member Functions

def from_path (fn)
 Load module from file path. More...
 
def from_mod (m)
 Loads a module from dotted module spec. More...
 

Static Public Attributes

 file_path = attr.ib(default=None, kw_only=True)
 
 mod_name = attr.ib(default=None, kw_only=True)
 
 module = attr.ib(init=False)
 

Properties

 doc = property
 
 ctor = property
 Gets constructor from module. More...
 
 name = property
 

Detailed Description

Loads a python module.

    file_path (str):
    mod_name (str):

Member Function Documentation

◆ __attrs_post_init__()

def lib.module_loader.ModuleLoader.__attrs_post_init__ (   self)

◆ desc()

def lib.module_loader.ModuleLoader.desc (   self)

module description

◆ from_mod()

def lib.module_loader.ModuleLoader.from_mod (   m)
static

Loads a module from dotted module spec.

◆ from_path()

def lib.module_loader.ModuleLoader.from_path (   fn)
static

Load module from file path.

   Loads a python module given its file path (e.g. /a/b/c/x.py).
   If the module is found in sys.path then the equivalen to::
>>> import a.b.c.x

is executed and the module is properly added to sys.modules. Othewise the module is imported and 'x' is added to sys.modules.

◆ load_file()

def lib.module_loader.ModuleLoader.load_file (   self)

Load a module from file.

◆ load_module()

def lib.module_loader.ModuleLoader.load_module (   self)

Loads a python module.

◆ reload()

def lib.module_loader.ModuleLoader.reload (   self)

reloads the module

Member Data Documentation

◆ file_path

lib.module_loader.ModuleLoader.file_path = attr.ib(default=None, kw_only=True)
static

◆ mod_name

lib.module_loader.ModuleLoader.mod_name = attr.ib(default=None, kw_only=True)
static

◆ module

lib.module_loader.ModuleLoader.module = attr.ib(init=False)
static

Property Documentation

◆ ctor

lib.module_loader.ModuleLoader.ctor = property
static

Gets constructor from module.

◆ doc

lib.module_loader.ModuleLoader.doc = property
static

◆ name

lib.module_loader.ModuleLoader.name = property
static

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