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

Python pync.Notifier类代码示例

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

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



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

示例1: search

def search(num_colors, graph):
    # Do a depth-first search over the configuration space, keeping a
    # stack of assignments and variable domains.

    init_cfg = Assignment(num_colors, graph)
    stack = [(init_cfg, init_cfg.choose())]

    while stack and not stack[-1][0].complete():
        
        cur_var, cur_vals = stack[-1][1]

        if not cur_vals:
            stack.pop()
        else:
            # If we still have options with our current stack frame
            new_val = cur_vals.pop(0)
            new_cfg = stack[-1][0].set(cur_var, new_val)

            if new_cfg.propagate():
                stack.append((new_cfg, new_cfg.choose()))

    if stack and stack[-1][0].complete():
        Notifier.notify("Found a solution!",title="GraphColorizer")
        return [v[0] for v in stack[-1][0].table] 
    else:
        print "Failed @num_colors=%d" % num_colors
        Notifier.notify("Failed @num_colors=%d. :(" % num_colors, title="GraphColorizer")
        return search(num_colors+1, graph)
开发者ID:nathanwbrei,项目名称:coloring,代码行数:28,代码来源:brain.py


示例2: main

def main():
    parser = optparse.OptionParser()
    using_help = '''
    the service that you want to use. For example: gist for Github's Gist,
    pastebin for PasteBin.com
    '''
    parser.add_option('-u', '--using', dest='using',
                      help=using_help)

    (options, args) = parser.parse_args()

    using = options.using
    if not using:
        using = 'pastebin'

    obj = SharePastesFactory.create(using)
    try:
        url = obj.api_call(xerox.paste())
        xerox.copy(url)
    except xerox.base.XclipNotFound:
        print 'xclip not found. Install xclip for SharePastes to work.'
        sys.exit(1)

    try:
        from pync import Notifier
        Notifier.notify('URL added to your clipboard %s.' % url,
                        title='SharePastes')
    except:
        pass
开发者ID:vaidik,项目名称:sharepastes,代码行数:29,代码来源:runner.py


示例3: notification

def notification(num,soup):
	tag = soup(id=num)[0]
	price = tag.parent.parent(class_="gr")[0].text
	rate = tag.parent.parent(class_="bg")[0].text
	brand = tag.parent.parent.a.text.encode('utf-8')
	value = '%s\t%s' % (price, rate)
	Notifier.notify(value.encode('utf-8'),title=brand,group=num, remove=num, sound='Glass')
开发者ID:raymondyan,项目名称:jijin,代码行数:7,代码来源:value.py


示例4: notify

def notify(data, buffer, date, tags, displayed, highlight, prefix, message):
	if weechat.config_get_plugin('show_highlights') == 'on' and highlight == '1':
		channel = weechat.buffer_get_string(buffer, 'localvar_channel')
		Notifier.notify(message, title='%s %s' % (prefix, channel))
	elif weechat.config_get_plugin('show_private_message') == 'on' and 'notify_private' in tags:
		Notifier.notify(message, title='%s [private]' % prefix)
	return weechat.WEECHAT_RC_OK
开发者ID:frumiousbandersnatch,项目名称:weechat-scripts,代码行数:7,代码来源:notification_center.py


示例5: finalize

    def finalize(self, result):
        failures = len(result.failures)
        errors = len(result.errors)
        folder = result.config.workingDir.strip('/').split('/')[-1]

        if result.wasSuccessful():
            title = "Tests passed in: %s" % folder
            msg = '%s All of your %s test(s) passed!' % (
                self.success_msg,
                result.testsRun,
            )
        else:
            msg = '%s %s failures, %s errors from %s tests' % (
                self.failure_msg,
                failures,
                errors,
                result.testsRun,
            )
            title = "Tests failed in: %s" % folder

        Notifier.notify(
            msg,
            title=title,
            group='%s_%s_tests' % (folder, self.name),
        )
开发者ID:dreynolds,项目名称:nose-notification-centre,代码行数:25,代码来源:ncplugin.py


示例6: notify

def notify(showfeed):
    try:
        for feed in showfeed:
            content = feed['content']
            retext = re.sub(ur'<.*?>', '', content, 0)
            keyword = re.compile(ur'常客说|李凯|young|水洋|协议|转让', re.M)
            if re.search(keyword, retext) == None:
                notice = ''
            else:
                notice = '    ' + '⚠️' + '注意'
            if feed['userinfo']['ext_info']['special_description'] == '':
                description = ''
            else:
                description = '    ' + ' 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python pyndn.Data类代码示例发布时间:2022-05-27
下一篇:
Python pynbody.new函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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