當前位置: 首頁>>代碼示例>>Python>>正文


Python GrowlNotifier.subscribe方法代碼示例

本文整理匯總了Python中gntp.notifier.GrowlNotifier.subscribe方法的典型用法代碼示例。如果您正苦於以下問題:Python GrowlNotifier.subscribe方法的具體用法?Python GrowlNotifier.subscribe怎麽用?Python GrowlNotifier.subscribe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gntp.notifier.GrowlNotifier的用法示例。


在下文中一共展示了GrowlNotifier.subscribe方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_client

# 需要導入模塊: from gntp.notifier import GrowlNotifier [as 別名]
# 或者: from gntp.notifier.GrowlNotifier import subscribe [as 別名]
def test_client(config, options):
    logging.basicConfig(level=options.verbose)
    notifier = GrowlNotifier(
        hostname=config.get('regrowl.server', 'hostname', '127.0.0.1'),
        port=config.getint('regrowl.server', 'port'),
        password=config.get('regrowl.server', 'password'),
        notifications=['Test']
    )
    if options.test in ['registration', 'all']:
        notifier.register()
    if options.test in ['notification', 'all']:
        notifier.notify(
            noteType='Test',
            title='Testing',
            description='ReGrowl Test',
        )
    if options.test in ['subscription', 'all']:
        notifier.subscribe(
            'TestId',
            'TestName',
            1337,
        )
開發者ID:kfdm,項目名稱:gntp-regrowl,代碼行數:24,代碼來源:test.py

示例2: GrowlNotifier

# 需要導入模塊: from gntp.notifier import GrowlNotifier [as 別名]
# 或者: from gntp.notifier.GrowlNotifier import subscribe [as 別名]
########NEW FILE########
__FILENAME__ = attributes
#!/usr/bin/env python
# Simple manual test to make sure that attributes do not
# accumulate in the base classes
# https://github.com/kfdm/gntp/issues/10

import gntp
import gntp.notifier

a = gntp.notifier.GrowlNotifier(notifications=['A'])
b = gntp.notifier.GrowlNotifier(notifications=['B'])

a.notify('A','A','A',sticky=True)
b.notify('B','B','B')

########NEW FILE########
__FILENAME__ = subscribe
# -*- coding: utf-8 -*-
# Simple script to test sending UTF8 text with the GrowlNotifier class
import logging
logging.basicConfig(level=logging.DEBUG)
from gntp.notifier import GrowlNotifier
import platform

growl = GrowlNotifier(notifications=['Testing'],password='password',hostname='ayu')
growl.subscribe(platform.node(),platform.node(),12345)

########NEW FILE########
開發者ID:Mondego,項目名稱:pyreco,代碼行數:31,代碼來源:allPythonContent.py


注:本文中的gntp.notifier.GrowlNotifier.subscribe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。