• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.check_re函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.check_re函数的典型用法代码示例。如果您正苦于以下问题:Python check_re函数的具体用法?Python check_re怎么用?Python check_re使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了check_re函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_simple

def test_simple():
    module_wolfram_alpha.init(bot)
    query = "42"
    # Wolfram Alpha seems to randomly return also Roman numerals
    regex = u"(42 = forty-two|forty-two = XLII)"
    result = module_wolfram_alpha.command_wa(bot, None, "#channel", query)[1]
    check_re(regex, result)
开发者ID:EArmour,项目名称:pyfibot,代码行数:7,代码来源:test_wolfram_alpha.py


示例2: test_liveleak

def test_liveleak():
    regex = "Title: (.*?) by (.*?) \[%s views - Jul-23-2013 - tags\: sword, cut, hand, watermelon, fail\]" % (
        views_str_regex
    )
    msg = "http://www.liveleak.com/view?i=f8e_1374614129"
    module_urltitle.init(bot)
    check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
开发者ID:BiohZn,项目名称:pyfibot,代码行数:7,代码来源:test_urltitle.py


示例3: test_areena_not_available

def test_areena_not_available(botmock):
    regex = u"Title: (.*?) \[%s - %s - not available\]" % (
        length_str_regex,
        age_str_regex,
    )
    msg = "http://areena.yle.fi/1-2372901"
    check_re(regex, module_urltitle.handle_url(botmock, None, "#channel", msg, msg)[1])
开发者ID:lepinkainen,项目名称:pyfibot,代码行数:7,代码来源:test_areena.py


示例4: test_areena_tv_exiting

def test_areena_tv_exiting(botmock):
    regex = u"Title: (.*?) \[%s - %s( - exits in %s)?\]" % (
        length_str_regex,
        age_str_regex,
        age_str_regex,
    )
    msg = "http://areena.yle.fi/1-3093932"
    check_re(regex, module_urltitle.handle_url(botmock, None, "#channel", msg, msg)[1])
开发者ID:lepinkainen,项目名称:pyfibot,代码行数:8,代码来源:test_areena.py


示例5: test_youtube

def test_youtube():
    regex = "Title: (.*?) by (.*?) \[%s - %s views - %s( - age restricted)?\]" % (
        lengh_str_regex,
        views_str_regex,
        age_str_regex,
    )
    msg = "http://www.youtube.com/watch?v=awsolTK175c"
    module_urltitle.init(bot)
    check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
开发者ID:BiohZn,项目名称:pyfibot,代码行数:9,代码来源:test_urltitle.py


示例6: test_areena_tv_exiting_in_far_far_future

def test_areena_tv_exiting_in_far_far_future(botmock):
    from datetime import datetime

    if datetime.utcnow() < datetime(2098, 1, 1):
        regex = u'Title: Kummeli - 5x03 \[%s - %s\]' % (length_str_regex, age_str_regex)
    else:
        regex = u'Title: Kummeli - 5x03 \[%s - %s( - exits in %s)?\]' % (length_str_regex, age_str_regex, age_str_regex)

    msg = "http://areena.yle.fi/1-1823488"
    check_re(regex, module_urltitle.handle_url(botmock, None, "#channel", msg, msg)[1])
开发者ID:SriRamanujam,项目名称:pyfibot,代码行数:10,代码来源:test_areena.py


示例7: test_vimeo

def test_vimeo():
    regex = "Title: (.*?) by (.*?) \[%s - %s likes - %s views - %s]" % (
        lengh_str_regex,
        views_str_regex,
        views_str_regex,
        age_str_regex,
    )
    msg = "http://vimeo.com/29996808"
    module_urltitle.init(bot)
    check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
开发者ID:BiohZn,项目名称:pyfibot,代码行数:10,代码来源:test_urltitle.py


示例8: test_areena_live

def test_areena_live(botmock):
    regex = u"Title: Yle TV2 - (.*?)( <http://areena.yle.fi/\d-\d+>)? \(LIVE\)"
    msg = "http://areena.yle.fi/tv/suora/tv2"
    check_re(regex, module_urltitle.handle_url(botmock, None, "#channel", msg, msg)[1])
开发者ID:lepinkainen,项目名称:pyfibot,代码行数:4,代码来源:test_areena.py


示例9: test_youtube

def test_youtube(botmock):
    regex = 'Title: (.*?) by (.*?) \[%s - %s views - %s( - age restricted)?\]' % (lengh_str_regex, views_str_regex, age_str_regex)
    msg = "http://www.youtube.com/watch?v=awsolTK175c"
    module_urltitle.init(botmock)
    check_re(regex, __handle_url(botmock, msg))
开发者ID:gitter-badger,项目名称:pyfibot,代码行数:5,代码来源:test_urltitle.py


示例10: test_gfycat_reddit_title

def test_gfycat_reddit_title(botmock):
    regex = "Title: California Sunset \(/r/NatureGifs\) [email protected] \d+ views"
    msg = "http://www.gfycat.com/ZanyFragrantHoneyeater"
    check_re(regex, __handle_url(botmock, msg))
开发者ID:gitter-badger,项目名称:pyfibot,代码行数:4,代码来源:test_urltitle.py


示例11: test_areena_series

def test_areena_series(botmock):
    regex = u"Title: Kummeli \[SERIES - 54 episodes - latest episode: %s\]" % (
        age_str_regex
    )
    msg = "http://areena.yle.fi/1-3339547"
    check_re(regex, module_urltitle.handle_url(botmock, None, "#channel", msg, msg)[1])
开发者ID:lepinkainen,项目名称:pyfibot,代码行数:6,代码来源:test_areena.py


示例12: test_add_feed

def test_add_feed():
    check_re(
        r'feed added with \d+ items',
        command_rss(bot, ADMIN_USER, '#pyfibot', 'add http://feeds.feedburner.com/ampparit-kaikki?format=xml')[1]
    )
开发者ID:EArmour,项目名称:pyfibot,代码行数:5,代码来源:test_rss.py


示例13: test_gfycat_own_title

def test_gfycat_own_title(botmock):
    regex = "Title: Star Trail's in the Desert [email protected] \d+ views"
    msg = "https://www.gfycat.com/EcstaticWelllitHarpseal"
    check_re(regex, __handle_url(botmock, msg))
开发者ID:gitter-badger,项目名称:pyfibot,代码行数:4,代码来源:test_urltitle.py


示例14: test_areena_live

def test_areena_live():
    regex = u'Title: Yle TV2 - (.*?)( <http://areena.yle.fi/\d-\d+>)? \(LIVE\)'
    msg = "http://areena.yle.fi/tv/suora/tv2"
    module_urltitle.init(bot)
    check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
开发者ID:BiohZn,项目名称:pyfibot,代码行数:5,代码来源:test_areena.py


示例15: test_alko

def test_alko():
    regex = u'Title: Sandels IV A tölkki \[\d\.\d\de, \d\.\d\dl, \d\.\d\de/l, oluet, 5\.30\%\]'
    msg = 'http://www.alko.fi/tuotteet/798684/'
    module_urltitle.init(bot)
    check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
开发者ID:clooth,项目名称:pyfibot,代码行数:5,代码来源:test_urltitle.py


示例16: test_areena_tv

def test_areena_tv():
    regex = u'Title: (.*?) \[%s - %s plays - %s( - exits in \d+ (weeks|days|hours|minutes))?\]' % (lengh_str_regex, views_str_regex, age_str_regex)
    msg = "http://areena.yle.fi/1-1999860"
    module_urltitle.init(bot)
    check_re(regex, module_urltitle.handle_url(bot, None, "#channel", msg, msg)[1])
开发者ID:BiohZn,项目名称:pyfibot,代码行数:5,代码来源:test_areena.py


示例17: test_forecast

def test_forecast():
    regex = u'(Lappeenranta, (Finland|FI): tomorrow: -?\d+.\d - -?\d+.\d \xb0C \(.*?\), in 2 days: -?\d+.\d - -?\d+.\d \xb0C \(.*?\), in 3 days: -?\d+.\d - -?\d+.\d \xb0C \(.*?\))|(Error: API error.)'
    check_re(regex, module_openweather.command_forecast(bot, None, "#channel", 'lappeenranta')[1])
开发者ID:EArmour,项目名称:pyfibot,代码行数:3,代码来源:test_openweather.py


示例18: test_imdb

def test_imdb(botmock):
    regex = 'Title: Wreck-It Ralph \(2012\) - [\d.]{1,}/10 \(%s votes\) - .*' % views_str_regex
    msg = "http://www.imdb.com/title/tt1772341/"
    check_re(regex, __handle_url(botmock, msg))
开发者ID:gitter-badger,项目名称:pyfibot,代码行数:4,代码来源:test_urltitle.py


示例19: test_verkkokauppacom

def test_verkkokauppacom(botmock):
    msg = "http://www.verkkokauppa.com/fi/product/55124/dfbfn/Coca-Cola-Vanilla-USA-virvoitusjuoma-355-ml"
    regex = 'Title: Coca-Cola Vanilla USA virvoitusjuoma 355 ml \| \d+,\d+ € \(.*?\)'
    check_re(regex, __handle_url(botmock, msg))
开发者ID:gitter-badger,项目名称:pyfibot,代码行数:4,代码来源:test_urltitle.py


示例20: test_gfycat_direct_url

def test_gfycat_direct_url(botmock):
    regex = "Title: \(/r/NatureGifs\) [email protected] \d+ views"
    msg = "https://zippy.gfycat.com/QualifiedSpanishAmericankestrel.webm"
    check_re(regex, __handle_url(botmock, msg))
开发者ID:gitter-badger,项目名称:pyfibot,代码行数:4,代码来源:test_urltitle.py



注:本文中的utils.check_re函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.check_srv_keyspace函数代码示例发布时间:2022-05-26
下一篇:
Python utils.check_or_exit函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap