python类PY2的实例源码

nodes.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:Sci-Finder 作者: snverse 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:RPoint 作者: george17-meet 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
__init__.py 文件源码 项目:flasky 作者: RoseOu 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def suite():
    from jinja2.testsuite import ext, filters, tests, core_tags, \
         loader, inheritance, imports, lexnparse, security, api, \
         regression, debug, utils, bytecode_cache, doctests
    suite = unittest.TestSuite()
    suite.addTest(ext.suite())
    suite.addTest(filters.suite())
    suite.addTest(tests.suite())
    suite.addTest(core_tags.suite())
    suite.addTest(loader.suite())
    suite.addTest(inheritance.suite())
    suite.addTest(imports.suite())
    suite.addTest(lexnparse.suite())
    suite.addTest(security.suite())
    suite.addTest(api.suite())
    suite.addTest(regression.suite())
    suite.addTest(debug.suite())
    suite.addTest(utils.suite())
    suite.addTest(bytecode_cache.suite())

    # doctests will not run on python 3 currently.  Too many issues
    # with that, do not test that on that platform.
    if PY2:
        suite.addTest(doctests.suite())

    return suite
__init__.py 文件源码 项目:oa_qian 作者: sunqb 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def suite():
    from jinja2.testsuite import ext, filters, tests, core_tags, \
         loader, inheritance, imports, lexnparse, security, api, \
         regression, debug, utils, bytecode_cache, doctests
    suite = unittest.TestSuite()
    suite.addTest(ext.suite())
    suite.addTest(filters.suite())
    suite.addTest(tests.suite())
    suite.addTest(core_tags.suite())
    suite.addTest(loader.suite())
    suite.addTest(inheritance.suite())
    suite.addTest(imports.suite())
    suite.addTest(lexnparse.suite())
    suite.addTest(security.suite())
    suite.addTest(api.suite())
    suite.addTest(regression.suite())
    suite.addTest(debug.suite())
    suite.addTest(utils.suite())
    suite.addTest(bytecode_cache.suite())

    # doctests will not run on python 3 currently.  Too many issues
    # with that, do not test that on that platform.
    if PY2:
        suite.addTest(doctests.suite())

    return suite
nodes.py 文件源码 项目:RealtimePythonChat 作者: quangtqag 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:Indushell 作者: SecarmaLabs 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:Liljimbo-Chatbot 作者: chrisjim316 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:flask_system 作者: prashasy 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:ShelbySearch 作者: Agentscreech 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
__init__.py 文件源码 项目:pyetje 作者: rorlika 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def suite():
    from jinja2.testsuite import ext, filters, tests, core_tags, \
         loader, inheritance, imports, lexnparse, security, api, \
         regression, debug, utils, bytecode_cache, doctests
    suite = unittest.TestSuite()
    suite.addTest(ext.suite())
    suite.addTest(filters.suite())
    suite.addTest(tests.suite())
    suite.addTest(core_tags.suite())
    suite.addTest(loader.suite())
    suite.addTest(inheritance.suite())
    suite.addTest(imports.suite())
    suite.addTest(lexnparse.suite())
    suite.addTest(security.suite())
    suite.addTest(api.suite())
    suite.addTest(regression.suite())
    suite.addTest(debug.suite())
    suite.addTest(utils.suite())
    suite.addTest(bytecode_cache.suite())

    # doctests will not run on python 3 currently.  Too many issues
    # with that, do not test that on that platform.
    if PY2:
        suite.addTest(doctests.suite())

    return suite
nodes.py 文件源码 项目:FileStoreGAE 作者: liantian-cn 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:python-group-proj 作者: Sharcee 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:islam-buddy 作者: hamir 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
__init__.py 文件源码 项目:Callandtext 作者: iaora 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def suite():
    from jinja2.testsuite import ext, filters, tests, core_tags, \
         loader, inheritance, imports, lexnparse, security, api, \
         regression, debug, utils, bytecode_cache, doctests
    suite = unittest.TestSuite()
    suite.addTest(ext.suite())
    suite.addTest(filters.suite())
    suite.addTest(tests.suite())
    suite.addTest(core_tags.suite())
    suite.addTest(loader.suite())
    suite.addTest(inheritance.suite())
    suite.addTest(imports.suite())
    suite.addTest(lexnparse.suite())
    suite.addTest(security.suite())
    suite.addTest(api.suite())
    suite.addTest(regression.suite())
    suite.addTest(debug.suite())
    suite.addTest(utils.suite())
    suite.addTest(bytecode_cache.suite())

    # doctests will not run on python 3 currently.  Too many issues
    # with that, do not test that on that platform.
    if PY2:
        suite.addTest(doctests.suite())

    return suite
__init__.py 文件源码 项目:My-Web-Server-Framework-With-Python2.7 作者: syjsu 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def suite():
    from jinja2.testsuite import ext, filters, tests, core_tags, \
         loader, inheritance, imports, lexnparse, security, api, \
         regression, debug, utils, bytecode_cache, doctests
    suite = unittest.TestSuite()
    suite.addTest(ext.suite())
    suite.addTest(filters.suite())
    suite.addTest(tests.suite())
    suite.addTest(core_tags.suite())
    suite.addTest(loader.suite())
    suite.addTest(inheritance.suite())
    suite.addTest(imports.suite())
    suite.addTest(lexnparse.suite())
    suite.addTest(security.suite())
    suite.addTest(api.suite())
    suite.addTest(regression.suite())
    suite.addTest(debug.suite())
    suite.addTest(utils.suite())
    suite.addTest(bytecode_cache.suite())

    # doctests will not run on python 3 currently.  Too many issues
    # with that, do not test that on that platform.
    if PY2:
        suite.addTest(doctests.suite())

    return suite
nodes.py 文件源码 项目:PornGuys 作者: followloda 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:jieba-GAE 作者: liantian-cn 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:webapp 作者: superchilli 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:pipenv 作者: pypa 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:QualquerMerdaAPI 作者: tiagovizoto 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:gardenbot 作者: GoestaO 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:flask-zhenai-mongo-echarts 作者: Fretice 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:hate-to-hugs 作者: sdoran35 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:ieee-cs-txst 作者: codestar12 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:deliver 作者: orchestor 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:sam-s-club-auctions 作者: sameer2800 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:WhatTheHack 作者: Sylphias 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:WhatTheHack 作者: Sylphias 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv
nodes.py 文件源码 项目:blog_flask 作者: momantai 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def as_const(self, eval_ctx=None):
        rv = self.value
        if PY2 and type(rv) is text_type and \
           self.environment.policies['compiler.ascii_str']:
            try:
                rv = rv.encode('ascii')
            except UnicodeError:
                pass
        return rv


问题


面经


文章

微信
公众号

扫码关注公众号