Exemplo n.º 1
0
	def alert(self, title, message, image, callback):
		if self.use_cache:
			image = Cache.image_cache(image)

		try:
			self.notifier.notify(
				noteType='Now Playing',
				title=title,
				description=message,
				icon=image,
				callback=callback,
				)
		except:
			logger.exception('Is growl running ?')
Exemplo n.º 2
0
	def __init__(self, use_cache=False):
		self.use_cache = use_cache

		image = 'http://www.animenfo.com/favicon.ico'
		if self.use_cache:
			image = Cache.image_cache(image)

		self.notifier = _Notifier(
			applicationName='AnimeNFO Radio',
			notifications=['Now Playing'],
			applicationIcon=image,
		)
		try:
			self.notifier.register()
		except gntp.errors.NetworkError:
			logger.exception('Unable to register with Growl')
			exit(1)