Python imp 模块,is_frozen() 实例源码

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

项目:darkc0de-old-stuff    作者:tuwid    | 项目源码 | 文件源码
def main_is_frozen():
    return (hasattr(sys, "frozen") or # new py2exe
            hasattr(sys, "importers") or # old py2exe
            imp.is_frozen("__main__")) # tools/freeze


#~ if __name__ == '__main__':
    #some test code here. 
    #~ def hello(name="bla"):
        #~ print "hello, ", name

    #~ myt = MyTimer(1.0, 5, hello, ["bob"])
    #~ myt.start()
    #~ time.sleep(4)
    #~ myt.cancel()
    #~ print "next timer"
    #~ myt = MyTimer(1.0, 0, hello, ["bob"])
    #~ myt.start()
    #~ time.sleep(6)
    #~ myt.cancel()
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if imp.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if imp.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def is_frozen(self, name): return imp.is_frozen(name)
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if self.hooks.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if self.hooks.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if imp.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if imp.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def is_frozen(self, name): return imp.is_frozen(name)
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if self.hooks.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if self.hooks.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:omSipCreator    作者:KBNLresearch    | 项目源码 | 文件源码
def main_is_frozen():
    return (hasattr(sys, "frozen") or  # new py2exe
            hasattr(sys, "importers")  # old py2exe
            or imp.is_frozen("__main__"))  # tools/freeze
项目:blpapi-web    作者:pricingmonkey    | 项目源码 | 文件源码
def main_is_frozen():
    return (hasattr(sys, "frozen") or # new py2exe
        hasattr(sys, "importers") # old py2exe
        or imp.is_frozen("__main__")) # tools/freeze
项目:ecel    作者:ARL-UTEP-OC    | 项目源码 | 文件源码
def main_is_frozen():
    return (hasattr(sys, "frozen") or # new py2exe
            hasattr(sys, "importers") or # old py2exe
            imp.is_frozen("__main__")) # tools/freeze
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if imp.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if imp.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def is_frozen(self, name): return imp.is_frozen(name)
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if self.hooks.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if self.hooks.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if imp.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if imp.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def is_frozen(self, name): return imp.is_frozen(name)
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if self.hooks.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if self.hooks.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if imp.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if imp.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def is_frozen(self, name): return imp.is_frozen(name)
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if self.hooks.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if self.hooks.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:web_ctp    作者:molebot    | 项目源码 | 文件源码
def test_everyone_has___loader__(self):
        # Issue #17098: all modules should have __loader__ defined.
        for name, module in sys.modules.items():
            if isinstance(module, types.ModuleType):
                if name in sys.builtin_module_names:
                    self.assertEqual(importlib.machinery.BuiltinImporter,
                                     module.__loader__)
                elif imp.is_frozen(name):
                    self.assertEqual(importlib.machinery.FrozenImporter,
                                     module.__loader__)
项目:pefile.pypy    作者:cloudtracer    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if imp.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if imp.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:pefile.pypy    作者:cloudtracer    | 项目源码 | 文件源码
def is_frozen(self, name): return imp.is_frozen(name)
项目:pefile.pypy    作者:cloudtracer    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if self.hooks.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if self.hooks.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if imp.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if imp.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def is_frozen(self, name): return imp.is_frozen(name)
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if self.hooks.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if self.hooks.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:empyrion-python-api    作者:huhlig    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if imp.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if imp.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:empyrion-python-api    作者:huhlig    | 项目源码 | 文件源码
def is_frozen(self, name): return imp.is_frozen(name)
项目:empyrion-python-api    作者:huhlig    | 项目源码 | 文件源码
def find_builtin_module(self, name):
        # XXX frozen packages?
        if self.hooks.is_builtin(name):
            return None, '', ('', '', BUILTIN_MODULE)
        if self.hooks.is_frozen(name):
            return None, '', ('', '', FROZEN_MODULE)
        return None
项目:ark-eiui    作者:Moustikitos    | 项目源码 | 文件源码
def main_is_frozen():
        return (hasattr(sys, "frozen") or hasattr(sys, "importers") or imp.is_frozen("__main__"))