python类install_hooks()的实例源码

fix_add_future_standard_library_import.py 文件源码 项目:FightstickDisplay 作者: calexil 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def transform(self, node, results):
        # TODO: add a blank line between any __future__ imports and this?
        touch_import_top(u'future', u'standard_library', node)
        # TODO: also add standard_library.install_hooks()
__init__.py 文件源码 项目:FightstickDisplay 作者: calexil 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __enter__(self):
        # flog.debug('Entering hooks context manager')
        self.old_sys_modules = copy.copy(sys.modules)
        self.hooks_were_installed = detect_hooks()
        # self.scrubbed = scrub_py2_sys_modules()
        install_hooks()
        return self
__init__.py 文件源码 项目:FightstickDisplay 作者: calexil 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __exit__(self, *args):
        if self.hooks_were_installed:
            install_hooks()
        # restore_sys_modules(self.scrubbed)
__init__.py 文件源码 项目:FightstickDisplay 作者: calexil 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def enable_hooks():
    """
    Deprecated. Use install_hooks() instead. This will be removed by
    ``future`` v1.0.
    """
    install_hooks()
fix_add_future_standard_library_import.py 文件源码 项目:cryptogram 作者: xinmingzhang 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def transform(self, node, results):
        # TODO: add a blank line between any __future__ imports and this?
        touch_import_top(u'future', u'standard_library', node)
        # TODO: also add standard_library.install_hooks()
__init__.py 文件源码 项目:cryptogram 作者: xinmingzhang 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __enter__(self):
        # flog.debug('Entering hooks context manager')
        self.old_sys_modules = copy.copy(sys.modules)
        self.hooks_were_installed = detect_hooks()
        # self.scrubbed = scrub_py2_sys_modules()
        install_hooks()
        return self
__init__.py 文件源码 项目:cryptogram 作者: xinmingzhang 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __exit__(self, *args):
        if self.hooks_were_installed:
            install_hooks()
        # restore_sys_modules(self.scrubbed)
__init__.py 文件源码 项目:cryptogram 作者: xinmingzhang 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def enable_hooks():
    """
    Deprecated. Use install_hooks() instead. This will be removed by
    ``future`` v1.0.
    """
    install_hooks()
fix_add_future_standard_library_import.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def transform(self, node, results):
        # TODO: add a blank line between any __future__ imports and this?
        touch_import_top(u'future', u'standard_library', node)
        # TODO: also add standard_library.install_hooks()
__init__.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __enter__(self):
        # flog.debug('Entering hooks context manager')
        self.old_sys_modules = copy.copy(sys.modules)
        self.hooks_were_installed = detect_hooks()
        # self.scrubbed = scrub_py2_sys_modules()
        install_hooks()
        return self
__init__.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __exit__(self, *args):
        if self.hooks_were_installed:
            install_hooks()
        # restore_sys_modules(self.scrubbed)
__init__.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def enable_hooks():
    """
    Deprecated. Use install_hooks() instead. This will be removed by
    ``future`` v1.0.
    """
    install_hooks()
fix_add_future_standard_library_import.py 文件源码 项目:UMOG 作者: hsab 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def transform(self, node, results):
        # TODO: add a blank line between any __future__ imports and this?
        touch_import_top(u'future', u'standard_library', node)
        # TODO: also add standard_library.install_hooks()
__init__.py 文件源码 项目:UMOG 作者: hsab 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __enter__(self):
        # flog.debug('Entering hooks context manager')
        self.old_sys_modules = copy.copy(sys.modules)
        self.hooks_were_installed = detect_hooks()
        # self.scrubbed = scrub_py2_sys_modules()
        install_hooks()
        return self
__init__.py 文件源码 项目:UMOG 作者: hsab 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __exit__(self, *args):
        if self.hooks_were_installed:
            install_hooks()
        # restore_sys_modules(self.scrubbed)
__init__.py 文件源码 项目:UMOG 作者: hsab 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def enable_hooks():
    """
    Deprecated. Use install_hooks() instead. This will be removed by
    ``future`` v1.0.
    """
    install_hooks()
fix_add_future_standard_library_import.py 文件源码 项目:blackmamba 作者: zrzka 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def transform(self, node, results):
        # TODO: add a blank line between any __future__ imports and this?
        touch_import_top(u'future', u'standard_library', node)
        # TODO: also add standard_library.install_hooks()
__init__.py 文件源码 项目:blackmamba 作者: zrzka 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __enter__(self):
        # flog.debug('Entering hooks context manager')
        self.old_sys_modules = copy.copy(sys.modules)
        self.hooks_were_installed = detect_hooks()
        # self.scrubbed = scrub_py2_sys_modules()
        install_hooks()
        return self
__init__.py 文件源码 项目:blackmamba 作者: zrzka 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __exit__(self, *args):
        if self.hooks_were_installed:
            install_hooks()
        # restore_sys_modules(self.scrubbed)
__init__.py 文件源码 项目:blackmamba 作者: zrzka 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def enable_hooks():
    """
    Deprecated. Use install_hooks() instead. This will be removed by
    ``future`` v1.0.
    """
    install_hooks()


问题


面经


文章

微信
公众号

扫码关注公众号