Python types.ModuleType 模块,__init__() 实例源码

我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用types.ModuleType.__init__()

项目:phredutils    作者:doctaphred    | 项目源码 | 文件源码
def modulify(cls):
    """Replace the class' module with an instance of the class.

    Useful for creating modules with __getattr__, descriptors, etc.
    """
    dct = dict(vars(cls))
    # Make sure __init__ is defined, to avoid falling back to
    # ModuleType.__init__ (which requires an argument)
    dct.setdefault('__init__', object.__init__)
    mod = type(cls.__name__, (ModuleType,), dct)
    sys.modules[cls.__module__] = mod()
项目:GAMADV-XTD    作者:taers232c    | 项目源码 | 文件源码
def __init__(self, name, attrmap, proxy=None):
        ModuleType.__init__(self, name)
        self.__attrmap = attrmap
        self.__proxy = proxy
        self.__log = logging.getLogger(name)
项目:GAMADV-XTD    作者:taers232c    | 项目源码 | 文件源码
def __init__(self, name, attrmap, proxy=None):
        ModuleType.__init__(self, name)
        self.__attrmap = attrmap
        self.__proxy = proxy
        self.__log = logging.getLogger(name)
项目:Callandtext    作者:iaora    | 项目源码 | 文件源码
def __init__(self, name, attrmap, proxy=None):
        ModuleType.__init__(self, name)
        self.__attrmap = attrmap
        self.__proxy = proxy
        self.__log = logging.getLogger(name)
项目:specto    作者:mrknow    | 项目源码 | 文件源码
def __init__(self, name, system_import):
        ModuleType.__init__(self, name)
        self._system_import = system_import
        self._modules_to_patch = {}
项目:Sudoku-Solver    作者:ayush1997    | 项目源码 | 文件源码
def __init__(self, name, attrmap, proxy=None):
        ModuleType.__init__(self, name)
        self.__attrmap = attrmap
        self.__proxy = proxy
        self.__log = logging.getLogger(name)
项目:GAMADV-X    作者:taers232c    | 项目源码 | 文件源码
def __init__(self, name, attrmap, proxy=None):
        ModuleType.__init__(self, name)
        self.__attrmap = attrmap
        self.__proxy = proxy
        self.__log = logging.getLogger(name)
项目:GAMADV-X    作者:taers232c    | 项目源码 | 文件源码
def __init__(self, name, attrmap, proxy=None):
        ModuleType.__init__(self, name)
        self.__attrmap = attrmap
        self.__proxy = proxy
        self.__log = logging.getLogger(name)
项目:enkiWS    作者:juliettef    | 项目源码 | 文件源码
def __init__(self, name, attrmap, proxy=None):
        ModuleType.__init__(self, name)
        self.__attrmap = attrmap
        self.__proxy = proxy
        self.__log = logging.getLogger(name)
项目:python-flask-security    作者:weinbergdavid    | 项目源码 | 文件源码
def __init__(self, name, attrmap, proxy=None):
        ModuleType.__init__(self, name)
        self.__attrmap = attrmap
        self.__proxy = proxy
        self.__log = logging.getLogger(name)