seq  2.0.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | 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...
 
def doc (self)
 
def ctor (self)
 Gets constructor from module. More...
 
def name (self)
 

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)
 

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)

◆ ctor()

def lib.module_loader.ModuleLoader.ctor (   self)

Gets constructor from module.

◆ desc()

def lib.module_loader.ModuleLoader.desc (   self)

module description

◆ doc()

def lib.module_loader.ModuleLoader.doc (   self)

◆ 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.

◆ name()

def lib.module_loader.ModuleLoader.name (   self)

◆ 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

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