本文整理汇总了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,
)
示例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########