Python importlib.machinery 模块,__name__() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用importlib.machinery.__name__()

项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__ + repr(self.args)
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)


# backward compatibility
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__ + repr(self.args)
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__ + repr(self.args)
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)


# backward compatibility
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__ + repr(self.args)
项目:my-first-blog    作者:AnkurBegining    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:pip-update-requirements    作者:alanhamlett    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__ + repr(self.args)
项目:pip-update-requirements    作者:alanhamlett    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)


# backward compatibility
项目:pip-update-requirements    作者:alanhamlett    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:pip-update-requirements    作者:alanhamlett    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__+repr(self.args)
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)

# backward compatibility
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__ + repr(self.args)
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__+repr(self.args)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)

# backward compatibility
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__+repr(self.args)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__+repr(self.args)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)

# backward compatibility
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__+repr(self.args)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)

# backward compatibility
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__+repr(self.args)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__ + repr(self.args)
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)


# backward compatibility
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__ + repr(self.args)
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def run_script(self, requires, script_name):
        """Locate distribution for `requires` and run `script_name` script"""
        ns = sys._getframe(1).f_globals
        name = ns['__name__']
        ns.clear()
        ns['__name__'] = name
        self.require(requires)[0].run_script(script_name, ns)
项目:jira_worklog_scanner    作者:pgarneau    | 项目源码 | 文件源码
def resolve(self):
        """
        Resolve the entry point from its module and attrs.
        """
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
        try:
            return functools.reduce(getattr, self.attrs, module)
        except AttributeError as exc:
            raise ImportError(str(exc))
项目:zanph    作者:zanph    | 项目源码 | 文件源码
def __repr__(self):
        return self.__class__.__name__+repr(self.args)
项目:zanph    作者:zanph    | 项目源码 | 文件源码
def run_script(dist_spec, script_name):
    """Locate distribution `dist_spec` and run its `script_name` script"""
    ns = sys._getframe(1).f_globals
    name = ns['__name__']
    ns.clear()
    ns['__name__'] = name
    require(dist_spec)[0].run_script(script_name, ns)

# backward compatibility